POSIX functions
POSIX
This module contains an interface to those functions defined in
the IEEE 1003.1 (POSIX.1) standards document which are not
accessible through other means. POSIX.1 for example defined the
open(), read(), write() and close() functions, too, which
traditionally have been part of PHP 3 for a long time. Some more
system specific functions have not been available before, though,
and this module tries to remedy this by providing easy access to
these functions.
posix_kill
Send a signal to a process
Description
bool posix_kill
int pid
int sig
Send the signal sig to the process with
the process identifier pid. Returns &false;,
if unable to send the signal, &true; otherwise.
See also the kill(2) manual page of your POSIX system, which
contains additional information about negative process
identifiers, the special pid 0, the special pid -1, and the
signal number 0.
posix_getpid
Return the current process identifier
Description
int posix_getpid
Return the process identifier of the current process.
posix_getppid
Return the parent process identifier
Description
int posix_getppid
Return the process identifier of the parent process of the
current process.
posix_getuid
Return the real user ID of the current process
Description
int posix_getuid
Return the numeric real user ID of the current process. See also
posix_getpwuid for information on how to
convert this into a useable username.
posix_geteuid
Return the effective user ID of the current process
Description
int posix_geteuid
Return the numeric effective user ID of the current process. See
also posix_getpwuid for information on how
to convert this into a useable username.
posix_getgid
Return the real group ID of the current process
Description
int posix_getgid
Return the numeric real group ID of the current process. See also
posix_getgrgid for information on how to
convert this into a useable group name.
posix_getegid
Return the effective group ID of the current process
Description
int posix_getegid
Return the numeric effective group ID of the current process. See
also posix_getgrgid for information on how
to convert this into a useable group name.
posix_setuid
Set the UID of the current process
Description
bool posix_setuid
int uid
Set the real user ID of the current process. This is a privileged
function and you need appropriate privileges (usually root) on
your system to be able to perform this function.
Returns &true; on success, &false; otherwise. See also
posix_setgid.
posix_seteuid
Set the effective UID of the current process
Description
bool posix_seteuid
int uid
Set the real user ID of the current process. This is a privileged
function and you need appropriate privileges (usually root) on
your system to be able to perform this function.
Returns &true; on success, &false; otherwise. See also
posix_setgid.
posix_setgid
Set the GID of the current process
Description
bool posix_setgid
int gid
Set the real group ID of the current process. This is a
privileged function and you need appropriate privileges (usually
root) on your system to be able to perform this function. The
appropriate order of function calls is
posix_setgid first,
posix_setuid last.
Returns &true; on success, &false; otherwise.
posix_setegid
Set the effective GID of the current process
Description
bool posix_setegid
int gid
Set the effective group ID of the current process. This is a
privileged function and you need appropriate privileges (usually
root) on your system to be able to perform this function.
Returns &true; on success, &false; otherwise.
posix_getgroups
Return the group set of the current process
Description
array posix_getgroups
Returns an array of integers containing the numeric group ids of
the group set of the current process. See also
posix_getgrgid for information on how to
convert this into useable group names.
posix_getlogin
Return login name
Description
string posix_getlogin
Returns the login name of the user owning the current process.
See posix_getpwnam for information how to
get more information about this user.
posix_getpgrp
Return the current process group identifier
Description
int posix_getpgrp
Return the process group identifier of the current process. See
POSIX.1 and the getpgrp(2) manual page on your POSIX system for
more information on process groups.
posix_setsid
Make the current process a session leader
Description
int posix_setsid
Make the current process a session leader. See POSIX.1 and the
setsid(2) manual page on your POSIX system for more informations
on process groups and job control. Returns the session id.
posix_setpgid
set process group id for job control
Description
int posix_setpgid
int pid
int pgid
Let the process pid join the process group
pgid. See POSIX.1 and the setsid(2) manual
page on your POSIX system for more informations on process groups
and job control. Returns &true; on success, &false; otherwise.
posix_getpgid
Get process group id for job control
Description
int posix_getpgid
int pid
Returns the process group identifier of the process
pid.
This is not a POSIX function, but is common on BSD and System V
systems. If your system does not support this function at system
level, this PHP function will always return &false;.
posix_getsid
Get the current sid of the process
Description
int posix_getsid
int pid
Return the sid of the process pid. If
pid is 0, the sid of the current process
is returned.
This is not a POSIX function, but is common on System V systems.
If your system does not support this function at system level,
this PHP function will always return &false;.
posix_uname
Get system name
Description
array posix_uname
Returns a hash of strings with information about the
system. The indices of the hash are
sysname - operating system name (e.g. Linux)
nodename - system name (e.g. valiant)
release - operating system release (e.g. 2.2.10)
version - operating system version (e.g. #4 Tue Jul 20
17:01:36 MEST 1999)
machine - system architecture (e.g. i586)
domainname - DNS domainname (e.g. php.net)
domainname is a GNU extension and not part of POSIX.1, so this
field is only available on GNU systems or when using the GNU
libc.
Posix requires that you must not make any assumptions about the
format of the values, e.g. you cannot rely on three digit version
numbers or anything else returned by this function.
posix_times
Get process times
Description
array posix_times
Returns a hash of strings with information about the current
process CPU usage. The indices of the hash are
ticks - the number of clock ticks that have elapsed since
reboot.
utime - user time used by the current process.
stime - system time used by the current process.
cutime - user time used by current process and children.
cstime - system time used by current process and children.
posix_ctermid
Get path name of controlling terminal
Description
string posix_ctermid
Needs to be written.
posix_ttyname
Determine terminal device name
Description
string posix_ttyname
int fd
Needs to be written.
posix_isatty
Determine if a file descriptor is an interactive terminal
Description
bool posix_isatty
int fd
Needs to be written.
posix_getcwd
Pathname of current directory
Description
string posix_getcwd
Needs to be written ASAP.
posix_mkfifo
Create a fifo special file (a named pipe)
Description
bool posix_mkfifo
string pathname
int mode
Needs to be written ASAP.
¬e.sm.uidcheck.dir;
posix_getgrnam
Return info about a group by name
Description
array posix_getgrnam
string name
Needs to be written.
posix_getgrgid
Return info about a group by group id
Description
array posix_getgrgid
int gid
Needs to be written.
posix_getpwnam
Return info about a user by username
Description
array posix_getpwnam
string username
Returns an associative array containing information about a user
referenced by an alphanumeric username, passed in the
username parameter.
The array elements returned are:
The user information array
Element
Description
name
The name element contains the username of the user. This is
a short, usually less than 16 character "handle" of the
user, not her real, full name. This should be the same as
the username parameter used when
calling the function, and hence redundant.
passwd
The passwd element contains the user's password in an
encrypted format. Often, for example on a system employing
"shadow" passwords, an asterisk is returned instead.
uid
User ID of the user in numeric form.
gid
The group ID of the user. Use the function
posix_getgrgid to resolve the group
name and a list of its members.
gecos
GECOS is an obsolete term that refers to the finger
information field on a Honeywell batch processing system.
The field, however, lives on, and its contents have been
formalized by POSIX. The field contains a comma separated
list containing the user's full name, office phone, office
number, and home phone number. On most systems, only the
user's full name is available.
dir
This element contains the absolute path to the home
directory of the user.
shell
The shell element contains the absolute path to the
executable of the user's default shell.
posix_getpwuid
Return info about a user by user id
Description
array posix_getpwuid
int uid
Returns an associative array containing information about a user
referenced by a numeric user ID, passed in the
uid parameter.
The array elements returned are:
The user information array
Element
Description
name
The name element contains the username of the user. This is
a short, usually less than 16 character "handle" of the
user, not her real, full name.
passwd
The passwd element contains the user's password in an
encrypted format. Often, for example on a system employing
"shadow" passwords, an asterisk is returned instead.
uid
User ID, should be the same as the
uid parameter used when calling the
function, and hence redundant.
gid
The group ID of the user. Use the function
posix_getgrgid to resolve the group
name and a list of its members.
gecos
GECOS is an obsolete term that refers to the finger
information field on a Honeywell batch processing system.
The field, however, lives on, and its contents have been
formalized by POSIX. The field contains a comma separated
list containing the user's full name, office phone, office
number, and home phone number. On most systems, only the
user's full name is available.
dir
This element contains the absolute path to the
home directory of the user.
shell
The shell element contains the absolute path to the
executable of the user's default shell.
posix_getrlimit
Return info about system ressource limits
Description
array posix_getrlimit
Needs to be written ASAP.