mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 18:35:42 +00:00
fixed ext/posix
This commit is contained in:
1 parent
73a7351a2c
commit
3a8ee7800c
1 file changed
+35
-34
+35
-34
@@ -380,8 +380,8 @@ ZEND_GET_MODULE(posix)
|
||||
RETURN_LONG(func_name());
|
||||
|
||||
#define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \
|
||||
long val; \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) RETURN_FALSE; \
|
||||
php_int_t val; \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &val) == FAILURE) RETURN_FALSE; \
|
||||
if (func_name(val) < 0) { \
|
||||
POSIX_G(last_error) = errno; \
|
||||
RETURN_FALSE; \
|
||||
@@ -393,9 +393,9 @@ ZEND_GET_MODULE(posix)
|
||||
|
||||
PHP_FUNCTION(posix_kill)
|
||||
{
|
||||
long pid, sig;
|
||||
php_int_t pid, sig;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &pid, &sig) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -558,9 +558,9 @@ PHP_FUNCTION(posix_setsid)
|
||||
Set process group id for job control (POSIX.1, 4.3.3) */
|
||||
PHP_FUNCTION(posix_setpgid)
|
||||
{
|
||||
long pid, pgid;
|
||||
php_int_t pid, pgid;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &pid, &pgid) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -578,8 +578,8 @@ PHP_FUNCTION(posix_setpgid)
|
||||
#ifdef HAVE_GETPGID
|
||||
PHP_FUNCTION(posix_getpgid)
|
||||
{
|
||||
long val;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
|
||||
php_int_t val;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &val) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -597,8 +597,8 @@ PHP_FUNCTION(posix_getpgid)
|
||||
#ifdef HAVE_GETSID
|
||||
PHP_FUNCTION(posix_getsid)
|
||||
{
|
||||
long val;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
|
||||
php_int_t val;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &val) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -724,7 +724,7 @@ PHP_FUNCTION(posix_ttyname)
|
||||
char *p;
|
||||
int fd;
|
||||
#if defined(ZTS) && defined(HAVE_TTYNAME_R) && defined(_SC_TTY_NAME_MAX)
|
||||
long buflen;
|
||||
php_int_t buflen;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &z_fd) == FAILURE) {
|
||||
@@ -834,11 +834,11 @@ PHP_FUNCTION(posix_getcwd)
|
||||
PHP_FUNCTION(posix_mkfifo)
|
||||
{
|
||||
char *path;
|
||||
int path_len;
|
||||
long mode;
|
||||
zend_str_size_int path_len;
|
||||
php_int_t mode;
|
||||
int result;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Pi", &path, &path_len, &mode) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -863,15 +863,15 @@ PHP_FUNCTION(posix_mkfifo)
|
||||
PHP_FUNCTION(posix_mknod)
|
||||
{
|
||||
char *path;
|
||||
int path_len;
|
||||
long mode;
|
||||
long major = 0, minor = 0;
|
||||
zend_str_size_int path_len;
|
||||
php_int_t mode;
|
||||
php_int_t major = 0, minor = 0;
|
||||
int result;
|
||||
dev_t php_dev;
|
||||
|
||||
php_dev = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Pi|ii", &path, &path_len,
|
||||
&mode, &major, &minor) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -947,11 +947,12 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
|
||||
Determine accessibility of a file (POSIX.1 5.6.3) */
|
||||
PHP_FUNCTION(posix_access)
|
||||
{
|
||||
long mode = 0;
|
||||
int filename_len, ret;
|
||||
php_int_t mode = 0;
|
||||
zend_str_size_int filename_len;
|
||||
int ret;
|
||||
char *filename, *path;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|i", &filename, &filename_len, &mode) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -992,14 +993,14 @@ PHP_FUNCTION(posix_getgrnam)
|
||||
{
|
||||
char *name;
|
||||
struct group *g;
|
||||
int name_len;
|
||||
zend_str_size_int name_len;
|
||||
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
|
||||
struct group gbuf;
|
||||
long buflen;
|
||||
char *buf;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name, &name_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1039,7 +1040,7 @@ PHP_FUNCTION(posix_getgrnam)
|
||||
Group database access (POSIX.1, 9.2.1) */
|
||||
PHP_FUNCTION(posix_getgrgid)
|
||||
{
|
||||
long gid;
|
||||
php_int_t gid;
|
||||
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
|
||||
int ret;
|
||||
struct group _g;
|
||||
@@ -1049,7 +1050,7 @@ PHP_FUNCTION(posix_getgrgid)
|
||||
#endif
|
||||
struct group *g;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &gid) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
|
||||
@@ -1111,14 +1112,14 @@ PHP_FUNCTION(posix_getpwnam)
|
||||
{
|
||||
struct passwd *pw;
|
||||
char *name;
|
||||
int name_len;
|
||||
zend_str_size_int name_len;
|
||||
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
|
||||
struct passwd pwbuf;
|
||||
long buflen;
|
||||
char *buf;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name, &name_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1158,7 +1159,7 @@ PHP_FUNCTION(posix_getpwnam)
|
||||
User database access (POSIX.1, 9.2.2) */
|
||||
PHP_FUNCTION(posix_getpwuid)
|
||||
{
|
||||
long uid;
|
||||
php_int_t uid;
|
||||
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
|
||||
struct passwd _pw;
|
||||
struct passwd *retpwptr = NULL;
|
||||
@@ -1168,7 +1169,7 @@ PHP_FUNCTION(posix_getpwuid)
|
||||
#endif
|
||||
struct passwd *pw;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &uid) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
|
||||
@@ -1336,9 +1337,9 @@ PHP_FUNCTION(posix_get_last_error)
|
||||
Retrieve the system error message associated with the given errno. */
|
||||
PHP_FUNCTION(posix_strerror)
|
||||
{
|
||||
long error;
|
||||
php_int_t error;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &error) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1353,11 +1354,11 @@ PHP_FUNCTION(posix_strerror)
|
||||
Calculate the group access list for the user specified in name. */
|
||||
PHP_FUNCTION(posix_initgroups)
|
||||
{
|
||||
long basegid;
|
||||
php_int_t basegid;
|
||||
char *name;
|
||||
int name_len;
|
||||
zend_str_size_int name_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Si", &name, &name_len, &basegid) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user