summaryrefslogtreecommitdiff
path: root/ext/posix/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/posix/posix.c')
-rw-r--r--ext/posix/posix.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 301507f655..463cb76d36 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -325,24 +325,24 @@ static PHP_GINIT_FUNCTION(posix) /* {{{ */
*/
static PHP_MINIT_FUNCTION(posix)
{
- REGISTER_LONG_CONSTANT("POSIX_F_OK", F_OK, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("POSIX_X_OK", X_OK, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("POSIX_W_OK", W_OK, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("POSIX_R_OK", R_OK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_F_OK", F_OK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_X_OK", X_OK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_W_OK", W_OK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_R_OK", R_OK, CONST_CS | CONST_PERSISTENT);
#ifdef S_IFREG
- REGISTER_LONG_CONSTANT("POSIX_S_IFREG", S_IFREG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_S_IFREG", S_IFREG, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef S_IFCHR
- REGISTER_LONG_CONSTANT("POSIX_S_IFCHR", S_IFCHR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_S_IFCHR", S_IFCHR, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef S_IFBLK
- REGISTER_LONG_CONSTANT("POSIX_S_IFBLK", S_IFBLK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_S_IFBLK", S_IFBLK, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef S_IFIFO
- REGISTER_LONG_CONSTANT("POSIX_S_IFIFO", S_IFIFO, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_S_IFIFO", S_IFIFO, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef S_IFSOCK
- REGISTER_LONG_CONSTANT("POSIX_S_IFSOCK", S_IFSOCK, CONST_CS | CONST_PERSISTENT);
+ REGISTER_INT_CONSTANT("POSIX_S_IFSOCK", S_IFSOCK, CONST_CS | CONST_PERSISTENT);
#endif
return SUCCESS;
@@ -375,9 +375,9 @@ ZEND_GET_MODULE(posix)
#define PHP_POSIX_NO_ARGS if (zend_parse_parameters_none() == FAILURE) return;
-#define PHP_POSIX_RETURN_LONG_FUNC(func_name) \
+#define PHP_POSIX_RETURN_INT_FUNC(func_name) \
PHP_POSIX_NO_ARGS \
- RETURN_LONG(func_name());
+ RETURN_INT(func_name());
#define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \
long val; \
@@ -412,7 +412,7 @@ PHP_FUNCTION(posix_kill)
Get the current process id (POSIX.1, 4.1.1) */
PHP_FUNCTION(posix_getpid)
{
- PHP_POSIX_RETURN_LONG_FUNC(getpid);
+ PHP_POSIX_RETURN_INT_FUNC(getpid);
}
/* }}} */
@@ -420,7 +420,7 @@ PHP_FUNCTION(posix_getpid)
Get the parent process id (POSIX.1, 4.1.1) */
PHP_FUNCTION(posix_getppid)
{
- PHP_POSIX_RETURN_LONG_FUNC(getppid);
+ PHP_POSIX_RETURN_INT_FUNC(getppid);
}
/* }}} */
@@ -428,7 +428,7 @@ PHP_FUNCTION(posix_getppid)
Get the current user id (POSIX.1, 4.2.1) */
PHP_FUNCTION(posix_getuid)
{
- PHP_POSIX_RETURN_LONG_FUNC(getuid);
+ PHP_POSIX_RETURN_INT_FUNC(getuid);
}
/* }}} */
@@ -436,7 +436,7 @@ PHP_FUNCTION(posix_getuid)
Get the current group id (POSIX.1, 4.2.1) */
PHP_FUNCTION(posix_getgid)
{
- PHP_POSIX_RETURN_LONG_FUNC(getgid);
+ PHP_POSIX_RETURN_INT_FUNC(getgid);
}
/* }}} */
@@ -444,7 +444,7 @@ PHP_FUNCTION(posix_getgid)
Get the current effective user id (POSIX.1, 4.2.1) */
PHP_FUNCTION(posix_geteuid)
{
- PHP_POSIX_RETURN_LONG_FUNC(geteuid);
+ PHP_POSIX_RETURN_INT_FUNC(geteuid);
}
/* }}} */
@@ -452,7 +452,7 @@ PHP_FUNCTION(posix_geteuid)
Get the current effective group id (POSIX.1, 4.2.1) */
PHP_FUNCTION(posix_getegid)
{
- PHP_POSIX_RETURN_LONG_FUNC(getegid);
+ PHP_POSIX_RETURN_INT_FUNC(getegid);
}
/* }}} */
@@ -511,7 +511,7 @@ PHP_FUNCTION(posix_getgroups)
array_init(return_value);
for (i=0; i<result; i++) {
- add_next_index_long(return_value, gidlist[i]);
+ add_next_index_int(return_value, gidlist[i]);
}
}
#endif
@@ -540,7 +540,7 @@ PHP_FUNCTION(posix_getlogin)
Get current process group id (POSIX.1, 4.3.1) */
PHP_FUNCTION(posix_getpgrp)
{
- PHP_POSIX_RETURN_LONG_FUNC(getpgrp);
+ PHP_POSIX_RETURN_INT_FUNC(getpgrp);
}
/* }}} */
@@ -549,7 +549,7 @@ PHP_FUNCTION(posix_getpgrp)
#ifdef HAVE_SETSID
PHP_FUNCTION(posix_setsid)
{
- PHP_POSIX_RETURN_LONG_FUNC(setsid);
+ PHP_POSIX_RETURN_INT_FUNC(setsid);
}
#endif
/* }}} */
@@ -587,7 +587,7 @@ PHP_FUNCTION(posix_getpgid)
POSIX_G(last_error) = errno;
RETURN_FALSE;
}
- RETURN_LONG(val);
+ RETURN_INT(val);
}
#endif
/* }}} */
@@ -606,7 +606,7 @@ PHP_FUNCTION(posix_getsid)
POSIX_G(last_error) = errno;
RETURN_FALSE;
}
- RETURN_LONG(val);
+ RETURN_INT(val);
}
#endif
/* }}} */
@@ -658,11 +658,11 @@ PHP_FUNCTION(posix_times)
array_init(return_value);
- add_assoc_long(return_value, "ticks", ticks); /* clock ticks */
- add_assoc_long(return_value, "utime", t.tms_utime); /* user time */
- add_assoc_long(return_value, "stime", t.tms_stime); /* system time */
- add_assoc_long(return_value, "cutime", t.tms_cutime); /* user time of children */
- add_assoc_long(return_value, "cstime", t.tms_cstime); /* system time of children */
+ add_assoc_int(return_value, "ticks", ticks); /* clock ticks */
+ add_assoc_int(return_value, "utime", t.tms_utime); /* user time */
+ add_assoc_int(return_value, "stime", t.tms_stime); /* system time */
+ add_assoc_int(return_value, "cutime", t.tms_cutime); /* user time of children */
+ add_assoc_int(return_value, "cstime", t.tms_cstime); /* system time of children */
}
/* }}} */
@@ -738,8 +738,8 @@ PHP_FUNCTION(posix_ttyname)
}
break;
default:
- convert_to_long_ex(z_fd);
- fd = Z_LVAL_P(z_fd);
+ convert_to_int_ex(z_fd);
+ fd = Z_IVAL_P(z_fd);
}
#if defined(ZTS) && defined(HAVE_TTYNAME_R) && defined(_SC_TTY_NAME_MAX)
buflen = sysconf(_SC_TTY_NAME_MAX);
@@ -783,8 +783,8 @@ PHP_FUNCTION(posix_isatty)
}
break;
default:
- convert_to_long_ex(z_fd);
- fd = Z_LVAL_P(z_fd);
+ convert_to_int_ex(z_fd);
+ fd = Z_IVAL_P(z_fd);
}
if (isatty(fd)) {
@@ -931,7 +931,7 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
add_next_index_string(&array_members, g->gr_mem[count]);
}
zend_hash_str_update(Z_ARRVAL_P(array_group), "members", sizeof("members")-1, &array_members);
- add_assoc_long(array_group, "gid", g->gr_gid);
+ add_assoc_int(array_group, "gid", g->gr_gid);
return 1;
}
/* }}} */
@@ -1096,8 +1096,8 @@ int php_posix_passwd_to_array(struct passwd *pw, zval *return_value) /* {{{ */
add_assoc_string(return_value, "name", pw->pw_name);
add_assoc_string(return_value, "passwd", pw->pw_passwd);
- add_assoc_long (return_value, "uid", pw->pw_uid);
- add_assoc_long (return_value, "gid", pw->pw_gid);
+ add_assoc_int (return_value, "uid", pw->pw_uid);
+ add_assoc_int (return_value, "gid", pw->pw_gid);
add_assoc_string(return_value, "gecos", pw->pw_gecos);
add_assoc_string(return_value, "dir", pw->pw_dir);
add_assoc_string(return_value, "shell", pw->pw_shell);
@@ -1229,13 +1229,13 @@ static int posix_addlimit(int limit, char *name, zval *return_value TSRMLS_DC) {
if (rl.rlim_cur == RLIM_INFINITY) {
add_assoc_stringl(return_value, soft, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1);
} else {
- add_assoc_long(return_value, soft, rl.rlim_cur);
+ add_assoc_int(return_value, soft, rl.rlim_cur);
}
if (rl.rlim_max == RLIM_INFINITY) {
add_assoc_stringl(return_value, hard, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1);
} else {
- add_assoc_long(return_value, hard, rl.rlim_max);
+ add_assoc_int(return_value, hard, rl.rlim_max);
}
return SUCCESS;
@@ -1328,7 +1328,7 @@ PHP_FUNCTION(posix_get_last_error)
{
PHP_POSIX_NO_ARGS;
- RETURN_LONG(POSIX_G(last_error));
+ RETURN_INT(POSIX_G(last_error));
}
/* }}} */