diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
commit | 10f5b47dc7c1cf2b9a00991629f43652710322d3 (patch) | |
tree | 3b727a16f652b8042d573e90f003868ffb3b56c7 /ext/posix | |
parent | 0e920280a2e04b110827bb766b9f29e3d581c4ee (diff) | |
download | php-10f5b47dc7c1cf2b9a00991629f43652710322d3.tar.gz |
Imported Upstream version 5.0.5upstream/5.0.5
Diffstat (limited to 'ext/posix')
-rw-r--r-- | ext/posix/config.m4 | 6 | ||||
-rw-r--r-- | ext/posix/php_posix.h | 6 | ||||
-rw-r--r-- | ext/posix/posix.c | 15 |
3 files changed, 22 insertions, 5 deletions
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index 6f7ece7fc..0a7536ab3 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -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.14.2 2005/06/06 22:06:00 wez Exp $ dnl PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions, @@ -9,5 +9,7 @@ if test "$PHP_POSIX" = "yes"; then 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_HEADERS(sys/mkdev.h) + + AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups) fi diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h index 8cc0e5a68..cfb69a0cf 100644 --- a/ext/posix/php_posix.h +++ b/ext/posix/php_posix.h @@ -17,7 +17,7 @@ */ -/* $Id: php_posix.h,v 1.14 2004/01/08 17:32:41 sniper Exp $ */ +/* $Id: php_posix.h,v 1.14.2.1 2005/05/09 12:16:11 sniper Exp $ */ #ifndef PHP_POSIX_H #define PHP_POSIX_H @@ -54,8 +54,12 @@ PHP_FUNCTION(posix_seteuid); #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); diff --git a/ext/posix/posix.c b/ext/posix/posix.c index cdb5ceb15..1e5b4aa86 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.60.2.2 2005/01/28 01:39:35 tony2001 Exp $ */ +/* $Id: posix.c,v 1.60.2.4 2005/06/06 22:06:00 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -44,6 +44,9 @@ #include <errno.h> #include <grp.h> #include <pwd.h> +#if HAVE_SYS_MKDEV_H +# include <sys/mkdev.h> +#endif ZEND_DECLARE_MODULE_GLOBALS(posix) @@ -70,8 +73,12 @@ function_entry posix_functions[] = { #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) @@ -131,7 +138,7 @@ function_entry posix_functions[] = { static PHP_MINFO_FUNCTION(posix) { php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.2 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.4 $"); php_info_print_table_end(); } /* }}} */ @@ -293,6 +300,7 @@ PHP_FUNCTION(posix_setegid) /* {{{ 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]; @@ -312,10 +320,12 @@ PHP_FUNCTION(posix_getgroups) 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; @@ -329,6 +339,7 @@ PHP_FUNCTION(posix_getlogin) RETURN_STRING(p, 1); } +#endif /* }}} */ /* {{{ proto int posix_getpgrp(void) |