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
#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);
#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)
/* {{{ 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];
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;
RETURN_STRING(p, 1);
}
+#endif
/* }}} */
/* {{{ proto int posix_getpgrp(void)