ljbuesch Thu May 3 18:03:25 2007 UTC
Modified files: /phpdoc/en/reference/posix/functions posix-ctermid.xml posix-get-last-error.xml posix-getcwd.xml posix-getegid.xml posix-geteuid.xml posix-getgid.xml posix-getgrgid.xml posix-getgrnam.xml posix-getgroups.xml posix-getlogin.xml posix-getpgid.xml posix-getpgrp.xml posix-getpid.xml posix-getppid.xml posix-getpwnam.xml posix-getpwuid.xml posix-getrlimit.xml posix-getsid.xml posix-getuid.xml posix-isatty.xml posix-setegid.xml posix-setgid.xml posix-setuid.xml posix-strerror.xml posix-times.xml posix-ttyname.xml posix-uname.xml Log: Committing accepted patch for POSIX functions. This includes documentation for many of the undocumented POSIX functions and adds examples to previously documented functions.
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-ctermid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-ctermid.xml diff -u phpdoc/en/reference/posix/functions/posix-ctermid.xml:1.5 phpdoc/en/reference/posix/functions/posix-ctermid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-ctermid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-ctermid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-ctermid"> <refnamediv> <refname>posix_ctermid</refname> @@ -12,11 +12,51 @@ <type>string</type><methodname>posix_ctermid</methodname> <void/> </methodsynopsis> - <para> - &warn.undocumented.func; + <para> + Generates a <type>string</type> which is the pathname for the current + controlling terminal for the process. On error this will set errno, + which can be checked using <function>posix_get_last_error</function> </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_ctermid</function> example</title> + <para> + This example will display the path to the current TTY. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo "I am running from ".posix_ctermid(); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Upon successful completion, returns <type>string</type> of the pathname to + the current controlling terminal. Otherwise &false; is returned and errno + is set, which can be checked with <function>posix_get_last_error</function>. + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_ttyname</function></member> + <member><function>posix_get_last_error</function></member> + </simplelist> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-get-last-error.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-get-last-error.xml diff -u phpdoc/en/reference/posix/functions/posix-get-last-error.xml:1.4 phpdoc/en/reference/posix/functions/posix-get-last-error.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-get-last-error.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-get-last-error.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-get-last-error"> <refnamediv> <refname>posix_get_last_error</refname> @@ -27,6 +27,27 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_get_last_error</function> example</title> + <para> + This example attempt to kill a bogus process id, which will set the + last error. We will then print out the last error. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +posix_kill(999459,SIGKILL); +echo 'Your error returned was '.posix_get_last_error(); //Your error was ___ +?> +]]> + </programlisting> + </example> + </para> + </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getcwd.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getcwd.xml diff -u phpdoc/en/reference/posix/functions/posix-getcwd.xml:1.8 phpdoc/en/reference/posix/functions/posix-getcwd.xml:1.9 --- phpdoc/en/reference/posix/functions/posix-getcwd.xml:1.8 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getcwd.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="function.posix-getcwd"> <refnamediv> <refname>posix_getcwd</refname> @@ -14,13 +14,53 @@ </methodsynopsis> <para> Gets the absolute pathname of the script's current working directory. + On error, it sets errno which can be checked using + <function>posix_get_last_error</function> </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_getcwd</function> example</title> + <para> + This example will return the absolute path of the current working + directory of the script. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo 'My current working directory is '.posix_getcwd(); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <para> + This function can fail on can fail on + <itemizedlist> + <listitem> + <simpara>Read or Search permission was denied</simpara> + </listitem> + <listitem> + <simpara>Pathname no longer exists</simpara> + </listitem> + </itemizedlist> + </para> + </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the absolute pathname, or &false; on error. + Returns a <type>string</type> of the absolute pathname on success. + On error, returns &false; and sets errno which can be checked with + <function>posix_get_last_error</function>. </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getegid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getegid.xml diff -u phpdoc/en/reference/posix/functions/posix-getegid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getegid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getegid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getegid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getegid"> <refnamediv> <refname>posix_getegid</refname> @@ -16,11 +16,42 @@ Return the numeric effective group ID of the current process. </para> </refsect1> - + <refsect1 role="notes"> + &reftitle.notes; + <para> + <function>posix_getegid</function> is different than + <function>posix_getgid</function> by you can change the effective group ID of + a calling process using the <function>posix_setegid</function>. + </para> + </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the group ID. + Returns an <type>integer</type> of the effective group ID. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_getegid</function> example</title> + <para> + This example will print out your effective group id, once you + change it with <function>posix_setegid</function>. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo 'My real group id is '.posix_getgid(); //20 +posix_setegid(40); +echo 'My real group id is '.posix_getgid(); //20 +echo 'My effective group id is '.posix_getegid(); //40 +?> +]]> + </programlisting> + </example> </para> </refsect1> @@ -30,6 +61,9 @@ <simplelist> <member><function>posix_getgrgid</function> for information on how to convert this into a useable group name</member> + <member><function>posix_getgid</function> get real group id.</member> + <member><function>posix_setgid</function> change the effective group + id</member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-geteuid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-geteuid.xml diff -u phpdoc/en/reference/posix/functions/posix-geteuid.xml:1.4 phpdoc/en/reference/posix/functions/posix-geteuid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-geteuid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-geteuid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-geteuid"> <refnamediv> <refname>posix_geteuid</refname> @@ -18,11 +18,50 @@ to convert this into a useable username. </para> </refsect1> - + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_geteuid</function> example</title> + <para>This example will show the current user id then set the + effective user id to a separate id using + <function>posix_seteuid</function>, then show the difference between + the real id and the effective id.</para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo posix_getuid().'\n'; //10001 +echo posix_geteuid().'\n'; //10001 +posix_seteuid(10000); +echo posix_getuid().'\n'; //10001 +echo posix_geteuid().'\n'; //10000 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the user id, as an <type>integer</type> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getpwuid</function> for more information + about the user.</member> + <member><function>posix_getuid</function> get real user id.</member> + <member><function>posix_setuid</function> change the effective user + id</member> + <member>POSIX man page GETEUID(2)</member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getgid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getgid.xml diff -u phpdoc/en/reference/posix/functions/posix-getgid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getgid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getgid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getgid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getgid"> <refnamediv> <refname>posix_getgid</refname> @@ -13,16 +13,54 @@ <void/> </methodsynopsis> <para> - Return the numeric real group ID of the current process. See also - <function>posix_getgrgid</function> for information on how to - convert this into a useable group name. + Return the numeric real group ID of the current process. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_getgid</function> example</title> + <para> + This example will print out your real group id, even once you + have changed your effective group id. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo 'My real group id is '.posix_getgid(); //20 +posix_setegid(40); +echo 'My real group id is '.posix_getgid(); //20 +echo 'My effective group id is '.posix_getegid(); //40 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <function>posix_getgrgid</function> for information on how + to convert this into a useable group name + </member> + <member><function>posix_getegid</function> get effective group id.</member> + <member><function>posix_setgid</function> change the effective group + id</member> + <member>POSIX man page GETGID(2)</member> + </simplelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the real group id, as an <type>integer</type>. </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getgrgid.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getgrgid.xml diff -u phpdoc/en/reference/posix/functions/posix-getgrgid.xml:1.7 phpdoc/en/reference/posix/functions/posix-getgrgid.xml:1.8 --- phpdoc/en/reference/posix/functions/posix-getgrgid.xml:1.7 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getgrgid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="function.posix-getgrgid"> <refnamediv> <refname>posix_getgrgid</refname> @@ -36,10 +36,51 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns an <type>array</type> of information about a group and - &false; on failure. If <parameter>gid</parameter> isn't a number - then &null; is returned and an <constant>E_WARNING</constant> - level error is generated. + The array elements returned are: + <table> + <title>The group information array</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Element</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry> + The name element contains the name of the group. This is + a short, usually less than 16 character "handle" of the + group, not the real, full name. + </entry> + </row> + <row> + <entry>passwd</entry> + <entry> + The passwd element contains the group's password in an + encrypted format. Often, for example on a system employing + "shadow" passwords, an asterisk is returned instead. + </entry> + </row> + <row> + <entry>gid</entry> + <entry> + Group ID, should be the same as the + <parameter>gid</parameter> parameter used when calling the + function, and hence redundant. + </entry> + </row> + <row> + <entry>members</entry> + <entry> + This consists of an <type>array</type> of + <type>string</type>'s for all the members in the group. + </entry> + </row> + </tbody> + </tgroup> + </table> </para> </refsect1> @@ -82,7 +123,6 @@ $groupinfo = posix_getgrgid($groupid); print_r($groupinfo); - ?> ]]> </programlisting> @@ -111,9 +151,11 @@ <para> <simplelist> <member><function>posix_getegid</function></member> + <member><function>posix_getgrnam</function></member> <member><function>filegroup</function></member> <member><function>stat</function></member> <member><link linkend="ini.safe-mode-gid">safe_mode_gid</link></member> + <member>POSIX man page GETGRNAM(3)</member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getgrnam.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getgrnam.xml diff -u phpdoc/en/reference/posix/functions/posix-getgrnam.xml:1.5 phpdoc/en/reference/posix/functions/posix-getgrnam.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-getgrnam.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getgrnam.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-getgrnam"> <refnamediv> <refname>posix_getgrnam</refname> @@ -12,8 +12,8 @@ <type>array</type><methodname>posix_getgrnam</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> - <para> - &warn.undocumented.func; + <para> + Gets information about a group provided its name. </para> </refsect1> @@ -24,14 +24,139 @@ <varlistentry> <term><parameter>name</parameter></term> <listitem> - <para> - </para> + <para>The name of the group</para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The array elements returned are: + <table> + <title>The group information array</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Element</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> + <row> + <entry>name</entry> + <entry> + The name element contains the name of the group. This is + a short, usually less than 16 character "handle" of the + group, not the real, full name. This should be the same as + the <parameter>name</parameter> parameter used when + calling the function, and hence redundant. + </entry> + </row> + <row> + <entry>passwd</entry> + <entry> + The passwd element contains the group's password in an + encrypted format. Often, for example on a system employing + "shadow" passwords, an asterisk is returned instead. + </entry> + </row> + <row> + <entry>uid</entry> + <entry> + Group ID of the group in numeric form. + </entry> + </row> + <row> + <entry>members</entry> + <entry> + This consists of an <type>array</type> of + <type>string</type>'s for all the members in the group. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.2.0</entry> + <entry> + Prior to this version, members was simply an integer representing the + number of members in the group, and the member names were returned + with numerical indices. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getgrnam</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$groupinfo = posix_getgrgid("toons"); + +print_r($groupinfo); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [name] => toons + [passwd] => x + [members] => Array + ( + [0] => tom + [1] => jerry + ) + [gid] => 42 +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getegid</function></member> + <member><function>posix_getgrgid</function></member> + <member><function>filegroup</function></member> + <member><function>stat</function></member> + <member><link linkend="ini.safe-mode-gid">safe_mode_gid</link></member> + <member>POSIX man page GETGRNAM(3)</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getgroups.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getgroups.xml diff -u phpdoc/en/reference/posix/functions/posix-getgroups.xml:1.4 phpdoc/en/reference/posix/functions/posix-getgroups.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getgroups.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getgroups.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getgroups"> <refnamediv> <refname>posix_getgroups</refname> @@ -25,6 +25,46 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getgroups</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$groups = posix_getgroups(); + +print_r($groups); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [0] => 4 + [1] => 20 + [2] => 24 + [3] => 25 + [4] => 29 + [5] => 30 + [6] => 33 + [7] => 44 + [8] => 46 + [9] => 104 + [10] => 109 + [11] => 110 + [12] => 1000 +) +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getlogin.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getlogin.xml diff -u phpdoc/en/reference/posix/functions/posix-getlogin.xml:1.4 phpdoc/en/reference/posix/functions/posix-getlogin.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getlogin.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getlogin.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getlogin"> <refnamediv> <refname>posix_getlogin</refname> @@ -20,7 +20,23 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the login name of the user, as a string. + Returns the login name of the user, as a <type>string</type>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getlogin</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getlogin(); //apache +?> +]]> + </programlisting> + </example> </para> </refsect1> @@ -29,6 +45,7 @@ <para> <simplelist> <member><function>posix_getpwnam</function></member> + <member>POSIX man page GETLOGIN(3)</member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getpgid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getpgid.xml diff -u phpdoc/en/reference/posix/functions/posix-getpgid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getpgid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getpgid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getpgid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getpgid"> <refnamediv> <refname>posix_getpgid</refname> @@ -37,19 +37,44 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the identifier, as an <type>integer</type>. </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; - <note> - <para> - 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;. - </para> - </note> + <para> + This is a not POSIX function, but is common on BSD and System V + systems. If your system does not support this function, then it + will not be included at compile time. You may check if this + function exists with <function>function_exists</function>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getpgid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getpgid(); //35 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getppid</function></member> + <member>man page SETPGID(2)</member> + </simplelist> + </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getpgrp.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getpgrp.xml diff -u phpdoc/en/reference/posix/functions/posix-getpgrp.xml:1.4 phpdoc/en/reference/posix/functions/posix-getpgrp.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getpgrp.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getpgrp.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getpgrp"> <refnamediv> <refname>posix_getpgrp</refname> @@ -20,7 +20,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the identifier, as an <type>integer</type>. </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getpid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getpid.xml diff -u phpdoc/en/reference/posix/functions/posix-getpid.xml:1.5 phpdoc/en/reference/posix/functions/posix-getpid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-getpid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getpid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-getpid"> <refnamediv> <refname>posix_getpid</refname> @@ -20,9 +20,38 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the identifier, as an <type>integer</type>. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getpid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getpid(); //8805 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <function>posix_kill</function> to kill a process. + </member> + <member>POSIX man page GETPID(2)</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getppid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getppid.xml diff -u phpdoc/en/reference/posix/functions/posix-getppid.xml:1.5 phpdoc/en/reference/posix/functions/posix-getppid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-getppid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getppid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-getppid"> <refnamediv> <refname>posix_getppid</refname> @@ -21,9 +21,26 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the identifier, as an <type>integer</type>. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getppid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getppid(); //8259 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getpwnam.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getpwnam.xml diff -u phpdoc/en/reference/posix/functions/posix-getpwnam.xml:1.4 phpdoc/en/reference/posix/functions/posix-getpwnam.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getpwnam.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getpwnam.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getpwnam"> <refnamediv> <refname>posix_getpwnam</refname> @@ -13,7 +13,7 @@ <methodparam><type>string</type><parameter>username</parameter></methodparam> </methodsynopsis> <para> - Returns an information about the given user. + Returns an <type>array</type> of information about the given user. </para> </refsect1> @@ -52,7 +52,7 @@ <entry> 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 + user, not the real, full name. This should be the same as the <parameter>username</parameter> parameter used when calling the function, and hence redundant. </entry> @@ -111,6 +111,50 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getpwnam</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$userinfo = posix_getpwnam("tom"); + +print_r($userinfo); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [name] => tom + [passwd] => x + [uid] => 10000 + [gid] => 42 + [geocs] => "tom,,," + [dir] => "/home/tom" + [shell] => "/bin/bash" +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getpwuid</function></member> + <member>POSIX man page GETPWNAM(3)</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getpwuid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getpwuid.xml diff -u phpdoc/en/reference/posix/functions/posix-getpwuid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getpwuid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getpwuid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getpwuid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getpwuid"> <refnamediv> <refname>posix_getpwuid</refname> @@ -13,7 +13,8 @@ <methodparam><type>int</type><parameter>uid</parameter></methodparam> </methodsynopsis> <para> - Gets information about the user referenced by the given user ID. + Returns an <type>array</type> of information about the user + referenced by the given user ID. </para> </refsect1> @@ -52,7 +53,7 @@ <entry> 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. + user, not the real, full name. </entry> </row> <row> @@ -111,6 +112,50 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getpwuid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$userinfo = posix_getpwuid(10000); + +print_r($userinfo); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [name] => tom + [passwd] => x + [uid] => 10000 + [gid] => 42 + [geocs] => "tom,,," + [dir] => "/home/tom" + [shell] => "/bin/bash" +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getpwnam</function></member> + <member>POSIX man page GETPWNAM(3)</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getrlimit.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getrlimit.xml diff -u phpdoc/en/reference/posix/functions/posix-getrlimit.xml:1.6 phpdoc/en/reference/posix/functions/posix-getrlimit.xml:1.7 --- phpdoc/en/reference/posix/functions/posix-getrlimit.xml:1.6 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getrlimit.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.posix-getrlimit"> <refnamediv> <refname>posix_getrlimit</refname> @@ -12,8 +12,172 @@ <type>array</type><methodname>posix_getrlimit</methodname> <void/> </methodsynopsis> - <para> - &warn.undocumented.func; + <para> + <function>posix_getrlimi</function> returns an <type>array</type> + of information about the current resource's soft and hard limits. + </para> + <para> + Each resource has an associated soft and hard limit. The soft + limit is the value that the kernel enforces for the corresponding + resrource. The hard limit acts as a cieling for the soft limit. + An unprivileged process may only set its soft limit to a value + from 0 to the hard limit, and irreversibly lowers its hard limit. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an associative <type>array</type> of elements for each + limit that is defined. Each limit has a soft and a hard limit. + <table> + <title>List of possible limits returned</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Limit name</entry> + <entry>Limit description</entry> + </row> + </thead> + <tbody> + <row> + <entry>core</entry> + <entry> + The maximum size of the core file. When 0, not core files are + created. When core files are larger than this size, they will + be truncated at this size. + </entry> + </row> + <row> + <entry>totalmem</entry> + <entry> + The maximum size of the memory of the process, in bytes. + </entry> + </row> + <row> + <entry>virtualmem</entry> + <entry> + The maximum size of the virtual memory for the process, in bytes. + </entry> + </row> + <row> + <entry>data</entry> + <entry> + The maximum size of the data segment for the process, in bytes. + </entry> + </row> + <row> + <entry>stack</entry> + <entry> + The maximum size of the process stack, in bytes. + </entry> + </row> + <row> + <entry>rss</entry> + <entry> + The maximum number of virtual pages resident in RAM + </entry> + </row> + <row> + <entry>maxproc</entry> + <entry> + The maximum number of processes that can be created for the + real user ID of the calling process. + </entry> + </row> + <row> + <entry>memlock</entry> + <entry> + The maximum number of bytes of memory that may be locked into RAM. + </entry> + </row> + <row> + <entry>cpu</entry> + <entry> + The amount of time the process is allowed to use the CPU. + </entry> + </row> + <row> + <entry>filesize</entry> + <entry> + The maximum size of the data segment for the process, in bytes. + </entry> + </row> + <row> + <entry>openfiles</entry> + <entry> + One more than the maximum number of open file descriptors. + </entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <para> + This is a not POSIX function, but is common on BSD and System V + systems. If your system does not support this function, then it + will not be included at compile time. You may check if this + function exists with <function>function_exists</function>. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getrlimit</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$limits = posix_getrlimit(); + +print_r($limits); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [soft core] => 0 + [hard core] => unlimited + [soft data] => unlimited + [hard data] => unlimited + [soft stack] => 8388608 + [hard stack] => unlimited + [soft totalmem] => unlimited + [hard totalmem] => unlimited + [soft rss] => unlimited + [hard rss] => unlimited + [soft maxproc] => unlimited + [hard maxproc] => unlimited + [soft memlock] => unlimited + [hard memlock] => unlimited + [soft cpu] => unlimited + [hard cpu] => unlimited + [soft filesize] => unlimited + [hard filesize] => unlimited + [soft openfiles] => 1024 + [hard openfiles] => 1024 +) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member>man page GETRLIMIT(2)</member> + </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getsid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getsid.xml diff -u phpdoc/en/reference/posix/functions/posix-getsid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getsid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getsid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getsid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getsid"> <refnamediv> <refname>posix_getsid</refname> @@ -13,7 +13,8 @@ <methodparam><type>int</type><parameter>pid</parameter></methodparam> </methodsynopsis> <para> - Return the sid of the process <parameter>pid</parameter>. + Return the session id of the process <parameter>pid</parameter>. + The session id of a process is the process group id of the session leader. </para> </refsect1> @@ -25,7 +26,10 @@ <term><parameter>pid</parameter></term> <listitem> <para> - The process identifier. If set to 0, the current process is assumed. + The process identifier. If set to 0, the current process is + assumed. If an invalid <parameter>pid</parameter> is + specified, then &false; is returned and an error is set which + can be checked with <function>posix_get_last_error</function>. </para> </listitem> </varlistentry> @@ -36,21 +40,42 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the identifier, as an <type>integer</type>. </para> </refsect1> - <refsect1 role="notes"> - &reftitle.notes; - <note> - <para> - 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;. - </para> - </note> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getsid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getsid(); //8805 +?> +]]> + </programlisting> + </example> + </para> </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <function>posix_getpgid</function> + </member> + <member> + <function>posix_setsid</function> + </member> + <member>POSIX man page GETSID(2)</member> + </simplelist> + </para> + </refsect1> + + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-getuid.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-getuid.xml diff -u phpdoc/en/reference/posix/functions/posix-getuid.xml:1.4 phpdoc/en/reference/posix/functions/posix-getuid.xml:1.5 --- phpdoc/en/reference/posix/functions/posix-getuid.xml:1.4 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-getuid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.posix-getuid"> <refnamediv> <refname>posix_getuid</refname> @@ -20,7 +20,23 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns the identifier, as an integer. + Returns the user id, as an <type>integer</type> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_getuid</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo posix_getuid(); //10000 +?> +]]> + </programlisting> + </example> </para> </refsect1> @@ -32,6 +48,7 @@ <function>posix_getpwuid</function> for information on how to convert this into a useable username </member> + <member>POSIX man page GETUID(2)</member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-isatty.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-isatty.xml diff -u phpdoc/en/reference/posix/functions/posix-isatty.xml:1.5 phpdoc/en/reference/posix/functions/posix-isatty.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-isatty.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-isatty.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-isatty"> <refnamediv> <refname>posix_isatty</refname> @@ -13,10 +13,43 @@ <methodparam><type>int</type><parameter>fd</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Determines if the file descriptor <parameter>fd</parameter> refers to a valid + terminal type device. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>fd</parameter></term> + <listitem> + <para> + The file descriptor. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns &true; if <parameter>fd</parameter> is an open descriptor connected + to a terminal and &false; otherwise. + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_ttyname</function></member> + </simplelist> </para> </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-setegid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-setegid.xml diff -u phpdoc/en/reference/posix/functions/posix-setegid.xml:1.5 phpdoc/en/reference/posix/functions/posix-setegid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-setegid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-setegid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-setegid"> <refnamediv> <refname>posix_setegid</refname> @@ -41,6 +41,44 @@ &return.success; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_setegid</function> example</title> + <para> + This example will print out your effective group id, once you + change it. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo 'My real group id is '.posix_getgid(); //20 +posix_setegid(40); +echo 'My real group id is '.posix_getgid(); //20 +echo 'My effective group id is '.posix_getegid(); //40 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getgrgid</function> for information on how + to a group id into a useable group name</member> + <member><function>posix_getgid</function> get real group id.</member> + <member><function>posix_setgid</function> change the effective group + id</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-setgid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-setgid.xml diff -u phpdoc/en/reference/posix/functions/posix-setgid.xml:1.5 phpdoc/en/reference/posix/functions/posix-setgid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-setgid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-setgid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-setgid"> <refnamediv> <refname>posix_setgid</refname> @@ -20,6 +20,12 @@ <function>posix_setgid</function> first, <function>posix_setuid</function> last. </para> + <note> + <para> + If the caller is a super user, this will also set your effective + group id + </para> + </note> </refsect1> <refsect1 role="parameters"> @@ -45,6 +51,41 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_setgid</function> example</title> + <para> + This example will print out your effective group id, once you + change it. + </para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo 'My real group id is '.posix_getgid(); //20 +posix_setgid(40); +echo 'My real group id is '.posix_getgid(); //40 +echo 'My effective group id is '.posix_getegid(); //40 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>posix_getgrgid</function> for information on how + to convert this into a useable group name</member> + <member><function>posix_getgid</function> get real group id.</member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-setuid.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-setuid.xml diff -u phpdoc/en/reference/posix/functions/posix-setuid.xml:1.5 phpdoc/en/reference/posix/functions/posix-setuid.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-setuid.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-setuid.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-setuid"> <refnamediv> <refname>posix_setuid</refname> @@ -42,11 +42,37 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_setuid</function> example</title> + <para>This example will show the currrent user id and then set + it to a different value.</para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +echo posix_getuid().'\n'; //10001 +echo posix_geteuid().'\n'; //10001 +posix_setuid(10000); +echo posix_getuid().'\n'; //10000 +echo posix_geteuid().'\n'; //10000 +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>posix_setgid</function></member> + <member><function>posix_seteuid</function></member> + <member><function>posix_getuid</function></member> + <member><function>posix_geteuid</function></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-strerror.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-strerror.xml diff -u phpdoc/en/reference/posix/functions/posix-strerror.xml:1.5 phpdoc/en/reference/posix/functions/posix-strerror.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-strerror.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-strerror.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-strerror"> <refnamediv> <refname>posix_strerror</refname> @@ -14,7 +14,9 @@ </methodsynopsis> <para> Returns the POSIX system error message associated with the given - <parameter>errno</parameter>. + <parameter>errno</parameter>. You may get the + <parameter>errno</parameter> parameter by calling + <function>posix_get_last_error</function>. </para> </refsect1> @@ -43,6 +45,32 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>posix_strerror</function> example</title> + <para>This example will attempt to kill a process which does not + exist, then will print out the corresponding error message.</para> + <programlisting role="php"> +<![CDATA[ +#!/usr/local/bin/php +<?php +posix_kill(50,SIGKILL); +echo posix_strerror(posix_get_last_error())."\n"; +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +No such process +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-times.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-times.xml diff -u phpdoc/en/reference/posix/functions/posix-times.xml:1.5 phpdoc/en/reference/posix/functions/posix-times.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-times.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-times.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-times"> <refnamediv> <refname>posix_times</refname> @@ -63,6 +63,38 @@ </warning> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_times</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$times = posix_times(); + +print_r($times); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [ticks] => 25814410 + [utime] => 1 + [stime] => 1 + [cutime] => 0 + [cstime] => 0 +) +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-ttyname.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-ttyname.xml diff -u phpdoc/en/reference/posix/functions/posix-ttyname.xml:1.5 phpdoc/en/reference/posix/functions/posix-ttyname.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-ttyname.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-ttyname.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-ttyname"> <refnamediv> <refname>posix_ttyname</refname> @@ -12,8 +12,34 @@ <type>string</type><methodname>posix_ttyname</methodname> <methodparam><type>int</type><parameter>fd</parameter></methodparam> </methodsynopsis> - <para> - &warn.undocumented.func; + <para> + Returns a <type>string</type> for the absolute path to the current + terminal device that is open on the file descriptor + <parameter>fd</parameter>. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>fd</parameter></term> + <listitem> + <para> + The file descriptor. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + On success, returns a <type>string</type> of the absolute path of the + <parameter>fd</parameter>. On failure, returns &false; </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/posix/functions/posix-uname.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/posix/functions/posix-uname.xml diff -u phpdoc/en/reference/posix/functions/posix-uname.xml:1.5 phpdoc/en/reference/posix/functions/posix-uname.xml:1.6 --- phpdoc/en/reference/posix/functions/posix-uname.xml:1.5 Sun Feb 4 02:47:57 2007 +++ phpdoc/en/reference/posix/functions/posix-uname.xml Thu May 3 18:03:24 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.posix-uname"> <refnamediv> <refname>posix_uname</refname> @@ -56,6 +56,36 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Example use of <function>posix_uname</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$uname=posix_uname(); +print_r($uname); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Array +( + [sysname] => Linux + [nodename] => funbox + [release] => 2.6.20-15-server + [version] => #2 SMP Sun Apr 15 07:41:34 UTC 2007 + [machine] => i686 +) +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file