sniper Mon May 9 08:16:20 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/posix config.m4 php_posix.h posix.c Log: MFH: - getlogin() / getgroups() are not necessarily available everywhere http://cvs.php.net/diff.php/php-src/ext/posix/config.m4?r1=1.7&r2=1.7.4.1&ty=u Index: php-src/ext/posix/config.m4 diff -u php-src/ext/posix/config.m4:1.7 php-src/ext/posix/config.m4:1.7.4.1 --- php-src/ext/posix/config.m4:1.7 Tue Mar 12 11:32:13 2002 +++ php-src/ext/posix/config.m4 Mon May 9 08:16:19 2005 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.7 2002/03/12 16:32:13 sas Exp $ +dnl $Id: config.m4,v 1.7.4.1 2005/05/09 12:16:19 sniper Exp $ dnl PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions, @@ -9,5 +9,5 @@ AC_DEFINE(HAVE_POSIX, 1, [whether to include POSIX-like functions]) PHP_NEW_EXTENSION(posix, posix.c, $ext_shared) - AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo getrlimit) + AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo getrlimit getlogin getgroups) fi http://cvs.php.net/diff.php/php-src/ext/posix/php_posix.h?r1=1.11.8.1&r2=1.11.8.2&ty=u Index: php-src/ext/posix/php_posix.h diff -u php-src/ext/posix/php_posix.h:1.11.8.1 php-src/ext/posix/php_posix.h:1.11.8.2 --- php-src/ext/posix/php_posix.h:1.11.8.1 Tue Dec 31 11:35:13 2002 +++ php-src/ext/posix/php_posix.h Mon May 9 08:16:19 2005 @@ -17,7 +17,7 @@ */ -/* $Id: php_posix.h,v 1.11.8.1 2002/12/31 16:35:13 sebastian Exp $ */ +/* $Id: php_posix.h,v 1.11.8.2 2005/05/09 12:16:19 sniper Exp $ */ #ifndef PHP_POSIX_H #define PHP_POSIX_H @@ -54,8 +54,12 @@ #ifdef HAVE_SETEGID PHP_FUNCTION(posix_setegid); #endif +#ifdef HAVE_GETGROUPS PHP_FUNCTION(posix_getgroups); +#endif +#ifdef HAVE_GETLOGIN PHP_FUNCTION(posix_getlogin); +#endif /* POSIX.1, 4.3 */ PHP_FUNCTION(posix_getpgrp); http://cvs.php.net/diff.php/php-src/ext/posix/posix.c?r1=1.51.2.3&r2=1.51.2.4&ty=u Index: php-src/ext/posix/posix.c diff -u php-src/ext/posix/posix.c:1.51.2.3 php-src/ext/posix/posix.c:1.51.2.4 --- php-src/ext/posix/posix.c:1.51.2.3 Thu Jan 27 20:39:42 2005 +++ php-src/ext/posix/posix.c Mon May 9 08:16:19 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.51.2.3 2005/01/28 01:39:42 tony2001 Exp $ */ +/* $Id: posix.c,v 1.51.2.4 2005/05/09 12:16:19 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -69,8 +69,12 @@ #ifdef HAVE_SETEGID PHP_FE(posix_setegid, NULL) #endif +#ifdef HAVE_GETGROUPS PHP_FE(posix_getgroups, NULL) +#endif +#ifdef HAVE_GETLOGIN PHP_FE(posix_getlogin, NULL) +#endif /* POSIX.1, 4.3 */ PHP_FE(posix_getpgrp, NULL) @@ -130,7 +134,7 @@ static PHP_MINFO_FUNCTION(posix) { php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.51.2.3 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.51.2.4 $"); php_info_print_table_end(); } /* }}} */ @@ -363,6 +367,7 @@ /* {{{ proto array posix_getgroups(void) Get supplementary group id's (POSIX.1, 4.2.3) */ +#ifdef HAVE_GETGROUPS PHP_FUNCTION(posix_getgroups) { gid_t gidlist[NGROUPS_MAX]; @@ -389,10 +394,12 @@ add_next_index_long(return_value, gidlist[i]); } } +#endif /* }}} */ /* {{{ proto string posix_getlogin(void) Get user name (POSIX.1, 4.2.4) */ +#ifdef HAVE_GETLOGIN PHP_FUNCTION(posix_getlogin) { char *p; @@ -408,6 +415,7 @@ RETURN_STRING(p, 1); } +#endif /* }}} */ /* {{{ proto int posix_getpgrp(void)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php