diff options
author | Markus Fischer <mfischer@php.net> | 2002-03-05 16:04:04 +0000 |
---|---|---|
committer | Markus Fischer <mfischer@php.net> | 2002-03-05 16:04:04 +0000 |
commit | 003bb8c2b4b7b3e21bfbe3fb7aa7f575898b1a7e (patch) | |
tree | 48c1b7dde5a28290a55830a6218ed89e4daab2c8 /ext/posix/php_posix.h | |
parent | 22aac3652ed1fbb84bebac9a821484702d7f064d (diff) | |
download | php-git-003bb8c2b4b7b3e21bfbe3fb7aa7f575898b1a7e.tar.gz |
- Introduced posix_errno() (get error number from last error message) and
posix_strerror() (convert error number into error string).
- Do not output any error message if any of the function fails with FALSE
return value. The proper way now is to call posix_errno() and
posix_strerror() after encountering an error condition.
- Function not support on a system no longer issue a 'not available' error
but simply don't exist so we can safely use 'function_exists'.
- Fixed protos.
- Use new parameter parsing API.
- posix_uname() may be aware of 'domainname' (GNU extension)
- posix_getgrnam(), posix_getgrgid(): the returned information does no
longer contains mixture of string and numbered keys (hash / array)
but contains key 'member' with an array of all members in a list
(or an empty array). This breaks BC but is the right thing IMHO.
Diffstat (limited to 'ext/posix/php_posix.h')
-rw-r--r-- | ext/posix/php_posix.h | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h index b2370f43dd..2ebdc06db2 100644 --- a/ext/posix/php_posix.h +++ b/ext/posix/php_posix.h @@ -22,6 +22,10 @@ #ifndef PHP_POSIX_H #define PHP_POSIX_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #if HAVE_POSIX #ifndef DLEXPORT #define DLEXPORT @@ -30,49 +34,84 @@ extern zend_module_entry posix_module_entry; #define posix_module_ptr &posix_module_entry +/* POSIX.1, 3.3 */ PHP_FUNCTION(posix_kill); +/* POSIX.1, 4.1 */ PHP_FUNCTION(posix_getpid); PHP_FUNCTION(posix_getppid); +/* POSIX.1, 4.2 */ PHP_FUNCTION(posix_getuid); PHP_FUNCTION(posix_getgid); PHP_FUNCTION(posix_geteuid); PHP_FUNCTION(posix_getegid); PHP_FUNCTION(posix_setuid); PHP_FUNCTION(posix_setgid); +#ifdef HAVE_SETEUID PHP_FUNCTION(posix_seteuid); +#endif +#ifdef HAVE_SETEGID PHP_FUNCTION(posix_setegid); - +#endif PHP_FUNCTION(posix_getgroups); PHP_FUNCTION(posix_getlogin); +/* POSIX.1, 4.3 */ PHP_FUNCTION(posix_getpgrp); +#ifdef HAVE_SETSID PHP_FUNCTION(posix_setsid); +#endif PHP_FUNCTION(posix_setpgid); +/* Non-Posix functions which are common */ +#ifdef HAVE_GETPGID PHP_FUNCTION(posix_getpgid); +#endif +#ifdef HAVE_GETSID PHP_FUNCTION(posix_getsid); +#endif +/* POSIX.1, 4.4 */ PHP_FUNCTION(posix_uname); PHP_FUNCTION(posix_times); +/* POSIX.1, 4.5 */ +#ifdef HAVE_CTERMID PHP_FUNCTION(posix_ctermid); +#endif PHP_FUNCTION(posix_ttyname); PHP_FUNCTION(posix_isatty); +/* POSIX.1, 5.2 */ PHP_FUNCTION(posix_getcwd); +/* POSIX.1, 5.4 */ +#ifdef HAVE_MKFIFO PHP_FUNCTION(posix_mkfifo); +#endif + +/* POSIX.1, 9.2 */ PHP_FUNCTION(posix_getgrnam); PHP_FUNCTION(posix_getgrgid); PHP_FUNCTION(posix_getpwnam); PHP_FUNCTION(posix_getpwuid); +#ifdef HAVE_GETRLIMIT PHP_FUNCTION(posix_getrlimit); +#endif -typedef struct { - int dummy; -} posix_module; +PHP_FUNCTION(posix_get_last_error); +PHP_FUNCTION(posix_strerror); + +ZEND_BEGIN_MODULE_GLOBALS(posix) + int last_error; +ZEND_END_MODULE_GLOBALS(posix) + +#ifdef ZTS +# define POSIX_G(v) TSRMG(posix_globals_id, zend_posix_globals *, v) +#else +# define POSIX_G(v) (posix_globals.v) +#endif #else |