1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765
|
<?xml version="1.0" encoding="utf-8"?>
<reference id="ref.posix">
<title>POSIX functions</title>
<titleabbrev>POSIX</titleabbrev>
<partintro>
<para>
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.
</para>
</partintro>
<refentry id="function.posix-kill">
<refnamediv>
<refname>posix_kill</refname>
<refpurpose>Send a signal to a process</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>posix_kill</methodname>
<methodparam><type>int</type><parameter>pid</parameter></methodparam>
<methodparam><type>int</type><parameter>sig</parameter></methodparam>
</methodsynopsis>
<para>
Send the signal <parameter>sig</parameter> to the process
with the process identifier <parameter>pid</parameter>.
Returns &false;, if unable to send the signal, &true; otherwise.</para>
<para>
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.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getpid">
<refnamediv>
<refname>posix_getpid</refname>
<refpurpose>Return the current process identifier</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getpid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Return the process identifier of the current process.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getppid">
<refnamediv>
<refname>posix_getppid</refname>
<refpurpose>Return the parent process identifier</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getppid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Return the process identifier of the parent process of the current
process.
</para>
</refsect1>
</refentry>
<refentry id="function.posix-getuid">
<refnamediv>
<refname>posix_getuid</refname>
<refpurpose>
Return the real user ID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getuid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Return the numeric real user ID of the current process. See also
<function>posix_getpwuid</function> for information on how to
convert this into a useable username.</para>
</refsect1>
</refentry>
<refentry id="function.posix-geteuid">
<refnamediv>
<refname>posix_geteuid</refname>
<refpurpose>
Return the effective user ID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_geteuid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Return the numeric effective user ID of the current process. See
also <function>posix_getpwuid</function> for information on how
to convert this into a useable username.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getgid">
<refnamediv>
<refname>posix_getgid</refname>
<refpurpose>
Return the real group ID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getgid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</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.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getegid">
<refnamediv>
<refname>posix_getegid</refname>
<refpurpose>
Return the effective group ID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getegid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Return the numeric effective group ID of the current process. See
also <function>posix_getgrgid</function> for information on how
to convert this into a useable group name.</para>
</refsect1>
</refentry>
<refentry id="function.posix-setuid">
<refnamediv>
<refname>posix_setuid</refname>
<refpurpose>
Set the effective UID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>posix_setuid</methodname>
<methodparam><type>int</type><parameter>uid</parameter></methodparam>
</methodsynopsis>
<para>
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.</para>
<para>
Returns &true; on success, &false; otherwise. See also
<function>posix_setgid</function>.</para>
</refsect1>
</refentry>
<refentry id="function.posix-setgid">
<refnamediv>
<refname>posix_setgid</refname>
<refpurpose>
Set the effective GID of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>posix_setgid</methodname>
<methodparam><type>int</type><parameter>gid</parameter></methodparam>
</methodsynopsis>
<para>
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
<function>posix_setgid</function> first,
<function>posix_setuid</function> last.</para>
<para>
Returns &true; on success, &false; otherwise.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getgroups">
<refnamediv>
<refname>posix_getgroups</refname>
<refpurpose>
Return the group set of the current process
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getgroups</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Returns an array of integers containing the numeric group ids of
the group set of the current process. See also
<function>posix_getgrgid</function> for information on how to
convert this into useable group names.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getlogin">
<refnamediv>
<refname>posix_getlogin</refname>
<refpurpose>Return login name</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>posix_getlogin</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Returns the login name of the user owning the current process.
See <function>posix_getpwnam</function> for information how to
get more information about this user.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getpgrp">
<refnamediv>
<refname>posix_getpgrp</refname>
<refpurpose>
Return the current process group identifier
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getpgrp</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
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.</para>
</refsect1>
</refentry>
<refentry id="function.posix-setsid">
<refnamediv>
<refname>posix_setsid</refname>
<refpurpose>Make the current process a session leader</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_setsid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
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.</para>
</refsect1>
</refentry>
<refentry id="function.posix-setpgid">
<refnamediv>
<refname>posix_setpgid</refname>
<refpurpose>set process group id for job control</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_setpgid</methodname>
<methodparam><type>int</type><parameter>pid</parameter></methodparam>
<methodparam><type>int</type><parameter>pgid</parameter></methodparam>
</methodsynopsis>
<para>
Let the process <parameter>pid</parameter> join the process
group <parameter>pgid</parameter>. 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.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getpgid">
<refnamediv>
<refname>posix_getpgid</refname>
<refpurpose>Get process group id for job control</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getpgid</methodname>
<methodparam><type>int</type><parameter>pid</parameter></methodparam>
</methodsynopsis>
<para>
Returns the process group identifier of the process
<parameter>pid</parameter>.</para>
<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>
</refsect1>
</refentry>
<refentry id="function.posix-getsid">
<refnamediv>
<refname>posix_getsid</refname>
<refpurpose>Get the current sid of the process</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>posix_getsid</methodname>
<methodparam><type>int</type><parameter>pid</parameter></methodparam>
</methodsynopsis>
<para>
Return the sid of the process <parameter>pid</parameter>.
If <parameter>pid</parameter> is 0, the sid of the
current process is returned.</para>
<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>
</refsect1>
</refentry>
<refentry id="function.posix-uname">
<refnamediv>
<refname>posix_uname</refname>
<refpurpose>Get system name</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_uname</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Returns a hash of strings with information about the
system. The indices of the hash are
<itemizedlist>
<listitem><simpara>
sysname - operating system name (e.g. Linux)
</simpara></listitem>
<listitem><simpara>
nodename - system name (e.g. valiant)
</simpara></listitem>
<listitem><simpara>
release - operating system release (e.g. 2.2.10)
</simpara></listitem>
<listitem><simpara>
version - operating system version (e.g. #4 Tue Jul 20
17:01:36 MEST 1999)
</simpara></listitem>
<listitem><simpara>
machine - system architecture (e.g. i586)
</simpara></listitem>
<listitem><simpara>
domainname - DNS domainname (e.g. php.net)
</simpara></listitem>
</itemizedlist>
</para>
<para>
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.
</para>
<para>
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.
</para>
</refsect1>
</refentry>
<refentry id="function.posix-times">
<refnamediv>
<refname>posix_times</refname>
<refpurpose>Get process times</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_times</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Returns a hash of strings with information about the
current process CPU usage. The indices of the hash are
<itemizedlist>
<listitem><simpara>
ticks - the number of clock ticks that have elapsed since
reboot.
</simpara></listitem>
<listitem><simpara>
utime - user time used by the current process.
</simpara></listitem>
<listitem><simpara>
stime - system time used by the current process.
</simpara></listitem>
<listitem><simpara>
cutime - user time used by current process and children.
</simpara></listitem>
<listitem><simpara>
cstime - system time used by current process and children.
</simpara></listitem>
</itemizedlist></para>
</refsect1>
</refentry>
<refentry id="function.posix-ctermid">
<refnamediv>
<refname>posix_ctermid</refname>
<refpurpose>Get path name of controlling terminal</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>posix_ctermid</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Needs to be written.</para>
</refsect1>
</refentry>
<refentry id="function.posix-ttyname">
<refnamediv>
<refname>posix_ttyname</refname>
<refpurpose>Determine terminal device name</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>posix_ttyname</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
</methodsynopsis>
<para>
Needs to be written.</para>
</refsect1>
</refentry>
<refentry id="function.posix-isatty">
<refnamediv>
<refname>posix_isatty</refname>
<refpurpose>
Determine if a file descriptor is an interactive terminal
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>posix_isatty</methodname>
<methodparam><type>int</type><parameter>fd</parameter></methodparam>
</methodsynopsis>
<para>
Needs to be written.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getcwd">
<refnamediv>
<refname>posix_getcwd</refname>
<refpurpose>Pathname of current directory</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>posix_getcwd</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Needs to be written ASAP.</para>
</refsect1>
</refentry>
<refentry id="function.posix-mkfifo">
<refnamediv>
<refname>posix_mkfifo</refname>
<refpurpose>
Create a fifo special file (a named pipe)
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>posix_getcwd</methodname>
<methodparam><type>string</type><parameter>pathname</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
Needs to be written ASAP..</para>
</refsect1>
</refentry>
<refentry id="function.posix-getgrnam">
<refnamediv>
<refname>posix_getgrnam</refname>
<refpurpose>Return info about a group by name</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getgrnam</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<para>
Needs to be written.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getgrgid">
<refnamediv>
<refname>posix_getgrgid</refname>
<refpurpose>Return info about a group by group id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getgrgid</methodname>
<methodparam><type>int</type><parameter>gid</parameter></methodparam>
</methodsynopsis>
<para>
Needs to be written.</para>
</refsect1>
</refentry>
<refentry id="function.posix-getpwnam">
<refnamediv>
<refname>posix_getpwnam</refname>
<refpurpose>Return info about a user by username</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getpwnam</methodname>
<methodparam><type>string</type><parameter>username</parameter></methodparam>
</methodsynopsis>
<para>
Returns an associative array containing information about a
user referenced by an alphanumeric username, passed in the
<parameter>username</parameter> parameter.
</para>
<para>
The array elements returned are:
<table>
<title>The user 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 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
<parameter>username</parameter> parameter used when calling the
function, and hence redundant.
</entry>
</row>
<row>
<entry>passwd</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>uid</entry>
<entry>
User ID of the user in numeric form.
</entry>
</row>
<row>
<entry>gid</entry>
<entry>
The group ID of the user. Use the function
<function>posix_getgrgid</function> to resolve the
group name and a list of its members.
</entry>
</row>
<row>
<entry>gecos</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>dir</entry>
<entry>
This element contains the absolute path to the
home directory of the user.
</entry>
</row>
<row>
<entry>shell</entry>
<entry>
The shell element contains the absolute path to the executable of
the user's default shell.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
</refentry>
<refentry id="function.posix-getpwuid">
<refnamediv>
<refname>posix_getpwuid</refname>
<refpurpose>Return info about a user by user id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getpwuid</methodname>
<methodparam><type>int</type><parameter>uid</parameter></methodparam>
</methodsynopsis>
<para>
Returns an associative array containing information about a
user referenced by a numeric user ID, passed in the
<parameter>uid</parameter> parameter.
</para>
<para>
The array elements returned are:
<table>
<title>The user 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 username of the user. This is
a short, usually less than 16 character "handle" of the user,
not her real, full name.
</entry>
</row>
<row>
<entry>passwd</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>uid</entry>
<entry>
User ID, should be the same as the <parameter>uid</parameter>
parameter used when calling the function, and hence redundant.
</entry>
</row>
<row>
<entry>gid</entry>
<entry>
The group ID of the user. Use the function
<function>posix_getgrgid</function> to resolve the
group name and a list of its members.
</entry>
</row>
<row>
<entry>gecos</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>dir</entry>
<entry>
This element contains the absolute path to the
home directory of the user.
</entry>
</row>
<row>
<entry>shell</entry>
<entry>
The shell element contains the absolute path to the executable of
the user's default shell.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
</refentry>
<refentry id="function.posix-getrlimit">
<refnamediv>
<refname>posix_getrlimit</refname>
<refpurpose>Return info about system ressource limits</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>posix_getrlimit</methodname>
<methodparam><type>void</type><parameter/></methodparam>
</methodsynopsis>
<para>
Needs to be written ASAP.</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|