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
24 This document gives a condensed list of the features available in the POSIX
25 module. Consult your operating system's manpages for general information on
26 most features. Consult L<perlfunc> for functions which are noted as being
27 identical or almost identical to Perl's builtin functions.
29 The first section describes POSIX functions from the 1003.1 specification.
30 The second section describes some classes for signal objects, TTY objects,
31 and other miscellaneous objects. The remaining sections list various
32 constants and macros in an organization which roughly follows IEEE Std
37 I<Everything is exported by default> (with a handful of exceptions).
38 This is an unfortunate backwards compatibility feature and its use is
39 B<strongly L<discouraged|perlpolicy/discouraged>>.
40 You should either prevent the exporting (by saying S<C<use POSIX ();>>,
41 as usual) and then use fully qualified names (e.g. C<POSIX::SEEK_END>),
42 or give an explicit import list.
43 If you do neither and opt for the default (as in S<C<use POSIX;>>), you
44 will import I<hundreds and hundreds> of symbols into your namespace.
46 A few functions are not implemented because they are C specific. If you
47 attempt to call these, they will print a message telling you that they
48 aren't implemented, and suggest using the Perl equivalent, should one
49 exist. For example, trying to access the C<setjmp()> call will elicit the
50 message "C<setjmp() is C-specific: use eval {} instead>".
52 Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
53 are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
54 For example, one vendor may not define C<EDEADLK>, or the semantics of the
55 errno values set by C<open(2)> might not be quite right. Perl does not
56 attempt to verify POSIX compliance. That means you can currently
57 successfully say "use POSIX", and then later in your program you find
58 that your vendor has been lax and there's no usable C<ICANON> macro after
59 all. This could be construed to be a bug.
67 This is identical to the C function C<_exit()>. It exits the program
68 immediately which means among other things buffered I/O is B<not> flushed.
70 Note that when using threads and in Linux this is B<not> a good way to
71 exit a thread because in Linux processes and threads are kind of the
72 same thing (Note: while this is the situation in early 2003 there are
73 projects under way to have threads with more POSIXly semantics in Linux).
74 If you want not to return from a thread, detach the thread.
78 This is identical to the C function C<abort()>. It terminates the
79 process with a C<SIGABRT> signal unless caught by a signal handler or
80 if the handler does not return normally (it e.g. does a C<longjmp>).
84 This is identical to Perl's builtin C<abs()> function, returning
85 the absolute value of its numerical argument.
89 Determines the accessibility of a file.
91 if( POSIX::access( "/", &POSIX::R_OK ) ){
92 print "have read permission\n";
95 Returns C<undef> on failure. Note: do not use C<access()> for
96 security purposes. Between the C<access()> call and the operation
97 you are preparing for the permissions might change: a classic
102 This is identical to the C function C<acos()>, returning
103 the arcus cosine of its numerical argument. See also L<Math::Trig>.
107 This is identical to the C function C<acosh()>, returning the
108 hyperbolic arcus cosine of its numerical argument [C99]. See also
113 This is identical to Perl's builtin C<alarm()> function,
114 either for arming or disarming the C<SIGARLM> timer.
118 This is identical to the C function C<asctime()>. It returns
121 "Fri Jun 2 18:22:13 2000\n\0"
123 and it is called thusly
125 $asctime = asctime($sec, $min, $hour, $mday, $mon,
126 $year, $wday, $yday, $isdst);
128 The C<$mon> is zero-based: January equals C<0>. The C<$year> is
129 1900-based: 2001 equals C<101>. C<$wday> and C<$yday> default to zero
130 (and are usually ignored anyway), and C<$isdst> defaults to -1.
134 This is identical to the C function C<asin()>, returning
135 the arcus sine of its numerical argument. See also L<Math::Trig>.
139 This is identical to the C function C<asinh()>, returning the
140 hyperbolic arcus sine of its numerical argument [C99]. See also
145 Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
146 to achieve similar things.
150 This is identical to the C function C<atan()>, returning the
151 arcus tangent of its numerical argument. See also L<Math::Trig>.
155 This is identical to the C function C<atanh()>, returning the
156 hyperbolic arcus tangent of its numerical argument [C99]. See also
161 This is identical to Perl's builtin C<atan2()> function, returning
162 the arcus tangent defined by its two numerical arguments, the I<y>
163 coordinate and the I<x> coordinate. See also L<Math::Trig>.
167 Not implemented. C<atexit()> is C-specific: use C<END {}> instead, see L<perlmod>.
171 Not implemented. C<atof()> is C-specific. Perl converts strings to numbers transparently.
172 If you need to force a scalar to a number, add a zero to it.
176 Not implemented. C<atoi()> is C-specific. Perl converts strings to numbers transparently.
177 If you need to force a scalar to a number, add a zero to it.
178 If you need to have just the integer part, see L<perlfunc/int>.
182 Not implemented. C<atol()> is C-specific. Perl converts strings to numbers transparently.
183 If you need to force a scalar to a number, add a zero to it.
184 If you need to have just the integer part, see L<perlfunc/int>.
188 C<bsearch()> not supplied. For doing binary search on wordlists,
193 Not implemented. C<calloc()> is C-specific. Perl does memory management transparently.
201 This is identical to the C function C<ceil()>, returning the smallest
202 integer value greater than or equal to the given numerical argument.
206 This is identical to Perl's builtin C<chdir()> function, allowing
207 one to change the working (default) directory, see L<perlfunc/chdir>.
211 This is identical to Perl's builtin C<chmod()> function, allowing
212 one to change file and directory permissions, see L<perlfunc/chmod>.
216 This is identical to Perl's builtin C<chown()> function, allowing one
217 to change file and directory owners and groups, see L<perlfunc/chown>.
221 Not implemented. Use the method C<IO::Handle::clearerr()> instead, to reset the error
222 state (if any) and EOF state (if any) of the given stream.
226 This is identical to the C function C<clock()>, returning the
227 amount of spent processor time in microseconds.
231 Close the file. This uses file descriptors such as those obtained by calling
234 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
237 Returns C<undef> on failure.
239 See also L<perlfunc/close>.
243 This is identical to Perl's builtin C<closedir()> function for closing
244 a directory handle, see L<perlfunc/closedir>.
248 This is identical to Perl's builtin C<cos()> function, for returning
249 the cosine of its numerical argument, see L<perlfunc/cos>.
250 See also L<Math::Trig>.
254 This is identical to the C function C<cosh()>, for returning
255 the hyperbolic cosine of its numeric argument. See also L<Math::Trig>.
259 Returns C<x> but with the sign of C<y> [C99].
261 $x_with_sign_of_y = POSIX::copysign($x, $y);
263 See also L</signbit>.
267 Create a new file. This returns a file descriptor like the ones returned by
268 C<POSIX::open>. Use C<POSIX::close> to close the file.
270 $fd = POSIX::creat( "foo", 0611 );
273 See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
277 Generates the path name for the controlling terminal.
279 $path = POSIX::ctermid();
283 This is identical to the C function C<ctime()> and equivalent
284 to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
288 Get the login name of the owner of the current process.
290 $name = POSIX::cuserid();
294 This is identical to the C function C<difftime()>, for returning
295 the time difference (in seconds) between two times (as returned
296 by C<time()>), see L</time>.
300 Not implemented. C<div()> is C-specific, use L<perlfunc/int> on the usual C</> division and
305 This is similar to the C function C<dup()>, for duplicating a file
308 This uses file descriptors such as those obtained by calling
311 Returns C<undef> on failure.
315 This is similar to the C function C<dup2()>, for duplicating a file
316 descriptor to an another known file descriptor.
318 This uses file descriptors such as those obtained by calling
321 Returns C<undef> on failure.
325 The error function [C99].
329 The complementary error function [C99].
333 Returns the value of errno.
335 $errno = POSIX::errno();
337 This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
341 Not implemented. C<execl()> is C-specific, see L<perlfunc/exec>.
345 Not implemented. C<execle()> is C-specific, see L<perlfunc/exec>.
349 Not implemented. C<execlp()> is C-specific, see L<perlfunc/exec>.
353 Not implemented. C<execv()> is C-specific, see L<perlfunc/exec>.
357 Not implemented. C<execve()> is C-specific, see L<perlfunc/exec>.
361 Not implemented. C<execvp()> is C-specific, see L<perlfunc/exec>.
365 This is identical to Perl's builtin C<exit()> function for exiting the
366 program, see L<perlfunc/exit>.
370 This is identical to Perl's builtin C<exp()> function for
371 returning the exponent (I<e>-based) of the numerical argument,
376 Equivalent to C<exp(x) - 1>, but more precise for small argument values [C99].
382 This is identical to Perl's builtin C<abs()> function for returning
383 the absolute value of the numerical argument, see L<perlfunc/abs>.
387 Not implemented. Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
391 This is identical to Perl's builtin C<fcntl()> function,
392 see L<perlfunc/fcntl>.
396 Not implemented. Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
400 Not implemented. Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
404 Not implemented. Use method C<IO::Handle::error()> instead.
408 Not implemented. Use method C<IO::Handle::flush()> instead.
409 See also C<L<perlvar/$OUTPUT_AUTOFLUSH>>.
413 Not implemented. Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
417 Not implemented. Use method C<IO::Seekable::getpos()> instead, or see L<perlfunc/seek>.
421 Not implemented. Use method C<IO::Handle::gets()> instead. Similar to E<lt>E<gt>, also known
422 as L<perlfunc/readline>.
426 Not implemented. Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
430 This is identical to the C function C<floor()>, returning the largest
431 integer value less than or equal to the numerical argument.
435 "Positive difference", S<C<x - y>> if S<C<x E<gt> y>>, zero otherwise [C99].
439 Returns the current floating point rounding mode, one of
441 FE_TONEAREST FE_TOWARDZERO FE_UPWARD FE_UPWARD
443 C<FE_TONEAREST> is like L</round>, C<FE_TOWARDZERO> is like L</trunc> [C99].
447 Sets the floating point rounding mode, see L</fegetround> [C99].
451 "Fused multiply-add", S<C<x * y + z>>, possibly faster (and less lossy)
452 than the explicit two operations [C99].
454 my $fused = POSIX::fma($x, $y, $z);
458 Maximum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
460 my $min = POSIX::fmax($x, $y);
464 Minimum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
466 my $min = POSIX::fmin($x, $y);
470 This is identical to the C function C<fmod()>.
474 It returns the remainder S<C<$r = $x - $n*$y>>, where S<C<$n = trunc($x/$y)>>.
475 The C<$r> has the same sign as C<$x> and magnitude (absolute value)
476 less than the magnitude of C<$y>.
480 Not implemented. Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
484 This is identical to Perl's builtin C<fork()> function
485 for duplicating the current process, see L<perlfunc/fork>
486 and L<perlfork> if you are in Windows.
490 Retrieves the value of a configurable limit on a file or directory. This
491 uses file descriptors such as those obtained by calling C<POSIX::open>.
493 The following will determine the maximum length of the longest allowable
494 pathname on the filesystem which holds F</var/foo>.
496 $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
497 $path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX);
499 Returns C<undef> on failure.
505 FP_NORMAL FP_ZERO FP_SUBNORMAL FP_INFINITE FP_NAN
507 telling the class of the argument [C99]. C<FP_INFINITE> is positive
508 or negative infinity, C<FP_NAN> is not-a-number. C<FP_SUBNORMAL>
509 means subnormal numbers (also known as denormals), very small numbers
510 with low precision. C<FP_ZERO> is zero. C<FP_NORMAL> is all the rest.
514 Not implemented. C<fprintf()> is C-specific, see L<perlfunc/printf> instead.
518 Not implemented. C<fputc()> is C-specific, see L<perlfunc/print> instead.
522 Not implemented. C<fputs()> is C-specific, see L<perlfunc/print> instead.
526 Not implemented. C<fread()> is C-specific, see L<perlfunc/read> instead.
530 Not implemented. C<free()> is C-specific. Perl does memory management transparently.
534 Not implemented. C<freopen()> is C-specific, see L<perlfunc/open> instead.
538 Return the mantissa and exponent of a floating-point number.
540 ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
544 Not implemented. C<fscanf()> is C-specific, use E<lt>E<gt> and regular expressions instead.
548 Not implemented. Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
552 Not implemented. Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
556 Get file status. This uses file descriptors such as those obtained by
557 calling C<POSIX::open>. The data returned is identical to the data from
558 Perl's builtin C<stat> function.
560 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
561 @stats = POSIX::fstat( $fd );
565 Not implemented. Use method C<IO::Handle::sync()> instead.
569 Not implemented. Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
573 Not implemented. C<fwrite()> is C-specific, see L<perlfunc/print> instead.
577 This is identical to Perl's builtin C<getc()> function,
578 see L<perlfunc/getc>.
582 Returns one character from STDIN. Identical to Perl's C<getc()>,
583 see L<perlfunc/getc>.
587 Returns the name of the current working directory.
592 Returns the effective group identifier. Similar to Perl' s builtin
593 variable C<$(>, see L<perlvar/$EGID>.
597 Returns the value of the specified environment variable.
598 The same information is available through the C<%ENV> array.
602 Returns the effective user identifier. Identical to Perl's builtin C<$E<gt>>
603 variable, see L<perlvar/$EUID>.
607 Returns the user's real group identifier. Similar to Perl's builtin
608 variable C<$)>, see L<perlvar/$GID>.
612 This is identical to Perl's builtin C<getgrgid()> function for
613 returning group entries by group identifiers, see
614 L<perlfunc/getgrgid>.
618 This is identical to Perl's builtin C<getgrnam()> function for
619 returning group entries by group names, see L<perlfunc/getgrnam>.
623 Returns the ids of the user's supplementary groups. Similar to Perl's
624 builtin variable C<$)>, see L<perlvar/$GID>.
628 This is identical to Perl's builtin C<getlogin()> function for
629 returning the user name associated with the current session, see
630 L<perlfunc/getlogin>.
634 use POSIX ':nan_payload';
637 Returns the C<NaN> payload.
639 Note the API instability warning in L</setpayload>.
641 See L</nan> for more discussion about C<NaN>.
645 This is identical to Perl's builtin C<getpgrp()> function for
646 returning the process group identifier of the current process, see
651 Returns the process identifier. Identical to Perl's builtin
652 variable C<$$>, see L<perlvar/$PID>.
656 This is identical to Perl's builtin C<getppid()> function for
657 returning the process identifier of the parent process of the current
658 process , see L<perlfunc/getppid>.
662 This is identical to Perl's builtin C<getpwnam()> function for
663 returning user entries by user names, see L<perlfunc/getpwnam>.
667 This is identical to Perl's builtin C<getpwuid()> function for
668 returning user entries by user identifiers, see L<perlfunc/getpwuid>.
672 Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
673 as the C<readline()> function, see L<perlfunc/readline>.
675 B<NOTE>: if you have C programs that still use C<gets()>, be very
676 afraid. The C<gets()> function is a source of endless grief because
677 it has no buffer overrun checks. It should B<never> be used. The
678 C<fgets()> function should be preferred instead.
682 Returns the user's identifier. Identical to Perl's builtin C<$E<lt>> variable,
687 This is identical to Perl's builtin C<gmtime()> function for
688 converting seconds since the epoch to a date in Greenwich Mean Time,
689 see L<perlfunc/gmtime>.
693 Equivalent to C<S<sqrt(x * x + y * y)>> except more stable on very large
694 or very small arguments [C99].
698 Integer binary logarithm [C99]
700 For example C<ilogb(20)> is 4, as an integer.
706 The infinity as a constant:
709 my $pos_inf = +Inf; # Or just Inf.
712 See also L</isinf>, and L</fpclassify>.
716 This function has been removed as of v5.24. It was very similar to
717 matching against S<C<qr/ ^ [[:alnum:]]+ $ /x>>, which you should convert
718 to use instead. See L<perlrecharclass/POSIX Character Classes>.
722 This function has been removed as of v5.24. It was very similar to
723 matching against S<C<qr/ ^ [[:alpha:]]+ $ /x>>, which you should convert
724 to use instead. See L<perlrecharclass/POSIX Character Classes>.
728 Returns a boolean indicating whether the specified filehandle is connected
729 to a tty. Similar to the C<-t> operator, see L<perlfunc/-X>.
733 This function has been removed as of v5.24. It was very similar to
734 matching against S<C<qr/ ^ [[:cntrl:]]+ $ /x>>, which you should convert
735 to use instead. See L<perlrecharclass/POSIX Character Classes>.
739 This function has been removed as of v5.24. It was very similar to
740 matching against S<C<qr/ ^ [[:digit:]]+ $ /x>>, which you should convert
741 to use instead. See L<perlrecharclass/POSIX Character Classes>.
745 Returns true if the argument is a finite number (that is, not an
746 infinity, or the not-a-number) [C99].
748 See also L</isinf>, L</isnan>, and L</fpclassify>.
752 This function has been removed as of v5.24. It was very similar to
753 matching against S<C<qr/ ^ [[:graph:]]+ $ /x>>, which you should convert
754 to use instead. See L<perlrecharclass/POSIX Character Classes>.
758 (Also C<isgreaterequal>, C<isless>, C<islessequal>, C<islessgreater>,
761 Floating point comparisons which handle the C<NaN> [C99].
765 Returns true if the argument is an infinity (positive or negative) [C99].
767 See also L</Inf>, L</isnan>, L</isfinite>, and L</fpclassify>.
771 This function has been removed as of v5.24. It was very similar to
772 matching against S<C<qr/ ^ [[:lower:]]+ $ /x>>, which you should convert
773 to use instead. See L<perlrecharclass/POSIX Character Classes>.
777 Returns true if the argument is C<NaN> (not-a-number) [C99].
779 Note that you cannot test for "C<NaN>-ness" with
783 since the C<NaN> is not equivalent to anything, B<including itself>.
785 See also L</nan>, L</NaN>, L</isinf>, and L</fpclassify>.
789 Returns true if the argument is normal (that is, not a subnormal/denormal,
790 and not an infinity, or a not-a-number) [C99].
792 See also L</isfinite>, and L</fpclassify>.
796 This function has been removed as of v5.24. It was very similar to
797 matching against S<C<qr/ ^ [[:print:]]+ $ /x>>, which you should convert
798 to use instead. See L<perlrecharclass/POSIX Character Classes>.
802 This function has been removed as of v5.24. It was very similar to
803 matching against S<C<qr/ ^ [[:punct:]]+ $ /x>>, which you should convert
804 to use instead. See L<perlrecharclass/POSIX Character Classes>.
808 use POSIX ':nan_payload';
809 issignaling($var, $payload)
811 Return true if the argument is a I<signaling> NaN.
813 Note the API instability warning in L</setpayload>.
815 See L</nan> for more discussion about C<NaN>.
819 This function has been removed as of v5.24. It was very similar to
820 matching against S<C<qr/ ^ [[:space:]]+ $ /x>>, which you should convert
821 to use instead. See L<perlrecharclass/POSIX Character Classes>.
825 This function has been removed as of v5.24. It was very similar to
826 matching against S<C<qr/ ^ [[:upper:]]+ $ /x>>, which you should convert
827 to use instead. See L<perlrecharclass/POSIX Character Classes>.
831 This function has been removed as of v5.24. It was very similar to
832 matching against S<C<qr/ ^ [[:xdigit:]]+ $ /x>>, which you should
833 convert to use instead. See L<perlrecharclass/POSIX Character Classes>.
847 The Bessel function of the first kind of the order zero.
851 This is identical to Perl's builtin C<kill()> function for sending
852 signals to processes (often to terminate them), see L<perlfunc/kill>.
856 Not implemented. (For returning absolute values of long integers.)
857 C<labs()> is C-specific, see L<perlfunc/abs> instead.
861 This is identical to the C function, except the order of arguments is
862 consistent with Perl's builtin C<chown()> with the added restriction
863 of only one path, not a list of paths. Does the same thing as the
864 C<chown()> function but changes the owner of a symbolic link instead
865 of the file the symbolic link points to.
867 POSIX::lchown($uid, $gid, $file_path);
871 This is identical to the C function C<ldexp()>
872 for multiplying floating point numbers with powers of two.
874 $x_quadrupled = POSIX::ldexp($x, 2);
878 Not implemented. (For computing dividends of long integers.)
879 C<ldiv()> is C-specific, use C</> and C<int()> instead.
883 The logarithm of the Gamma function [C99].
889 Equivalent to S<C<log(1 + x)>>, but more stable results for small argument
894 Logarithm base two [C99].
900 Integer binary logarithm [C99].
902 For example C<logb(20)> is 4, as a floating point number.
908 This is identical to Perl's builtin C<link()> function
909 for creating hard links into files, see L<perlfunc/link>.
913 Get numeric formatting information. Returns a reference to a hash
914 containing the current underlying locale's formatting values. Users of this function
915 should also read L<perllocale>, which provides a comprehensive
916 discussion of Perl locale handling, including
917 L<a section devoted to this function|perllocale/The localeconv function>.
919 Here is how to query the database for the B<de> (Deutsch or German) locale.
921 my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
922 print "Locale: \"$loc\"\n";
923 my $lconv = POSIX::localeconv();
924 foreach my $property (qw(
951 printf qq(%s: "%s",\n),
952 $property, $lconv->{$property};
955 The members whose names begin with C<int_p_> and C<int_n_> were added by
956 POSIX.1-2008 and are only available on systems that support them.
960 This is identical to Perl's builtin C<localtime()> function for
961 converting seconds since the epoch to a date see L<perlfunc/localtime> except
962 that C<POSIX::localtime()> must be provided an explicit value (rather than
963 relying an implicit C<$_>:
965 @localtime = POSIX::localtime(time); # Good
967 @localtime = localtime(); # Good
969 @localtime = POSIX::localtime(); # Throws exception
973 This is identical to Perl's builtin C<log()> function,
974 returning the natural (I<e>-based) logarithm of the numerical argument,
979 This is identical to the C function C<log10()>,
980 returning the 10-base logarithm of the numerical argument.
983 sub log10 { log($_[0]) / log(10) }
987 sub log10 { log($_[0]) / 2.30258509299405 }
991 sub log10 { log($_[0]) * 0.434294481903252 }
995 Not implemented. C<longjmp()> is C-specific: use L<perlfunc/die> instead.
999 Move the file's read/write position. This uses file descriptors such as
1000 those obtained by calling C<POSIX::open>.
1002 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1003 $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
1005 Returns C<undef> on failure.
1009 Depending on the current floating point rounding mode, rounds the
1010 argument either toward nearest (like L</round>), toward zero (like
1011 L</trunc>), downward (toward negative infinity), or upward (toward
1012 positive infinity) [C99].
1014 For the rounding mode, see L</fegetround>.
1018 Like L</round>, but as integer, as opposed to floating point [C99].
1020 See also L</ceil>, L</floor>, L</trunc>.
1022 Owing to an oversight, this is not currently exported by default, or as part of
1023 the C<:math_h_c99> export tag; importing it must therefore be done by explicit
1028 Not implemented. C<malloc()> is C-specific. Perl does memory management transparently.
1032 This is identical to the C function C<mblen()>.
1034 Core Perl does not have any support for the wide and multibyte
1035 characters of the C standards, except under UTF-8 locales, so this might
1036 be a rather useless function.
1038 However, Perl supports Unicode, see L<perluniintro>.
1042 This is identical to the C function C<mbstowcs()>.
1048 This is identical to the C function C<mbtowc()>.
1054 Not implemented. C<memchr()> is C-specific, see L<perlfunc/index> instead.
1058 Not implemented. C<memcmp()> is C-specific, use C<eq> instead, see L<perlop>.
1062 Not implemented. C<memcpy()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1066 Not implemented. C<memmove()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1070 Not implemented. C<memset()> is C-specific, use C<x> instead, see L<perlop>.
1074 This is identical to Perl's builtin C<mkdir()> function
1075 for creating directories, see L<perlfunc/mkdir>.
1079 This is similar to the C function C<mkfifo()> for creating
1082 if (mkfifo($path, $mode)) { ....
1084 Returns C<undef> on failure. The C<$mode> is similar to the
1085 mode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
1086 you B<must> specify the C<$mode>.
1090 Convert date/time info to a calendar time.
1094 mktime(sec, min, hour, mday, mon, year, wday = 0,
1095 yday = 0, isdst = -1)
1097 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1098 I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
1099 year (C<year>) is given in years since 1900; I<i.e.>, the year 1995 is 95; the
1100 year 2001 is 101. Consult your system's C<mktime()> manpage for details
1101 about these and the other arguments.
1103 Calendar time for December 12, 1995, at 10:30 am.
1105 $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
1106 print "Date = ", POSIX::ctime($time_t);
1108 Returns C<undef> on failure.
1112 Return the integral and fractional parts of a floating-point number.
1114 ($fractional, $integral) = POSIX::modf( 3.14 );
1120 The not-a-number as a constant:
1125 See also L</nan>, C</isnan>, and L</fpclassify>.
1131 Returns C<NaN>, not-a-number [C99].
1133 The returned NaN is always a I<quiet> NaN, as opposed to I<signaling>.
1135 With an argument, can be used to generate a NaN with I<payload>.
1136 The argument is first interpreted as a floating point number,
1137 but then any fractional parts are truncated (towards zero),
1138 and the value is interpreted as an unsigned integer.
1139 The bits of this integer are stored in the unused bits of the NaN.
1141 The result has a dual nature: it is a NaN, but it also carries
1142 the integer inside it. The integer can be retrieved with L</getpayload>.
1143 Note, though, that the payload is not propagated, not even on copies,
1144 and definitely not in arithmetic operations.
1146 How many bits fit in the NaN depends on what kind of floating points
1147 are being used, but on the most common platforms (64-bit IEEE 754,
1148 or the x86 80-bit long doubles) there are 51 and 61 bits available,
1149 respectively. (There would be 52 and 62, but the quiet/signaling
1150 bit of NaNs takes away one.) However, because of the floating-point-to-
1151 integer-and-back conversions, please test carefully whether you get back
1152 what you put in. If your integers are only 32 bits wide, you probably
1153 should not rely on more than 32 bits of payload.
1155 Whether a "signaling" NaN is in any way different from a "quiet" NaN,
1156 depends on the platform. Also note that the payload of the default
1157 NaN (no argument to nan()) is not necessarily zero, use C<setpayload>
1158 to explicitly set the payload. On some platforms like the 32-bit x86,
1159 (unless using the 80-bit long doubles) the signaling bit is not supported
1162 See also L</isnan>, L</NaN>, L</setpayload> and L</issignaling>.
1166 Returns the nearest integer to the argument, according to the current
1167 rounding mode (see L</fegetround>) [C99].
1171 Returns the next representable floating point number after C<x> in the
1172 direction of C<y> [C99].
1174 my $nextafter = POSIX::nextafter($x, $y);
1176 Like L</nexttoward>, but potentially less accurate.
1180 Returns the next representable floating point number after C<x> in the
1181 direction of C<y> [C99].
1183 my $nexttoward = POSIX::nexttoward($x, $y);
1185 Like L</nextafter>, but potentially more accurate.
1189 This is similar to the C function C<nice()>, for changing
1190 the scheduling preference of the current process. Positive
1191 arguments mean a more polite process, negative values a more
1192 needy process. Normal (non-root) user processes can only change towards
1195 Returns C<undef> on failure.
1199 Not implemented. C<offsetof()> is C-specific, you probably want to see L<perlfunc/pack> instead.
1203 Open a file for reading for writing. This returns file descriptors, not
1204 Perl filehandles. Use C<POSIX::close> to close the file.
1206 Open a file read-only with mode 0666.
1208 $fd = POSIX::open( "foo" );
1210 Open a file for read and write.
1212 $fd = POSIX::open( "foo", &POSIX::O_RDWR );
1214 Open a file for write, with truncation.
1217 "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC
1220 Create a new file with mode 0640. Set up the file for writing.
1223 "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640
1226 Returns C<undef> on failure.
1228 See also L<perlfunc/sysopen>.
1232 Open a directory for reading.
1234 $dir = POSIX::opendir( "/var" );
1235 @files = POSIX::readdir( $dir );
1236 POSIX::closedir( $dir );
1238 Returns C<undef> on failure.
1242 Retrieves the value of a configurable limit on a file or directory.
1244 The following will determine the maximum length of the longest allowable
1245 pathname on the filesystem which holds C</var>.
1247 $path_max = POSIX::pathconf( "/var",
1248 &POSIX::_PC_PATH_MAX );
1250 Returns C<undef> on failure.
1254 This is similar to the C function C<pause()>, which suspends
1255 the execution of the current process until a signal is received.
1257 Returns C<undef> on failure.
1261 This is identical to the C function C<perror()>, which outputs to the
1262 standard error stream the specified message followed by C<": "> and the
1263 current error string. Use the C<warn()> function and the C<$!>
1264 variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
1268 Create an interprocess channel. This returns file descriptors like those
1269 returned by C<POSIX::open>.
1271 my ($read, $write) = POSIX::pipe();
1272 POSIX::write( $write, "hello", 5 );
1273 POSIX::read( $read, $buf, 5 );
1275 See also L<perlfunc/pipe>.
1279 Computes C<$x> raised to the power C<$exponent>.
1281 $ret = POSIX::pow( $x, $exponent );
1283 You can also use the C<**> operator, see L<perlop>.
1287 Formats and prints the specified arguments to C<STDOUT>.
1288 See also L<perlfunc/printf>.
1292 Not implemented. C<putc()> is C-specific, see L<perlfunc/print> instead.
1296 Not implemented. C<putchar()> is C-specific, see L<perlfunc/print> instead.
1300 Not implemented. C<puts()> is C-specific, see L<perlfunc/print> instead.
1304 Not implemented. C<qsort()> is C-specific, see L<perlfunc/sort> instead.
1308 Sends the specified signal to the current process.
1309 See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
1313 Not implemented. C<rand()> is non-portable, see L<perlfunc/rand> instead.
1317 Read from a file. This uses file descriptors such as those obtained by
1318 calling C<POSIX::open>. If the buffer C<$buf> is not large enough for the
1319 read then Perl will extend it to make room for the request.
1321 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1322 $bytes = POSIX::read( $fd, $buf, 3 );
1324 Returns C<undef> on failure.
1326 See also L<perlfunc/sysread>.
1330 This is identical to Perl's builtin C<readdir()> function
1331 for reading directory entries, see L<perlfunc/readdir>.
1335 Not implemented. C<realloc()> is C-specific. Perl does memory management transparently.
1339 Given C<x> and C<y>, returns the value S<C<x - n*y>>, where C<n> is the integer
1340 closest to C<x>/C<y>. [C99]
1342 my $remainder = POSIX::remainder($x, $y)
1344 See also L</remquo>.
1348 This is identical to Perl's builtin C<unlink()> function
1349 for removing files, see L<perlfunc/unlink>.
1353 Like L</remainder> but also returns the low-order bits of the quotient (n)
1356 (This is quite esoteric interface, mainly used to implement numerical
1361 This is identical to Perl's builtin C<rename()> function
1362 for renaming files, see L<perlfunc/rename>.
1366 Seeks to the beginning of the file.
1370 This is identical to Perl's builtin C<rewinddir()> function for
1371 rewinding directory entry streams, see L<perlfunc/rewinddir>.
1375 Identical to L</lrint>.
1379 This is identical to Perl's builtin C<rmdir()> function
1380 for removing (empty) directories, see L<perlfunc/rmdir>.
1384 Returns the integer (but still as floating point) nearest to the
1387 See also L</ceil>, L</floor>, L</lround>, L</modf>, and L</trunc>.
1391 Returns S<C<x * 2**y>> [C99].
1393 See also L</frexp> and L</ldexp>.
1397 Not implemented. C<scanf()> is C-specific, use E<lt>E<gt> and regular expressions instead,
1402 Sets the real group identifier and the effective group identifier for
1403 this process. Similar to assigning a value to the Perl's builtin
1404 C<$)> variable, see L<perlvar/$EGID>, except that the latter
1405 will change only the real user identifier, and that the setgid()
1406 uses only a single numeric argument, as opposed to a space-separated
1411 Not implemented. C<setjmp()> is C-specific: use C<eval {}> instead,
1412 see L<perlfunc/eval>.
1416 WARNING! Do NOT use this function in a L<thread|threads>. The locale
1417 will change in all other threads at the same time, and should your
1418 thread get paused by the operating system, and another started, that
1419 thread will not have the locale it is expecting. On some platforms,
1420 there can be a race leading to segfaults if two threads call this
1421 function nearly simultaneously.
1423 Modifies and queries the program's underlying locale. Users of this
1424 function should read L<perllocale>, whch provides a comprehensive
1425 discussion of Perl locale handling, knowledge of which is necessary to
1426 properly use this function. It contains
1427 L<a section devoted to this function|perllocale/The setlocale function>.
1428 The discussion here is merely a summary reference for C<setlocale()>.
1429 Note that Perl itself is almost entirely unaffected by the locale
1430 except within the scope of S<C<"use locale">>. (Exceptions are listed
1431 in L<perllocale/Not within the scope of "use locale">.)
1433 The following examples assume
1435 use POSIX qw(setlocale LC_ALL LC_CTYPE);
1439 The following will set the traditional UNIX system locale behavior
1440 (the second argument C<"C">).
1442 $loc = setlocale( LC_ALL, "C" );
1444 The following will query the current C<LC_CTYPE> category. (No second
1445 argument means 'query'.)
1447 $loc = setlocale( LC_CTYPE );
1449 The following will set the C<LC_CTYPE> behaviour according to the locale
1450 environment variables (the second argument C<"">).
1451 Please see your system's C<setlocale(3)> documentation for the locale
1452 environment variables' meaning or consult L<perllocale>.
1454 $loc = setlocale( LC_CTYPE, "" );
1456 The following will set the C<LC_COLLATE> behaviour to Argentinian
1457 Spanish. B<NOTE>: The naming and availability of locales depends on
1458 your operating system. Please consult L<perllocale> for how to find
1459 out which locales are available in your system.
1461 $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
1465 use POSIX ':nan_payload';
1466 setpayload($var, $payload);
1468 Sets the C<NaN> payload of var.
1470 NOTE: the NaN payload APIs are based on the latest (as of June 2015)
1471 proposed ISO C interfaces, but they are not yet a standard. Things
1474 See L</nan> for more discussion about C<NaN>.
1476 See also L</setpayloadsig>, L</isnan>, L</getpayload>, and L</issignaling>.
1478 =item C<setpayloadsig>
1480 use POSIX ':nan_payload';
1481 setpayloadsig($var, $payload);
1483 Like L</setpayload> but also makes the NaN I<signaling>.
1485 Depending on the platform the NaN may or may not behave differently.
1487 Note the API instability warning in L</setpayload>.
1489 Note that because how the floating point formats work out, on the most
1490 common platforms signaling payload of zero is best avoided,
1491 since it might end up being identical to C<+Inf>.
1493 See also L</nan>, L</isnan>, L</getpayload>, and L</issignaling>.
1497 This is similar to the C function C<setpgid()> for
1498 setting the process group identifier of the current process.
1500 Returns C<undef> on failure.
1504 This is identical to the C function C<setsid()> for
1505 setting the session identifier of the current process.
1509 Sets the real user identifier and the effective user identifier for
1510 this process. Similar to assigning a value to the Perl's builtin
1511 C<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
1512 will change only the real user identifier.
1516 Detailed signal management. This uses C<POSIX::SigAction> objects for
1517 the C<action> and C<oldaction> arguments (the oldaction can also be
1518 just a hash reference). Consult your system's C<sigaction> manpage
1519 for details, see also C<POSIX::SigRt>.
1523 sigaction(signal, action, oldaction = 0)
1525 Returns C<undef> on failure. The C<signal> must be a number (like
1526 C<SIGHUP>), not a string (like C<"SIGHUP">), though Perl does try hard
1529 If you use the C<SA_SIGINFO> flag, the signal handler will in addition to
1530 the first argument, the signal name, also receive a second argument, a
1531 hash reference, inside which are the following keys with the following
1532 semantics, as defined by POSIX/SUSv3:
1534 signo the signal number
1535 errno the error number
1536 code if this is zero or less, the signal was sent by
1537 a user process and the uid and pid make sense,
1538 otherwise the signal was sent by the kernel
1540 The constants for specific C<code> values can be imported individually
1541 or using the C<:signal_h_si_code> tag.
1543 The following are also defined by POSIX/SUSv3, but unfortunately
1544 not very widely implemented:
1546 pid the process id generating the signal
1547 uid the uid of the process id generating the signal
1548 status exit value or signal for SIGCHLD
1549 band band event for SIGPOLL
1550 addr address of faulting instruction or memory
1551 reference for SIGILL, SIGFPE, SIGSEGV or SIGBUS
1553 A third argument is also passed to the handler, which contains a copy
1554 of the raw binary contents of the C<siginfo> structure: if a system has
1555 some non-POSIX fields, this third argument is where to C<unpack()> them
1558 Note that not all C<siginfo> values make sense simultaneously (some are
1559 valid only for certain signals, for example), and not all values make
1560 sense from Perl perspective, you should to consult your system's
1561 C<sigaction> and possibly also C<siginfo> documentation.
1565 Not implemented. C<siglongjmp()> is C-specific: use L<perlfunc/die> instead.
1569 Returns zero for positive arguments, non-zero for negative arguments [C99].
1573 Examine signals that are blocked and pending. This uses C<POSIX::SigSet>
1574 objects for the C<sigset> argument. Consult your system's C<sigpending>
1575 manpage for details.
1581 Returns C<undef> on failure.
1583 =item C<sigprocmask>
1585 Change and/or examine calling process's signal mask. This uses
1586 C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
1587 Consult your system's C<sigprocmask> manpage for details.
1591 sigprocmask(how, sigset, oldsigset = 0)
1593 Returns C<undef> on failure.
1595 Note that you can't reliably block or unblock a signal from its own signal
1596 handler if you're using safe signals. Other signals can be blocked or unblocked
1601 Not implemented. C<sigsetjmp()> is C-specific: use C<eval {}> instead,
1602 see L<perlfunc/eval>.
1606 Install a signal mask and suspend process until signal arrives. This uses
1607 C<POSIX::SigSet> objects for the C<signal_mask> argument. Consult your
1608 system's C<sigsuspend> manpage for details.
1612 sigsuspend(signal_mask)
1614 Returns C<undef> on failure.
1618 This is identical to Perl's builtin C<sin()> function
1619 for returning the sine of the numerical argument,
1620 see L<perlfunc/sin>. See also L<Math::Trig>.
1624 This is identical to the C function C<sinh()>
1625 for returning the hyperbolic sine of the numerical argument.
1626 See also L<Math::Trig>.
1630 This is functionally identical to Perl's builtin C<sleep()> function
1631 for suspending the execution of the current for process for certain
1632 number of seconds, see L<perlfunc/sleep>. There is one significant
1633 difference, however: C<POSIX::sleep()> returns the number of
1634 B<unslept> seconds, while the C<CORE::sleep()> returns the
1635 number of slept seconds.
1639 This is similar to Perl's builtin C<sprintf()> function
1640 for returning a string that has the arguments formatted as requested,
1641 see L<perlfunc/sprintf>.
1645 This is identical to Perl's builtin C<sqrt()> function.
1646 for returning the square root of the numerical argument,
1647 see L<perlfunc/sqrt>.
1651 Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
1655 Not implemented. C<sscanf()> is C-specific, use regular expressions instead,
1660 This is identical to Perl's builtin C<stat()> function
1661 for returning information about files and directories.
1665 Not implemented. C<strcat()> is C-specific, use C<.=> instead, see L<perlop>.
1669 Not implemented. C<strchr()> is C-specific, see L<perlfunc/index> instead.
1673 Not implemented. C<strcmp()> is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
1677 This is identical to the C function C<strcoll()>
1678 for collating (comparing) strings transformed using
1679 the C<strxfrm()> function. Not really needed since
1680 Perl can do this transparently, see L<perllocale>.
1682 Beware that in a UTF-8 locale, anything you pass to this function must
1683 be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
1688 Not implemented. C<strcpy()> is C-specific, use C<=> instead, see L<perlop>.
1692 Not implemented. C<strcspn()> is C-specific, use regular expressions instead,
1697 Returns the error string for the specified errno.
1698 Identical to the string form of C<$!>, see L<perlvar/$ERRNO>.
1702 Convert date and time information to string. Returns the string.
1706 strftime(fmt, sec, min, hour, mday, mon, year,
1707 wday = -1, yday = -1, isdst = -1)
1709 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1710 I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
1711 year (C<year>) is given in years since 1900, I<i.e.>, the year 1995 is 95; the
1712 year 2001 is 101. Consult your system's C<strftime()> manpage for details
1713 about these and the other arguments.
1715 If you want your code to be portable, your format (C<fmt>) argument
1716 should use only the conversion specifiers defined by the ANSI C
1717 standard (C89, to play safe). These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
1718 But even then, the B<results> of some of the conversion specifiers are
1719 non-portable. For example, the specifiers C<aAbBcpZ> change according
1720 to the locale settings of the user, and both how to set locales (the
1721 locale names) and what output to expect are non-standard.
1722 The specifier C<c> changes according to the timezone settings of the
1723 user and the timezone computation rules of the operating system.
1724 The C<Z> specifier is notoriously unportable since the names of
1725 timezones are non-standard. Sticking to the numeric specifiers is the
1728 The given arguments are made consistent as though by calling
1729 C<mktime()> before calling your system's C<strftime()> function,
1730 except that the C<isdst> value is not affected.
1732 The string for Tuesday, December 12, 1995.
1734 $str = POSIX::strftime( "%A, %B %d, %Y",
1735 0, 0, 0, 12, 11, 95, 2 );
1740 Not implemented. C<strlen()> is C-specific, use C<length()> instead, see L<perlfunc/length>.
1744 Not implemented. C<strncat()> is C-specific, use C<.=> instead, see L<perlop>.
1748 Not implemented. C<strncmp()> is C-specific, use C<eq> instead, see L<perlop>.
1752 Not implemented. C<strncpy()> is C-specific, use C<=> instead, see L<perlop>.
1756 Not implemented. C<strpbrk()> is C-specific, use regular expressions instead,
1761 Not implemented. C<strrchr()> is C-specific, see L<perlfunc/rindex> instead.
1765 Not implemented. C<strspn()> is C-specific, use regular expressions instead,
1770 This is identical to Perl's builtin C<index()> function,
1771 see L<perlfunc/index>.
1775 String to double translation. Returns the parsed number and the number
1776 of characters in the unparsed portion of the string. Truly
1777 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1778 error, so clear C<$!> before calling C<strtod>. However, non-POSIX systems
1779 may not check for overflow, and therefore will never set C<$!>.
1781 C<strtod> respects any POSIX C<setlocale()> C<LC_TIME> settings,
1782 regardless of whether or not it is called from Perl code that is within
1783 the scope of S<C<use locale>>.
1785 To parse a string C<$str> as a floating point number use
1788 ($num, $n_unparsed) = POSIX::strtod($str);
1790 The second returned item and C<$!> can be used to check for valid input:
1792 if (($str eq '') || ($n_unparsed != 0) || $!) {
1793 die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
1796 When called in a scalar context C<strtod> returns the parsed number.
1800 Not implemented. C<strtok()> is C-specific, use regular expressions instead, see
1801 L<perlre>, or L<perlfunc/split>.
1805 String to (long) integer translation. Returns the parsed number and
1806 the number of characters in the unparsed portion of the string. Truly
1807 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1808 error, so clear C<$!> before calling C<strtol>. However, non-POSIX systems
1809 may not check for overflow, and therefore will never set C<$!>.
1811 C<strtol> should respect any POSIX I<setlocale()> settings.
1813 To parse a string C<$str> as a number in some base C<$base> use
1816 ($num, $n_unparsed) = POSIX::strtol($str, $base);
1818 The base should be zero or between 2 and 36, inclusive. When the base
1819 is zero or omitted C<strtol> will use the string itself to determine the
1820 base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
1821 octal; any other leading characters mean decimal. Thus, "1234" is
1822 parsed as a decimal number, "01234" as an octal number, and "0x1234"
1823 as a hexadecimal number.
1825 The second returned item and C<$!> can be used to check for valid input:
1827 if (($str eq '') || ($n_unparsed != 0) || !$!) {
1828 die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1831 When called in a scalar context C<strtol> returns the parsed number.
1835 Like L</strtod> but for long doubles. Defined only if the
1836 system supports long doubles.
1840 String to unsigned (long) integer translation. C<strtoul()> is identical
1841 to C<strtol()> except that C<strtoul()> only parses unsigned integers. See
1842 L</strtol> for details.
1844 Note: Some vendors supply C<strtod()> and C<strtol()> but not C<strtoul()>.
1845 Other vendors that do supply C<strtoul()> parse "-1" as a valid value.
1849 String transformation. Returns the transformed string.
1851 $dst = POSIX::strxfrm( $src );
1853 Used in conjunction with the C<strcoll()> function, see L</strcoll>.
1855 Not really needed since Perl can do this transparently, see
1858 Beware that in a UTF-8 locale, anything you pass to this function must
1859 be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
1864 Retrieves values of system configurable variables.
1866 The following will get the machine's clock speed.
1868 $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1870 Returns C<undef> on failure.
1874 This is identical to Perl's builtin C<system()> function, see
1879 This is identical to the C function C<tan()>, returning the
1880 tangent of the numerical argument. See also L<Math::Trig>.
1884 This is identical to the C function C<tanh()>, returning the
1885 hyperbolic tangent of the numerical argument. See also L<Math::Trig>.
1889 This is similar to the C function C<tcdrain()> for draining
1890 the output queue of its argument stream.
1892 Returns C<undef> on failure.
1896 This is similar to the C function C<tcflow()> for controlling
1897 the flow of its argument stream.
1899 Returns C<undef> on failure.
1903 This is similar to the C function C<tcflush()> for flushing
1904 the I/O buffers of its argument stream.
1906 Returns C<undef> on failure.
1910 This is identical to the C function C<tcgetpgrp()> for returning the
1911 process group identifier of the foreground process group of the controlling
1914 =item C<tcsendbreak>
1916 This is similar to the C function C<tcsendbreak()> for sending
1917 a break on its argument stream.
1919 Returns C<undef> on failure.
1923 This is similar to the C function C<tcsetpgrp()> for setting the
1924 process group identifier of the foreground process group of the controlling
1927 Returns C<undef> on failure.
1931 The Gamma function [C99].
1933 See also L</lgamma>.
1937 This is identical to Perl's builtin C<time()> function
1938 for returning the number of seconds since the epoch
1939 (whatever it is for the system), see L<perlfunc/time>.
1943 The C<times()> function returns elapsed realtime since some point in the past
1944 (such as system startup), user and system times for this process, and user
1945 and system times used by child processes. All times are returned in clock
1948 ($realtime, $user, $system, $cuser, $csystem)
1951 Note: Perl's builtin C<times()> function returns four values, measured in
1956 Not implemented. Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
1960 For security reasons, which are probably detailed in your system's
1961 documentation for the C library C<tmpnam()> function, this interface
1962 is no longer available; instead use L<File::Temp>.
1966 This is identical to the C function, except that it can apply to a single
1967 character or to a whole string, and currently operates as if the locale
1968 always is "C". Consider using the C<lc()> function, see L<perlfunc/lc>,
1969 see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
1974 This is similar to the C function, except that it can apply to a single
1975 character or to a whole string, and currently operates as if the locale
1976 always is "C". Consider using the C<uc()> function, see L<perlfunc/uc>,
1977 or the equivalent C<\U> operator inside doublequotish strings.
1981 Returns the integer toward zero from the argument [C99].
1983 See also L</ceil>, L</floor>, and L</round>.
1987 This is identical to the C function C<ttyname()> for returning the
1988 name of the current terminal.
1992 Retrieves the time conversion information from the C<tzname> variable.
1995 ($std, $dst) = POSIX::tzname();
1999 This is identical to the C function C<tzset()> for setting
2000 the current timezone based on the environment variable C<TZ>,
2001 to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
2006 This is identical to Perl's builtin C<umask()> function
2007 for setting (and querying) the file creation permission mask,
2008 see L<perlfunc/umask>.
2012 Get name of current operating system.
2014 ($sysname, $nodename, $release, $version, $machine)
2017 Note that the actual meanings of the various fields are not
2018 that well standardized, do not expect any great portability.
2019 The C<$sysname> might be the name of the operating system,
2020 the C<$nodename> might be the name of the host, the C<$release>
2021 might be the (major) release number of the operating system,
2022 the C<$version> might be the (minor) release number of the
2023 operating system, and the C<$machine> might be a hardware identifier.
2028 Not implemented. Use method C<IO::Handle::ungetc()> instead.
2032 This is identical to Perl's builtin C<unlink()> function
2033 for removing files, see L<perlfunc/unlink>.
2037 This is identical to Perl's builtin C<utime()> function
2038 for changing the time stamps of files and directories,
2039 see L<perlfunc/utime>.
2043 Not implemented. C<vfprintf()> is C-specific, see L<perlfunc/printf> instead.
2047 Not implemented. C<vprintf()> is C-specific, see L<perlfunc/printf> instead.
2051 Not implemented. C<vsprintf()> is C-specific, see L<perlfunc/sprintf> instead.
2055 This is identical to Perl's builtin C<wait()> function,
2056 see L<perlfunc/wait>.
2060 Wait for a child process to change state. This is identical to Perl's
2061 builtin C<waitpid()> function, see L<perlfunc/waitpid>.
2063 $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
2064 print "status = ", ($? / 256), "\n";
2068 This is identical to the C function C<wcstombs()>.
2074 This is identical to the C function C<wctomb()>.
2080 Write to a file. This uses file descriptors such as those obtained by
2081 calling C<POSIX::open>.
2083 $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
2085 $bytes = POSIX::write( $fd, $buf, 5 );
2087 Returns C<undef> on failure.
2089 See also L<perlfunc/syswrite>.
2095 =head2 C<POSIX::SigAction>
2101 Creates a new C<POSIX::SigAction> object which corresponds to the C
2102 C<struct sigaction>. This object will be destroyed automatically when
2103 it is no longer needed. The first parameter is the handler, a sub
2104 reference. The second parameter is a C<POSIX::SigSet> object, it
2105 defaults to the empty set. The third parameter contains the
2106 C<sa_flags>, it defaults to 0.
2108 $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
2109 $sigaction = POSIX::SigAction->new(
2110 \&handler, $sigset, &POSIX::SA_NOCLDSTOP
2113 This C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
2126 accessor functions to get/set the values of a SigAction object.
2128 $sigset = $sigaction->mask;
2129 $sigaction->flags(&POSIX::SA_RESTART);
2133 accessor function for the "safe signals" flag of a SigAction object; see
2134 L<perlipc> for general information on safe (a.k.a. "deferred") signals. If
2135 you wish to handle a signal safely, use this accessor to set the "safe" flag
2136 in the C<POSIX::SigAction> object:
2138 $sigaction->safe(1);
2140 You may also examine the "safe" flag on the output action object which is
2141 filled in when given as the third parameter to C<POSIX::sigaction()>:
2143 sigaction(SIGINT, $new_action, $old_action);
2144 if ($old_action->safe) {
2145 # previous SIGINT handler used safe signals
2150 =head2 C<POSIX::SigRt>
2156 A hash of the POSIX realtime signal handlers. It is an extension of
2157 the standard C<%SIG>, the C<$POSIX::SIGRT{SIGRTMIN}> is roughly equivalent
2158 to C<$SIG{SIGRTMIN}>, but the right POSIX moves (see below) are made with
2159 the C<POSIX::SigSet> and C<POSIX::sigaction> instead of accessing the C<%SIG>.
2161 You can set the C<%POSIX::SIGRT> elements to set the POSIX realtime
2162 signal handlers, use C<delete> and C<exists> on the elements, and use
2163 C<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
2164 signals there are available S<C<(SIGRTMAX - SIGRTMIN + 1>>, the C<SIGRTMAX> is
2165 a valid POSIX realtime signal).
2167 Setting the C<%SIGRT> elements is equivalent to calling this:
2170 my ($rtsig, $handler, $flags) = @_;
2171 my $sigset = POSIX::SigSet($rtsig);
2172 my $sigact = POSIX::SigAction->new($handler,$sigset,$flags);
2173 sigaction($rtsig, $sigact);
2176 The flags default to zero, if you want something different you can
2177 either use C<local> on C<$POSIX::SigRt::SIGACTION_FLAGS>, or you can
2178 derive from POSIX::SigRt and define your own C<new()> (the tied hash
2179 STORE method of the C<%SIGRT> calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
2180 where the C<$rtsig> ranges from zero to S<C<SIGRTMAX - SIGRTMIN + 1)>>.
2182 Just as with any signal, you can use C<sigaction($rtsig, undef, $oa)> to
2183 retrieve the installed signal handler (or, rather, the signal action).
2185 B<NOTE:> whether POSIX realtime signals really work in your system, or
2186 whether Perl has been compiled so that it works with them, is outside
2191 Return the minimum POSIX realtime signal number available, or C<undef>
2192 if no POSIX realtime signals are available.
2196 Return the maximum POSIX realtime signal number available, or C<undef>
2197 if no POSIX realtime signals are available.
2201 =head2 C<POSIX::SigSet>
2207 Create a new SigSet object. This object will be destroyed automatically
2208 when it is no longer needed. Arguments may be supplied to initialize the
2211 Create an empty set.
2213 $sigset = POSIX::SigSet->new;
2215 Create a set with C<SIGUSR1>.
2217 $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
2221 Add a signal to a SigSet object.
2223 $sigset->addset( &POSIX::SIGUSR2 );
2225 Returns C<undef> on failure.
2229 Remove a signal from the SigSet object.
2231 $sigset->delset( &POSIX::SIGUSR2 );
2233 Returns C<undef> on failure.
2237 Initialize the SigSet object to be empty.
2239 $sigset->emptyset();
2241 Returns C<undef> on failure.
2245 Initialize the SigSet object to include all signals.
2249 Returns C<undef> on failure.
2253 Tests the SigSet object to see if it contains a specific signal.
2255 if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
2256 print "contains SIGUSR1\n";
2261 =head2 C<POSIX::Termios>
2267 Create a new Termios object. This object will be destroyed automatically
2268 when it is no longer needed. A Termios object corresponds to the C<termios>
2269 C struct. C<new()> mallocs a new one, C<getattr()> fills it from a file descriptor,
2270 and C<setattr()> sets a file descriptor's parameters to match Termios' contents.
2272 $termios = POSIX::Termios->new;
2276 Get terminal control attributes.
2278 Obtain the attributes for C<stdin>.
2280 $termios->getattr( 0 ) # Recommended for clarity.
2283 Obtain the attributes for stdout.
2285 $termios->getattr( 1 )
2287 Returns C<undef> on failure.
2291 Retrieve a value from the C<c_cc> field of a C<termios> object. The C<c_cc> field is
2292 an array so an index must be specified.
2294 $c_cc[1] = $termios->getcc(1);
2298 Retrieve the C<c_cflag> field of a C<termios> object.
2300 $c_cflag = $termios->getcflag;
2304 Retrieve the C<c_iflag> field of a C<termios> object.
2306 $c_iflag = $termios->getiflag;
2310 Retrieve the input baud rate.
2312 $ispeed = $termios->getispeed;
2316 Retrieve the C<c_lflag> field of a C<termios> object.
2318 $c_lflag = $termios->getlflag;
2322 Retrieve the C<c_oflag> field of a C<termios> object.
2324 $c_oflag = $termios->getoflag;
2328 Retrieve the output baud rate.
2330 $ospeed = $termios->getospeed;
2334 Set terminal control attributes.
2336 Set attributes immediately for stdout.
2338 $termios->setattr( 1, &POSIX::TCSANOW );
2340 Returns C<undef> on failure.
2344 Set a value in the C<c_cc> field of a C<termios> object. The C<c_cc> field is an
2345 array so an index must be specified.
2347 $termios->setcc( &POSIX::VEOF, 1 );
2351 Set the C<c_cflag> field of a C<termios> object.
2353 $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
2357 Set the C<c_iflag> field of a C<termios> object.
2359 $termios->setiflag( $c_iflag | &POSIX::BRKINT );
2363 Set the input baud rate.
2365 $termios->setispeed( &POSIX::B9600 );
2367 Returns C<undef> on failure.
2371 Set the C<c_lflag> field of a C<termios> object.
2373 $termios->setlflag( $c_lflag | &POSIX::ECHO );
2377 Set the C<c_oflag> field of a C<termios> object.
2379 $termios->setoflag( $c_oflag | &POSIX::OPOST );
2383 Set the output baud rate.
2385 $termios->setospeed( &POSIX::B9600 );
2387 Returns C<undef> on failure.
2389 =item Baud rate values
2391 C<B38400> C<B75> C<B200> C<B134> C<B300> C<B1800> C<B150> C<B0> C<B19200> C<B1200> C<B9600> C<B600> C<B4800> C<B50> C<B2400> C<B110>
2393 =item Terminal interface values
2395 C<TCSADRAIN> C<TCSANOW> C<TCOON> C<TCIOFLUSH> C<TCOFLUSH> C<TCION> C<TCIFLUSH> C<TCSAFLUSH> C<TCIOFF> C<TCOOFF>
2397 =item C<c_cc> field values
2399 C<VEOF> C<VEOL> C<VERASE> C<VINTR> C<VKILL> C<VQUIT> C<VSUSP> C<VSTART> C<VSTOP> C<VMIN> C<VTIME> C<NCCS>
2401 =item C<c_cflag> field values
2403 C<CLOCAL> C<CREAD> C<CSIZE> C<CS5> C<CS6> C<CS7> C<CS8> C<CSTOPB> C<HUPCL> C<PARENB> C<PARODD>
2405 =item C<c_iflag> field values
2407 C<BRKINT> C<ICRNL> C<IGNBRK> C<IGNCR> C<IGNPAR> C<INLCR> C<INPCK> C<ISTRIP> C<IXOFF> C<IXON> C<PARMRK>
2409 =item C<c_lflag> field values
2411 C<ECHO> C<ECHOE> C<ECHOK> C<ECHONL> C<ICANON> C<IEXTEN> C<ISIG> C<NOFLSH> C<TOSTOP>
2413 =item C<c_oflag> field values
2419 =head1 PATHNAME CONSTANTS
2425 C<_PC_CHOWN_RESTRICTED> C<_PC_LINK_MAX> C<_PC_MAX_CANON> C<_PC_MAX_INPUT> C<_PC_NAME_MAX>
2426 C<_PC_NO_TRUNC> C<_PC_PATH_MAX> C<_PC_PIPE_BUF> C<_PC_VDISABLE>
2430 =head1 POSIX CONSTANTS
2436 C<_POSIX_ARG_MAX> C<_POSIX_CHILD_MAX> C<_POSIX_CHOWN_RESTRICTED> C<_POSIX_JOB_CONTROL>
2437 C<_POSIX_LINK_MAX> C<_POSIX_MAX_CANON> C<_POSIX_MAX_INPUT> C<_POSIX_NAME_MAX>
2438 C<_POSIX_NGROUPS_MAX> C<_POSIX_NO_TRUNC> C<_POSIX_OPEN_MAX> C<_POSIX_PATH_MAX>
2439 C<_POSIX_PIPE_BUF> C<_POSIX_SAVED_IDS> C<_POSIX_SSIZE_MAX> C<_POSIX_STREAM_MAX>
2440 C<_POSIX_TZNAME_MAX> C<_POSIX_VDISABLE> C<_POSIX_VERSION>
2444 =head1 SYSTEM CONFIGURATION
2450 C<_SC_ARG_MAX> C<_SC_CHILD_MAX> C<_SC_CLK_TCK> C<_SC_JOB_CONTROL> C<_SC_NGROUPS_MAX>
2451 C<_SC_OPEN_MAX> C<_SC_PAGESIZE> C<_SC_SAVED_IDS> C<_SC_STREAM_MAX> C<_SC_TZNAME_MAX>
2462 C<E2BIG> C<EACCES> C<EADDRINUSE> C<EADDRNOTAVAIL> C<EAFNOSUPPORT> C<EAGAIN> C<EALREADY> C<EBADF> C<EBADMSG>
2463 C<EBUSY> C<ECANCELED> C<ECHILD> C<ECONNABORTED> C<ECONNREFUSED> C<ECONNRESET> C<EDEADLK> C<EDESTADDRREQ>
2464 C<EDOM> C<EDQUOT> C<EEXIST> C<EFAULT> C<EFBIG> C<EHOSTDOWN> C<EHOSTUNREACH> C<EIDRM> C<EILSEQ> C<EINPROGRESS>
2465 C<EINTR> C<EINVAL> C<EIO> C<EISCONN> C<EISDIR> C<ELOOP> C<EMFILE> C<EMLINK> C<EMSGSIZE> C<ENAMETOOLONG>
2466 C<ENETDOWN> C<ENETRESET> C<ENETUNREACH> C<ENFILE> C<ENOBUFS> C<ENODATA> C<ENODEV> C<ENOENT> C<ENOEXEC>
2467 C<ENOLCK> C<ENOLINK> C<ENOMEM> C<ENOMSG> C<ENOPROTOOPT> C<ENOSPC> C<ENOSR> C<ENOSTR> C<ENOSYS> C<ENOTBLK>
2468 C<ENOTCONN> C<ENOTDIR> C<ENOTEMPTY> C<ENOTRECOVERABLE> C<ENOTSOCK> C<ENOTSUP> C<ENOTTY> C<ENXIO>
2469 C<EOPNOTSUPP> C<EOTHER> C<EOVERFLOW> C<EOWNERDEAD> C<EPERM> C<EPFNOSUPPORT> C<EPIPE> C<EPROCLIM> C<EPROTO>
2470 C<EPROTONOSUPPORT> C<EPROTOTYPE> C<ERANGE> C<EREMOTE> C<ERESTART> C<EROFS> C<ESHUTDOWN>
2471 C<ESOCKTNOSUPPORT> C<ESPIPE> C<ESRCH> C<ESTALE> C<ETIME> C<ETIMEDOUT> C<ETOOMANYREFS> C<ETXTBSY> C<EUSERS>
2472 C<EWOULDBLOCK> C<EXDEV>
2482 C<FD_CLOEXEC> C<F_DUPFD> C<F_GETFD> C<F_GETFL> C<F_GETLK> C<F_OK> C<F_RDLCK> C<F_SETFD> C<F_SETFL> C<F_SETLK>
2483 C<F_SETLKW> C<F_UNLCK> C<F_WRLCK> C<O_ACCMODE> C<O_APPEND> C<O_CREAT> C<O_EXCL> C<O_NOCTTY> C<O_NONBLOCK>
2484 C<O_RDONLY> C<O_RDWR> C<O_TRUNC> C<O_WRONLY>
2494 C<DBL_DIG> C<DBL_EPSILON> C<DBL_MANT_DIG> C<DBL_MAX> C<DBL_MAX_10_EXP> C<DBL_MAX_EXP> C<DBL_MIN>
2495 C<DBL_MIN_10_EXP> C<DBL_MIN_EXP> C<FLT_DIG> C<FLT_EPSILON> C<FLT_MANT_DIG> C<FLT_MAX>
2496 C<FLT_MAX_10_EXP> C<FLT_MAX_EXP> C<FLT_MIN> C<FLT_MIN_10_EXP> C<FLT_MIN_EXP> C<FLT_RADIX>
2497 C<FLT_ROUNDS> C<LDBL_DIG> C<LDBL_EPSILON> C<LDBL_MANT_DIG> C<LDBL_MAX> C<LDBL_MAX_10_EXP>
2498 C<LDBL_MAX_EXP> C<LDBL_MIN> C<LDBL_MIN_10_EXP> C<LDBL_MIN_EXP>
2502 =head1 FLOATING-POINT ENVIRONMENT
2508 C<FE_DOWNWARD> C<FE_TONEAREST> C<FE_TOWARDZERO> C<FE_UPWARD>
2509 on systems that support them.
2519 C<ARG_MAX> C<CHAR_BIT> C<CHAR_MAX> C<CHAR_MIN> C<CHILD_MAX> C<INT_MAX> C<INT_MIN> C<LINK_MAX> C<LONG_MAX>
2520 C<LONG_MIN> C<MAX_CANON> C<MAX_INPUT> C<MB_LEN_MAX> C<NAME_MAX> C<NGROUPS_MAX> C<OPEN_MAX> C<PATH_MAX>
2521 C<PIPE_BUF> C<SCHAR_MAX> C<SCHAR_MIN> C<SHRT_MAX> C<SHRT_MIN> C<SSIZE_MAX> C<STREAM_MAX> C<TZNAME_MAX>
2522 C<UCHAR_MAX> C<UINT_MAX> C<ULONG_MAX> C<USHRT_MAX>
2532 C<LC_ALL> C<LC_COLLATE> C<LC_CTYPE> C<LC_MONETARY> C<LC_NUMERIC> C<LC_TIME> C<LC_MESSAGES>
2533 on systems that support them.
2545 C<FP_ILOGB0> C<FP_ILOGBNAN> C<FP_INFINITE> C<FP_NAN> C<FP_NORMAL> C<FP_SUBNORMAL> C<FP_ZERO>
2546 C<INFINITY> C<NAN> C<Inf> C<NaN>
2547 C<M_1_PI> C<M_2_PI> C<M_2_SQRTPI> C<M_E> C<M_LN10> C<M_LN2> C<M_LOG10E> C<M_LOG2E> C<M_PI>
2548 C<M_PI_2> C<M_PI_4> C<M_SQRT1_2> C<M_SQRT2>
2549 on systems with C99 support.
2559 C<SA_NOCLDSTOP> C<SA_NOCLDWAIT> C<SA_NODEFER> C<SA_ONSTACK> C<SA_RESETHAND> C<SA_RESTART>
2560 C<SA_SIGINFO> C<SIGABRT> C<SIGALRM> C<SIGCHLD> C<SIGCONT> C<SIGFPE> C<SIGHUP> C<SIGILL> C<SIGINT>
2561 C<SIGKILL> C<SIGPIPE> C<SIGQUIT> C<SIGSEGV> C<SIGSTOP> C<SIGTERM> C<SIGTSTP> C<SIGTTIN> C<SIGTTOU>
2562 C<SIGUSR1> C<SIGUSR2> C<SIG_BLOCK> C<SIG_DFL> C<SIG_ERR> C<SIG_IGN> C<SIG_SETMASK>
2564 C<ILL_ILLOPC> C<ILL_ILLOPN> C<ILL_ILLADR> C<ILL_ILLTRP> C<ILL_PRVOPC> C<ILL_PRVREG> C<ILL_COPROC>
2565 C<ILL_BADSTK> C<FPE_INTDIV> C<FPE_INTOVF> C<FPE_FLTDIV> C<FPE_FLTOVF> C<FPE_FLTUND> C<FPE_FLTRES>
2566 C<FPE_FLTINV> C<FPE_FLTSUB> C<SEGV_MAPERR> C<SEGV_ACCERR> C<BUS_ADRALN> C<BUS_ADRERR>
2567 C<BUS_OBJERR> C<TRAP_BRKPT> C<TRAP_TRACE> C<CLD_EXITED> C<CLD_KILLED> C<CLD_DUMPED> C<CLD_TRAPPED>
2568 C<CLD_STOPPED> C<CLD_CONTINUED> C<POLL_IN> C<POLL_OUT> C<POLL_MSG> C<POLL_ERR> C<POLL_PRI>
2569 C<POLL_HUP> C<SI_USER> C<SI_QUEUE> C<SI_TIMER> C<SI_ASYNCIO> C<SI_MESGQ>
2579 C<S_IRGRP> C<S_IROTH> C<S_IRUSR> C<S_IRWXG> C<S_IRWXO> C<S_IRWXU> C<S_ISGID> C<S_ISUID> C<S_IWGRP> C<S_IWOTH>
2580 C<S_IWUSR> C<S_IXGRP> C<S_IXOTH> C<S_IXUSR>
2584 C<S_ISBLK> C<S_ISCHR> C<S_ISDIR> C<S_ISFIFO> C<S_ISREG>
2594 C<EXIT_FAILURE> C<EXIT_SUCCESS> C<MB_CUR_MAX> C<RAND_MAX>
2604 C<BUFSIZ> C<EOF> C<FILENAME_MAX> C<L_ctermid> C<L_cuserid> C<TMP_MAX>
2614 C<CLK_TCK> C<CLOCKS_PER_SEC>
2624 C<R_OK> C<SEEK_CUR> C<SEEK_END> C<SEEK_SET> C<STDIN_FILENO> C<STDOUT_FILENO> C<STDERR_FILENO> C<W_OK> C<X_OK>
2634 C<WNOHANG> C<WUNTRACED>
2640 Do not suspend the calling process until a child process
2641 changes state but instead return immediately.
2645 Catch stopped child processes.
2651 C<WIFEXITED> C<WEXITSTATUS> C<WIFSIGNALED> C<WTERMSIG> C<WIFSTOPPED> C<WSTOPSIG>
2657 C<WIFEXITED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2658 exited normally (C<exit()> or by falling off the end of C<main()>)
2660 =item C<WEXITSTATUS>
2662 C<WEXITSTATUS(${^CHILD_ERROR_NATIVE})> returns the normal exit status of
2663 the child process (only meaningful if C<WIFEXITED(${^CHILD_ERROR_NATIVE})>
2666 =item C<WIFSIGNALED>
2668 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2669 terminated because of a signal
2673 C<WTERMSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2674 terminated for (only meaningful if
2675 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})>
2680 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})> returns true if the child process is
2681 currently stopped (can happen only if you specified the WUNTRACED flag
2686 C<WSTOPSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2687 was stopped for (only meaningful if
2688 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})>
2703 C<WSAEINTR> C<WSAEBADF> C<WSAEACCES> C<WSAEFAULT> C<WSAEINVAL> C<WSAEMFILE> C<WSAEWOULDBLOCK>
2704 C<WSAEINPROGRESS> C<WSAEALREADY> C<WSAENOTSOCK> C<WSAEDESTADDRREQ> C<WSAEMSGSIZE>
2705 C<WSAEPROTOTYPE> C<WSAENOPROTOOPT> C<WSAEPROTONOSUPPORT> C<WSAESOCKTNOSUPPORT>
2706 C<WSAEOPNOTSUPP> C<WSAEPFNOSUPPORT> C<WSAEAFNOSUPPORT> C<WSAEADDRINUSE>
2707 C<WSAEADDRNOTAVAIL> C<WSAENETDOWN> C<WSAENETUNREACH> C<WSAENETRESET> C<WSAECONNABORTED>
2708 C<WSAECONNRESET> C<WSAENOBUFS> C<WSAEISCONN> C<WSAENOTCONN> C<WSAESHUTDOWN>
2709 C<WSAETOOMANYREFS> C<WSAETIMEDOUT> C<WSAECONNREFUSED> C<WSAELOOP> C<WSAENAMETOOLONG>
2710 C<WSAEHOSTDOWN> C<WSAEHOSTUNREACH> C<WSAENOTEMPTY> C<WSAEPROCLIM> C<WSAEUSERS>
2711 C<WSAEDQUOT> C<WSAESTALE> C<WSAEREMOTE> C<WSAEDISCON> C<WSAENOMORE> C<WSAECANCELLED>
2712 C<WSAEINVALIDPROCTABLE> C<WSAEINVALIDPROVIDER> C<WSAEPROVIDERFAILEDINIT>