3 POSIX - Perl interface to IEEE Std 1003.1
9 use POSIX qw(:errno_h :fcntl_h);
11 printf "EINTR is %d\n", EINTR;
13 $sess_id = POSIX::setsid();
15 $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
16 # note: that's a filedescriptor, *NOT* a filehandle
20 The POSIX module permits you to access all (or nearly all) the standard
21 POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish
22 interfaces. Things which are C<#defines> in C, like EINTR or O_NDELAY, are
23 automatically exported into your namespace. All functions are only exported
24 if you ask for them explicitly. Most likely people will prefer to use the
25 fully-qualified function names.
27 This document gives a condensed list of the features available in the POSIX
28 module. Consult your operating system's manpages for general information on
29 most features. Consult L<perlfunc> for functions which are noted as being
30 identical to Perl's builtin functions.
32 The first section describes POSIX functions from the 1003.1 specification.
33 The second section describes some classes for signal objects, TTY objects,
34 and other miscellaneous objects. The remaining sections list various
35 constants and macros in an organization which roughly follows IEEE Std
40 The POSIX module is probably the most complex Perl module supplied with
41 the standard distribution. It incorporates autoloading, namespace games,
42 and dynamic loading of code that's in Perl, C, or both. It's a great
47 A few functions are not implemented because they are C specific. If you
48 attempt to call these, they will print a message telling you that they
49 aren't implemented, and suggest using the Perl equivalent should one
50 exist. For example, trying to access the setjmp() call will elicit the
51 message "setjmp() is C-specific: use eval {} instead".
53 Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
54 are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
55 For example, one vendor may not define EDEADLK, or the semantics of the
56 errno values set by open(2) might not be quite right. Perl does not
57 attempt to verify POSIX compliance. That means you can currently
58 successfully say "use POSIX", and then later in your program you find
59 that your vendor has been lax and there's no usable ICANON macro after
60 all. This could be construed to be a bug.
68 This is identical to the C function C<_exit()>. It exits the program
69 immediately which means among other things buffered I/O is B<not> flushed.
73 This is identical to the C function C<abort()>. It terminates the
74 process with a C<SIGABRT> signal unless caught by a signal handler or
75 if the handler does not return normally (it e.g. does a C<longjmp>).
79 This is identical to Perl's builtin C<abs()> function, returning
80 the absolute value of its numerical argument.
84 Determines the accessibility of a file.
86 if( POSIX::access( "/", &POSIX::R_OK ) ){
87 print "have read permission\n";
90 Returns C<undef> on failure. Note: do not use C<access()> for
91 security purposes. Between the C<access()> call and the operation
92 you are preparing for the permissions might change: a classic
97 This is identical to the C function C<acos()>, returning
98 the arcus cosine of its numerical argument.
102 This is identical to Perl's builtin C<alarm()> function,
103 either for arming or disarming the C<SIGARLM> timer.
107 This is identical to the C function C<asctime()>. It returns
110 "Fri Jun 2 18:22:13 2000\n\0"
112 and it is called thusly
114 $asctime = asctime($sec, $min, $hour, $mday, $mon, $year,
115 $wday, $yday, $isdst);
117 The C<$mon> is zero-based: January equals C<0>. The C<$year> is
118 1900-based: 2001 equals C<101>. The C<$wday>, C<$yday>, and C<$isdst>
119 default to zero (and the first two are usually ignored anyway).
123 This is identical to the C function C<asin()>, returning
124 the arcus sine of its numerical argument.
128 Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
129 to achieve similar things.
133 This is identical to the C function C<atan()>, returning the
134 arcus tangent of its numerical argument.
138 This is identical to Perl's builtin C<atan2()> function, returning
139 the arcus tangent defined by its two numerical arguments, the I<y>
140 coordinate and the I<x> coordinate.
144 atexit() is C-specific: use C<END {}> instead, see L<perlsub>.
148 atof() is C-specific. Perl converts strings to numbers transparently.
149 If you need to force a scalar to a number, add a zero to it.
153 atoi() is C-specific. Perl converts strings to numbers transparently.
154 If you need to force a scalar to a number, add a zero to it.
155 If you need to have just the integer part, see L<perlfunc/int>.
159 atol() is C-specific. Perl converts strings to numbers transparently.
160 If you need to force a scalar to a number, add a zero to it.
161 If you need to have just the integer part, see L<perlfunc/int>.
165 bsearch() not supplied. For doing binary search on wordlists,
170 calloc() is C-specific. Perl does memory management transparently.
174 This is identical to the C function C<ceil()>, returning the smallest
175 integer value greater than or equal to the given numerical argument.
179 This is identical to Perl's builtin C<chdir()> function, allowing
180 one to change the working (default) directory, see L<perlfunc/chdir>.
184 This is identical to Perl's builtin C<chmod()> function, allowing
185 one to change file and directory permissions, see L<perlfunc/chmod>.
189 This is identical to Perl's builtin C<chown()> function, allowing one
190 to change file and directory owners and groups, see L<perlfunc/chown>.
194 Use the method L<IO::Handle::clearerr()> instead, to reset the error
195 state (if any) and EOF state (if any) of the given stream.
199 This is identical to the C function C<clock()>, returning the
200 amount of spent processor time in microseconds.
204 Close the file. This uses file descriptors such as those obtained by calling
207 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
210 Returns C<undef> on failure.
212 See also L<perlfunc/close>.
216 This is identical to Perl's builtin C<closedir()> function for closing
217 a directory handle, see L<perlfunc/closedir>.
221 This is identical to Perl's builtin C<cos()> function, for returning
222 the cosine of its numerical argument, see L<perlfunc/cos>.
226 This is identical to the C function C<cosh()>, for returning
227 the hyperbolic cosine of its numeric argument.
231 Create a new file. This returns a file descriptor like the ones returned by
232 C<POSIX::open>. Use C<POSIX::close> to close the file.
234 $fd = POSIX::creat( "foo", 0611 );
237 See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
241 Generates the path name for the controlling terminal.
243 $path = POSIX::ctermid();
247 This is identical to the C function C<ctime()> and equivalent
248 to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
252 Get the login name of the owner of the current process.
254 $name = POSIX::cuserid();
258 This is identical to the C function C<difftime()>, for returning
259 the time difference (in seconds) between two times (as returned
260 by C<time()>), see L</time>.
264 div() is C-specific, use L<perlfunc/int> on the usual C</> division and
269 This is similar to the C function C<dup()>, for duplicating a file
272 This uses file descriptors such as those obtained by calling
275 Returns C<undef> on failure.
279 This is similar to the C function C<dup2()>, for duplicating a file
280 descriptor to an another known file descriptor.
282 This uses file descriptors such as those obtained by calling
285 Returns C<undef> on failure.
289 Returns the value of errno.
291 $errno = POSIX::errno();
293 This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
297 execl() is C-specific, see L<perlfunc/exec>.
301 execle() is C-specific, see L<perlfunc/exec>.
305 execlp() is C-specific, see L<perlfunc/exec>.
309 execv() is C-specific, see L<perlfunc/exec>.
313 execve() is C-specific, see L<perlfunc/exec>.
317 execvp() is C-specific, see L<perlfunc/exec>.
321 This is identical to Perl's builtin C<exit()> function for exiting the
322 program, see L<perlfunc/exit>.
326 This is identical to Perl's builtin C<exp()> function for
327 returning the exponent (I<e>-based) of the numerical argument,
332 This is identical to Perl's builtin C<abs()> function for returning
333 the absolute value of the numerical argument, see L<perlfunc/abs>.
337 Use method C<IO::Handle::close()> instead.
341 This is identical to Perl's builtin C<fcntl()> function,
342 see L<perlfunc/fcntl>.
346 Use method C<IO::Handle::new_from_fd()> instead.
350 Use method C<IO::Handle::eof()> instead.
354 Use method C<IO::Handle::error()> instead.
358 Use method C<IO::Handle::flush()> instead.
362 Use method C<IO::Handle::getc()> instead.
366 Use method C<IO::Seekable::getpos()> instead.
370 Use method C<IO::Handle::gets()> instead. Similar to E<lt>E<gt>, also known
371 as L<perlfunc/readline>.
375 Use method C<IO::Handle::fileno()> instead.
379 This is identical to the C function C<floor()>, returning the largest
380 integer value less than or equal to the numerical argument.
384 This is identical to the C function C<fmod()>.
388 It returns the remainder C<$r = $x - $n*$y>, where C<$n = trunc($x/$y)>.
389 The C<$r> has the same sign as C<$x> and magnitude (absolute value)
390 less than the magnitude of C<$y>.
394 Use method C<IO::File::open()> instead.
398 This is identical to Perl's builtin C<fork()> function.
402 Retrieves the value of a configurable limit on a file or directory. This
403 uses file descriptors such as those obtained by calling C<POSIX::open>.
405 The following will determine the maximum length of the longest allowable
406 pathname on the filesystem which holds C</tmp/foo>.
408 $fd = POSIX::open( "/tmp/foo", &POSIX::O_RDONLY );
409 $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
411 Returns C<undef> on failure.
415 fprintf() is C-specific, see L<perlfunc/printf> instead.
419 fputc() is C-specific, see L<perlfunc/print> instead.
423 fputs() is C-specific, see L<perlfunc/print> instead.
427 fread() is C-specific, see L<perlfunc/read> instead.
431 free() is C-specific. Perl does memory management transparently.
435 freopen() is C-specific, see L<perlfunc/open> instead.
439 Return the mantissa and exponent of a floating-point number.
441 ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
445 fscanf() is C-specific, use E<lt>E<gt> and regular expressions instead.
449 Use method C<IO::Seekable::seek()> instead.
453 Use method C<IO::Seekable::setpos()> instead.
457 Get file status. This uses file descriptors such as those obtained by
458 calling C<POSIX::open>. The data returned is identical to the data from
459 Perl's builtin C<stat> function.
461 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
462 @stats = POSIX::fstat( $fd );
466 Use method C<IO::Seekable::tell()> instead.
470 fwrite() is C-specific, see L<perlfunc/print> instead.
474 This is identical to Perl's builtin C<getc()> function,
475 see L<perlfunc/getc>.
479 Returns one character from STDIN. Identical to Perl's C<getc()>,
480 see L<perlfunc/getc>.
484 Returns the name of the current working directory.
489 Returns the effective group identifier. Similar to Perl' s builtin
490 variable C<$(>, see L<perlvar/$EGID>.
494 Returns the value of the specified enironment variable.
495 The same information is available through the C<%ENV> array.
499 Returns the effective user identifier. Identical to Perl's builtin C<$E<gt>>
500 variable, see L<perlvar/$EUID>.
504 Returns the user's real group identifier. Similar to Perl's builtin
505 variable C<$)>, see L<perlvar/$GID>.
509 This is identical to Perl's builtin C<getgrgid()> function for
510 returning group entries by group identifiers, see
511 L<perlfunc/getgrgid>.
515 This is identical to Perl's builtin C<getgrnam()> function for
516 returning group entries by group names, see L<perlfunc/getgrnam>.
520 Returns the ids of the user's supplementary groups. Similar to Perl's
521 builtin variable C<$)>, see L<perlvar/$GID>.
525 This is identical to Perl's builtin C<getlogin()> function for
526 returning the user name associated with the current session, see
527 L<perlfunc/getlogin>.
531 This is identical to Perl's builtin C<getpgrp()> function for
532 returning the prcess group identifier of the current process, see
537 Returns the process identifier. Identical to Perl's builtin
538 variable C<$$>, see L<perlvar/$PID>.
542 This is identical to Perl's builtin C<getppid()> function for
543 returning the process identifier of the parent process of the current
544 process , see L<perlfunc/getppid>.
548 This is identical to Perl's builtin C<getpwnam()> function for
549 returning user entries by user names, see L<perlfunc/getpwnam>.
553 This is identical to Perl's builtin C<getpwuid()> function for
554 returning user entries by user identifiers, see L<perlfunc/getpwuid>.
558 Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
559 as the C<readline()> function, see L<perlfunc/readline>.
561 B<NOTE>: if you have C programs that still use C<gets()>, be very
562 afraid. The C<gets()> function is a source of endless grief because
563 it has no buffer overrun checks. It should B<never> be used. The
564 C<fgets()> function should be preferred instead.
568 Returns the user's identifier. Identical to Perl's builtin C<$E<lt>> variable,
573 This is identical to Perl's builtin C<gmtime()> function for
574 converting seconds since the epoch to a date in Greenwich Mean Time,
575 see L<perlfunc/gmtime>.
579 This is identical to the C function, except that it can apply to a single
580 character or to a whole string. Consider using regular expressions and the
581 C</[[:isalnum:]]/> construct instead, or possibly the C</\w/> construct.
585 This is identical to the C function, except that it can apply to a single
586 character or to a whole string. Consider using regular expressions and the
587 C</[[:isalpha:]]/> construct instead.
591 Returns a boolean indicating whether the specified filehandle is connected
592 to a tty. Similar to the C<-t> operator, see L<perlfunc/-X>.
596 This is identical to the C function, except that it can apply to a single
597 character or to a whole string. Consider using regular expressions and the
598 C</[[:iscntrl:]]/> construct instead.
602 This is identical to the C function, except that it can apply to a single
603 character or to a whole string. Consider using regular expressions and the
604 C</[[:isdigit:]]/> construct instead, or the C</\d/> construct.
608 This is identical to the C function, except that it can apply to a single
609 character or to a whole string. Consider using regular expressions and the
610 C</[[:isgraph:]]/> construct instead.
614 This is identical to the C function, except that it can apply to a single
615 character or to a whole string. Consider using regular expressions and the
616 C</[[:islower:]]/> construct instead. Do B<not> use C</a-z/>.
620 This is identical to the C function, except that it can apply to a single
621 character or to a whole string. Consider using regular expressions and the
622 C</[[:isprint:]]/> construct instead.
626 This is identical to the C function, except that it can apply to a single
627 character or to a whole string. Consider using regular expressions and the
628 C</[[:ispunct:]]/> construct instead.
632 This is identical to the C function, except that it can apply to a single
633 character or to a whole string. Consider using regular expressions and the
634 C</[[:isspace:]]/> construct instead, or the C</\s/> construct.
638 This is identical to the C function, except that it can apply to a single
639 character or to a whole string. Consider using regular expressions and the
640 C</[[:isupper:]]/> construct instead. Do B<not> use C</A-Z/>.
644 This is identical to the C function, except that it can apply to a single
645 character or to a whole string. Consider using regular expressions and the
646 C</[[:isxdigit:]]/> construct instead, or simply C</[0-9a-f]/i>.
650 This is identical to Perl's builtin C<kill()> function for sending
651 signals to processes (oftern to terminate them), see L<perlfunc/kill>.
655 (For returning absolute values of long integers.)
656 labs() is C-specific, see L<perlfunc/abs> instead.
660 This is identical to the C function C<ldexp()>
661 for multiplying floating point numbers with powers of two.
663 $x_quadrupled = POSIX::ldexp($x, 2);
667 (For computing dividends of long integers.)
668 ldiv() is C-specific, use C</> and C<int()> instead.
672 This is identical to Perl's builtin C<link()> function
673 for creating hard links into files, see L<perlfunc/link>.
677 Get numeric formatting information. Returns a reference to a hash
678 containing the current locale formatting values.
680 Here is how to query the database for the B<de> (Deutsch or German) locale.
682 $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
683 print "Locale = $loc\n";
684 $lconv = POSIX::localeconv();
685 print "decimal_point = ", $lconv->{decimal_point}, "\n";
686 print "thousands_sep = ", $lconv->{thousands_sep}, "\n";
687 print "grouping = ", $lconv->{grouping}, "\n";
688 print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\n";
689 print "currency_symbol = ", $lconv->{currency_symbol}, "\n";
690 print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\n";
691 print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\n";
692 print "mon_grouping = ", $lconv->{mon_grouping}, "\n";
693 print "positive_sign = ", $lconv->{positive_sign}, "\n";
694 print "negative_sign = ", $lconv->{negative_sign}, "\n";
695 print "int_frac_digits = ", $lconv->{int_frac_digits}, "\n";
696 print "frac_digits = ", $lconv->{frac_digits}, "\n";
697 print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\n";
698 print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\n";
699 print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\n";
700 print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\n";
701 print "p_sign_posn = ", $lconv->{p_sign_posn}, "\n";
702 print "n_sign_posn = ", $lconv->{n_sign_posn}, "\n";
706 This is identical to Perl's builtin C<localtime()> function for
707 converting seconds since the epoch to a date see L<perlfunc/localtime>.
711 This is identical to Perl's builtin C<log()> function,
712 returning the natural (I<e>-based) logarithm of the numerical argument,
717 This is identical to the C function C<log10()>,
718 returning the 10-base logarithm of the numerical argument.
721 sub log10 { log($_[0]) / log(10) }
725 sub log10 { log($_[0]) / 2.30258509299405 }
729 sub log10 { log($_[0]) * 0.434294481903252 }
733 longjmp() is C-specific: use L<perlfunc/die> instead.
737 Move the file's read/write position. This uses file descriptors such as
738 those obtained by calling C<POSIX::open>.
740 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
741 $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
743 Returns C<undef> on failure.
747 malloc() is C-specific. Perl does memory management transparently.
751 This is identical to the C function C<mblen()>.
752 Perl does not have any support for the wide and multibyte
753 characters of the C standards, so this might be a rather
758 This is identical to the C function C<mbstowcs()>.
759 Perl does not have any support for the wide and multibyte
760 characters of the C standards, so this might be a rather
765 This is identical to the C function C<mbtowc()>.
766 Perl does not have any support for the wide and multibyte
767 characters of the C standards, so this might be a rather
772 memchr() is C-specific, see L<perlfunc/index> instead.
776 memcmp() is C-specific, use C<eq> instead, see L<perlop>.
780 memcpy() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
784 memmove() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
788 memset() is C-specific, use C<x> instead, see L<perlop>.
792 This is identical to Perl's builtin C<mkdir()> function
793 for creating directories, see L<perlfunc/mkdir>.
797 This is similar to the C function C<mkfifo()> for creating
800 if (mkfifo($path, $mode)) { ....
802 Returns C<undef> on failure. The C<$mode> is similar to the
803 mode of C<mkdir()>, see L<perlfunc/mkdir>.
807 Convert date/time info to a calendar time.
811 mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
813 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
814 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
815 year (C<year>) is given in years since 1900. I.e. The year 1995 is 95; the
816 year 2001 is 101. Consult your system's C<mktime()> manpage for details
817 about these and the other arguments.
819 Calendar time for December 12, 1995, at 10:30 am.
821 $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
822 print "Date = ", POSIX::ctime($time_t);
824 Returns C<undef> on failure.
828 Return the integral and fractional parts of a floating-point number.
830 ($fractional, $integral) = POSIX::modf( 3.14 );
834 This is similar to the C function C<nice()>, for changing
835 the scheduling preference of the current process. Positive
836 arguments mean more polite process, negative values more
837 needy process. Normal user processes can only be more polite.
839 Returns C<undef> on failure.
843 offsetof() is C-specific, you probably want to see L<perlfunc/pack> instead.
847 Open a file for reading for writing. This returns file descriptors, not
848 Perl filehandles. Use C<POSIX::close> to close the file.
850 Open a file read-only with mode 0666.
852 $fd = POSIX::open( "foo" );
854 Open a file for read and write.
856 $fd = POSIX::open( "foo", &POSIX::O_RDWR );
858 Open a file for write, with truncation.
860 $fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );
862 Create a new file with mode 0640. Set up the file for writing.
864 $fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );
866 Returns C<undef> on failure.
868 See also L<perlfunc/sysopen>.
872 Open a directory for reading.
874 $dir = POSIX::opendir( "/tmp" );
875 @files = POSIX::readdir( $dir );
876 POSIX::closedir( $dir );
878 Returns C<undef> on failure.
882 Retrieves the value of a configurable limit on a file or directory.
884 The following will determine the maximum length of the longest allowable
885 pathname on the filesystem which holds C</tmp>.
887 $path_max = POSIX::pathconf( "/tmp", &POSIX::_PC_PATH_MAX );
889 Returns C<undef> on failure.
893 This is similar to the C function C<pause()>, which suspends
894 the execution of the current process until a signal is received.
896 Returns C<undef> on failure.
900 This is identical to the C function C<perror()>, which outputs to the
901 standard error stream the specified message followed by ": " and the
902 current error string. Use the C<warn()> function and the C<$!>
903 variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
907 Create an interprocess channel. This returns file descriptors like those
908 returned by C<POSIX::open>.
910 ($fd0, $fd1) = POSIX::pipe();
911 POSIX::write( $fd0, "hello", 5 );
912 POSIX::read( $fd1, $buf, 5 );
914 See also L<perlfunc/pipe>.
918 Computes C<$x> raised to the power C<$exponent>.
920 $ret = POSIX::pow( $x, $exponent );
922 You can also use the C<**> operator, see L<perlop>.
926 Formats and prints the specified arguments to STDOUT.
927 See also L<perlfunc/printf>.
931 putc() is C-specific, see L<perlfunc/print> instead.
935 putchar() is C-specific, see L<perlfunc/print> instead.
939 puts() is C-specific, see L<perlfunc/print> instead.
943 qsort() is C-specific, see L<perlfunc/sort> instead.
947 Sends the specified signal to the current process.
948 See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
952 C<rand()> is non-portable, see L<perlfunc/rand> instead.
956 Read from a file. This uses file descriptors such as those obtained by
957 calling C<POSIX::open>. If the buffer C<$buf> is not large enough for the
958 read then Perl will extend it to make room for the request.
960 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
961 $bytes = POSIX::read( $fd, $buf, 3 );
963 Returns C<undef> on failure.
965 See also L<perlfunc/sysread>.
969 This is identical to Perl's builtin C<readdir()> function
970 for reading directory entries, see L<perlfunc/readdir>.
974 realloc() is C-specific. Perl does memory management transparently.
978 This is identical to Perl's builtin C<unlink()> function
979 for removing files, see L<perlfunc/unlink>.
983 This is identical to Perl's builtin C<rename()> function
984 for renaming files, see L<perlfunc/rename>.
988 Seeks to the beginning of the file.
992 This is identical to Perl's builtin C<rewinddir()> function for
993 rewinding directory entry streams, see L<perlfunc/rewinddir>.
997 This is identical to Perl's builtin C<rmdir()> function
998 for removing (empty) directories, see L<perlfunc/rmdir>.
1002 scanf() is C-specific, use E<lt>E<gt> and regular expressions instead,
1007 Sets the real group identifier for this process.
1008 Identical to assigning a value to the Perl's builtin C<$)> variable,
1009 see L<perlvar/$UID>.
1013 C<setjmp()> is C-specific: use C<eval {}> instead,
1014 see L<perlfunc/eval>.
1018 Modifies and queries program's locale. The following examples assume
1020 use POSIX qw(setlocale LC_ALL LC_CTYPE);
1024 The following will set the traditional UNIX system locale behavior
1025 (the second argument C<"C">).
1027 $loc = setlocale( LC_ALL, "C" );
1029 The following will query the current LC_CTYPE category. (No second
1030 argument means 'query'.)
1032 $loc = setlocale( LC_CTYPE );
1034 The following will set the LC_CTYPE behaviour according to the locale
1035 environment variables (the second argument C<"">).
1036 Please see your systems L<setlocale(3)> documentation for the locale
1037 environment variables' meaning or consult L<perllocale>.
1039 $loc = setlocale( LC_CTYPE, "" );
1041 The following will set the LC_COLLATE behaviour to Argentinian
1042 Spanish. B<NOTE>: The naming and availability of locales depends on
1043 your operating system. Please consult L<perllocale> for how to find
1044 out which locales are available in your system.
1046 $loc = setlocale( LC_ALL, "es_AR.ISO8859-1" );
1050 This is similar to the C function C<setpgid()> for
1051 setting the process group identifier of the current process.
1053 Returns C<undef> on failure.
1057 This is identical to the C function C<setsid()> for
1058 setting the session identifier of the current process.
1062 Sets the real user identifier for this process.
1063 Identical to assigning a value to the Perl's builtin C<$E<lt>> variable,
1064 see L<perlvar/$UID>.
1068 Detailed signal management. This uses C<POSIX::SigAction> objects for the
1069 C<action> and C<oldaction> arguments. Consult your system's C<sigaction>
1070 manpage for details.
1074 sigaction(sig, action, oldaction = 0)
1076 Returns C<undef> on failure.
1080 siglongjmp() is C-specific: use L<perlfunc/die> instead.
1084 Examine signals that are blocked and pending. This uses C<POSIX::SigSet>
1085 objects for the C<sigset> argument. Consult your system's C<sigpending>
1086 manpage for details.
1092 Returns C<undef> on failure.
1096 Change and/or examine calling process's signal mask. This uses
1097 C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
1098 Consult your system's C<sigprocmask> manpage for details.
1102 sigprocmask(how, sigset, oldsigset = 0)
1104 Returns C<undef> on failure.
1108 C<sigsetjmp()> is C-specific: use C<eval {}> instead,
1109 see L<perlfunc/eval>.
1113 Install a signal mask and suspend process until signal arrives. This uses
1114 C<POSIX::SigSet> objects for the C<signal_mask> argument. Consult your
1115 system's C<sigsuspend> manpage for details.
1119 sigsuspend(signal_mask)
1121 Returns C<undef> on failure.
1125 This is identical to Perl's builtin C<sin()> function
1126 for returning the sine of the numerical argument,
1127 see L<perlfunc/sin>.
1131 This is identical to the C function C<sinh()>
1132 for returning the hyperbolic sine of the numerical argument.
1136 This is identical to Perl's builtin C<sleep()> function
1137 for suspending the execution of the current for process
1138 for certain number of seconds, see L<perlfunc/sleep>.
1142 This is similar to Perl's builtin C<sprintf()> function
1143 for returning a string that has the arguments formatted as requested,
1144 see L<perlfunc/sprintf>.
1148 This is identical to Perl's builtin C<sqrt()> function.
1149 for returning the square root of the numerical argument,
1150 see L<perlfunc/sqrt>.
1154 Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
1158 sscanf() is C-specific, use regular expressions instead,
1163 This is identical to Perl's builtin C<stat()> function
1164 for retutning information about files and directories.
1168 strcat() is C-specific, use C<.=> instead, see L<perlop>.
1172 strchr() is C-specific, see L<perlfunc/index> instead.
1176 strcmp() is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
1180 This is identical to the C function C<strcoll()>
1181 for collating (comparing) strings transformed using
1182 the C<strxfrm()> function. Not really needed since
1183 Perl can do this transparently, see L<perllocale>.
1187 strcpy() is C-specific, use C<=> instead, see L<perlop>.
1191 strcspn() is C-specific, use regular expressions instead,
1196 Returns the error string for the specified errno.
1197 Identical to the string form of the C<$!>, see L<perlvar/$ERRNO>.
1201 Convert date and time information to string. Returns the string.
1205 strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
1207 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
1208 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
1209 year (C<year>) is given in years since 1900. I.e., the year 1995 is 95; the
1210 year 2001 is 101. Consult your system's C<strftime()> manpage for details
1211 about these and the other arguments.
1212 If you want your code to be portable, your format (C<fmt>) argument
1213 should use only the conversion specifiers defined by the ANSI C
1214 standard. These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
1215 The given arguments are made consistent
1216 as though by calling C<mktime()> before calling your system's
1217 C<strftime()> function, except that the C<isdst> value is not affected.
1219 The string for Tuesday, December 12, 1995.
1221 $str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 );
1226 strlen() is C-specific, use C<length()> instead, see L<perlfunc/length>.
1230 strncat() is C-specific, use C<.=> instead, see L<perlop>.
1234 strncmp() is C-specific, use C<eq> instead, see L<perlop>.
1238 strncpy() is C-specific, use C<=> instead, see L<perlop>.
1242 strpbrk() is C-specific, use regular expressions instead,
1247 strrchr() is C-specific, see L<perlfunc/rindex> instead.
1251 strspn() is C-specific, use regular expressions instead,
1256 This is identical to Perl's builtin C<index()> function,
1257 see L<perlfunc/index>.
1261 String to double translation. Returns the parsed number and the number
1262 of characters in the unparsed portion of the string. Truly
1263 POSIX-compliant systems set $! ($ERRNO) to indicate a translation
1264 error, so clear $! before calling strtod. However, non-POSIX systems
1265 may not check for overflow, and therefore will never set $!.
1267 strtod should respect any POSIX I<setlocale()> settings.
1269 To parse a string $str as a floating point number use
1272 ($num, $n_unparsed) = POSIX::strtod($str);
1274 The second returned item and $! can be used to check for valid input:
1276 if (($str eq '') || ($n_unparsed != 0) || !$!) {
1277 die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1280 When called in a scalar context strtod returns the parsed number.
1284 strtok() is C-specific, use regular expressions instead, see
1285 L<perlre>, or L<perlfunc/split>.
1289 String to (long) integer translation. Returns the parsed number and
1290 the number of characters in the unparsed portion of the string. Truly
1291 POSIX-compliant systems set $! ($ERRNO) to indicate a translation
1292 error, so clear $! before calling strtol. However, non-POSIX systems
1293 may not check for overflow, and therefore will never set $!.
1295 strtol should respect any POSIX I<setlocale()> settings.
1297 To parse a string $str as a number in some base $base use
1300 ($num, $n_unparsed) = POSIX::strtol($str, $base);
1302 The base should be zero or between 2 and 36, inclusive. When the base
1303 is zero or omitted strtol will use the string itself to determine the
1304 base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
1305 octal; any other leading characters mean decimal. Thus, "1234" is
1306 parsed as a decimal number, "01234" as an octal number, and "0x1234"
1307 as a hexadecimal number.
1309 The second returned item and $! can be used to check for valid input:
1311 if (($str eq '') || ($n_unparsed != 0) || !$!) {
1312 die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1315 When called in a scalar context strtol returns the parsed number.
1319 String to unsigned (long) integer translation. strtoul() is identical
1320 to strtol() except that strtoul() only parses unsigned integers. See
1321 L</strtol> for details.
1323 Note: Some vendors supply strtod() and strtol() but not strtoul().
1324 Other vendors that do supply strtoul() parse "-1" as a valid value.
1328 String transformation. Returns the transformed string.
1330 $dst = POSIX::strxfrm( $src );
1332 Used in conjunction with the C<strcoll()> function, see L</strcoll>.
1334 Not really needed since Perl can do this transparently, see
1339 Retrieves values of system configurable variables.
1341 The following will get the machine's clock speed.
1343 $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1345 Returns C<undef> on failure.
1349 This is identical to Perl's builtin C<system()> function, see
1354 This is identical to the C function C<tan()>, returning the
1355 tangent of the numerical argument.
1359 This is identical to the C function C<tanh()>, returning the
1360 hyperbolic tangent of the numerical argument.
1364 This is similar to the C function C<tcdrain()> for draining
1365 the output queue of its argument stream.
1367 Returns C<undef> on failure.
1371 This is similar to the C function C<tcflow()> for controlling
1372 the flow of its argument stream.
1374 Returns C<undef> on failure.
1378 This is similar to the C function C<tcflush()> for flushing
1379 the I/O buffers of its argumeny stream.
1381 Returns C<undef> on failure.
1385 This is identical to the C function C<tcgetpgrp()> for returning the
1386 process group identifier of the foreground process group of the controlling
1391 This is similar to the C function C<tcsendbreak()> for sending
1392 a break on its argument stream.
1394 Returns C<undef> on failure.
1398 This is similar to the C function C<tcsetpgrp()> for setting the
1399 process group identifier of the foreground process group of the controlling
1402 Returns C<undef> on failure.
1406 This is identical to Perl's builtin C<time()> function
1407 for returning the number of seconds since the epoch
1408 (whatever it is for the system), see L<perlfunc/time>.
1412 The times() function returns elapsed realtime since some point in the past
1413 (such as system startup), user and system times for this process, and user
1414 and system times used by child processes. All times are returned in clock
1417 ($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
1419 Note: Perl's builtin C<times()> function returns four values, measured in
1424 Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
1428 Returns a name for a temporary file.
1430 $tmpfile = POSIX::tmpnam();
1432 See also L<File::Temp>.
1436 This is identical to the C function, except that it can apply to a single
1437 character or to a whole string. Consider using the C<lc()> function,
1438 see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
1443 This is identical to the C function, except that it can apply to a single
1444 character or to a whole string. Consider using the C<uc()> function,
1445 see L<perlfunc/uc>, or the equivalent C<\U> operator inside doublequotish
1450 This is identical to the C function C<ttyname()> for returning the
1451 name of the current terminal.
1455 Retrieves the time conversion information from the C<tzname> variable.
1458 ($std, $dst) = POSIX::tzname();
1462 This is identical to the C function C<tzset()> for setting
1463 the current timezone based on the environment variable C<TZ>,
1464 to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
1469 This is identical to Perl's builtin C<umask()> function
1470 for setting (and querying) the file creation permission mask,
1471 see L<perlfunc/umask>.
1475 Get name of current operating system.
1477 ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
1479 Note that the actual meanings of the various fields are not
1480 that well standardized, do not expect any great portability.
1481 The C<$sysname> might be the name of the operating system,
1482 the C<$nodename> might be the name of the host, the C<$release>
1483 might be the (major) release number of the operating system,
1484 the C<$version> might be the (minor) release number of the
1485 operating system, and the C<$machine> might be a hardware identifier.
1490 Use method C<IO::Handle::ungetc()> instead.
1494 This is identical to Perl's builtin C<unlink()> function
1495 for removing files, see L<perlfunc/unlink>.
1499 This is identical to Perl's builtin C<utime()> function
1500 for changing the time stamps of files and directories,
1501 see L<perlfunc/utime>.
1505 vfprintf() is C-specific, see L<perlfunc/printf> instead.
1509 vprintf() is C-specific, see L<perlfunc/printf> instead.
1513 vsprintf() is C-specific, see L<perlfunc/sprintf> instead.
1517 This is identical to Perl's builtin C<wait()> function,
1518 see L<perlfunc/wait>.
1522 Wait for a child process to change state. This is identical to Perl's
1523 builtin C<waitpid()> function, see L<perlfunc/waitpid>.
1525 $pid = POSIX::waitpid( -1, &POSIX::WNOHANG );
1526 print "status = ", ($? / 256), "\n";
1530 This is identical to the C function C<wcstombs()>.
1531 Perl does not have any support for the wide and multibyte
1532 characters of the C standards, so this might be a rather
1537 This is identical to the C function C<wctomb()>.
1538 Perl does not have any support for the wide and multibyte
1539 characters of the C standards, so this might be a rather
1544 Write to a file. This uses file descriptors such as those obtained by
1545 calling C<POSIX::open>.
1547 $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
1549 $bytes = POSIX::write( $b, $buf, 5 );
1551 Returns C<undef> on failure.
1553 See also L<perlfunc/syswrite>.
1559 =head2 POSIX::SigAction
1565 Creates a new C<POSIX::SigAction> object which corresponds to the C
1566 C<struct sigaction>. This object will be destroyed automatically when it is
1567 no longer needed. The first parameter is the fully-qualified name of a sub
1568 which is a signal-handler. The second parameter is a C<POSIX::SigSet>
1569 object, it defaults to the empty set. The third parameter contains the
1570 C<sa_flags>, it defaults to 0.
1572 $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
1573 $sigaction = POSIX::SigAction->new( 'main::handler', $sigset, &POSIX::SA_NOCLDSTOP );
1575 This C<POSIX::SigAction> object should be used with the C<POSIX::sigaction()>
1580 =head2 POSIX::SigSet
1586 Create a new SigSet object. This object will be destroyed automatically
1587 when it is no longer needed. Arguments may be supplied to initialize the
1590 Create an empty set.
1592 $sigset = POSIX::SigSet->new;
1594 Create a set with SIGUSR1.
1596 $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
1600 Add a signal to a SigSet object.
1602 $sigset->addset( &POSIX::SIGUSR2 );
1604 Returns C<undef> on failure.
1608 Remove a signal from the SigSet object.
1610 $sigset->delset( &POSIX::SIGUSR2 );
1612 Returns C<undef> on failure.
1616 Initialize the SigSet object to be empty.
1618 $sigset->emptyset();
1620 Returns C<undef> on failure.
1624 Initialize the SigSet object to include all signals.
1628 Returns C<undef> on failure.
1632 Tests the SigSet object to see if it contains a specific signal.
1634 if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
1635 print "contains SIGUSR1\n";
1640 =head2 POSIX::Termios
1646 Create a new Termios object. This object will be destroyed automatically
1647 when it is no longer needed. A Termios object corresponds to the termios
1648 C struct. new() mallocs a new one, getattr() fills it from a file descriptor,
1649 and setattr() sets a file descriptor's parameters to match Termios' contents.
1651 $termios = POSIX::Termios->new;
1655 Get terminal control attributes.
1657 Obtain the attributes for stdin.
1661 Obtain the attributes for stdout.
1663 $termios->getattr( 1 )
1665 Returns C<undef> on failure.
1669 Retrieve a value from the c_cc field of a termios object. The c_cc field is
1670 an array so an index must be specified.
1672 $c_cc[1] = $termios->getcc(1);
1676 Retrieve the c_cflag field of a termios object.
1678 $c_cflag = $termios->getcflag;
1682 Retrieve the c_iflag field of a termios object.
1684 $c_iflag = $termios->getiflag;
1688 Retrieve the input baud rate.
1690 $ispeed = $termios->getispeed;
1694 Retrieve the c_lflag field of a termios object.
1696 $c_lflag = $termios->getlflag;
1700 Retrieve the c_oflag field of a termios object.
1702 $c_oflag = $termios->getoflag;
1706 Retrieve the output baud rate.
1708 $ospeed = $termios->getospeed;
1712 Set terminal control attributes.
1714 Set attributes immediately for stdout.
1716 $termios->setattr( 1, &POSIX::TCSANOW );
1718 Returns C<undef> on failure.
1722 Set a value in the c_cc field of a termios object. The c_cc field is an
1723 array so an index must be specified.
1725 $termios->setcc( &POSIX::VEOF, 1 );
1729 Set the c_cflag field of a termios object.
1731 $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
1735 Set the c_iflag field of a termios object.
1737 $termios->setiflag( $c_iflag | &POSIX::BRKINT );
1741 Set the input baud rate.
1743 $termios->setispeed( &POSIX::B9600 );
1745 Returns C<undef> on failure.
1749 Set the c_lflag field of a termios object.
1751 $termios->setlflag( $c_lflag | &POSIX::ECHO );
1755 Set the c_oflag field of a termios object.
1757 $termios->setoflag( $c_oflag | &POSIX::OPOST );
1761 Set the output baud rate.
1763 $termios->setospeed( &POSIX::B9600 );
1765 Returns C<undef> on failure.
1767 =item Baud rate values
1769 B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110
1771 =item Terminal interface values
1773 TCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF
1775 =item c_cc field values
1777 VEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS
1779 =item c_cflag field values
1781 CLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD
1783 =item c_iflag field values
1785 BRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK
1787 =item c_lflag field values
1789 ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP
1791 =item c_oflag field values
1797 =head1 PATHNAME CONSTANTS
1803 _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
1807 =head1 POSIX CONSTANTS
1813 _POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION
1817 =head1 SYSTEM CONFIGURATION
1823 _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
1833 E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
1834 EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ
1835 EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR
1836 EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG
1837 ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC
1838 ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
1839 ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE
1840 EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS
1841 ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS
1842 ETXTBSY EUSERS EWOULDBLOCK EXDEV
1852 FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY
1862 DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP
1872 ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
1882 LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME
1902 SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTART
1903 SA_SIGINFO SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT
1904 SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU
1905 SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK
1916 S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
1920 S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
1930 EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX
1940 BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX
1950 CLK_TCK CLOCKS_PER_SEC
1960 R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STDERR_FILENO W_OK X_OK
1974 WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG