diff options
Diffstat (limited to 'upstream/mageia-cauldron/man3pm/POSIX.3pm')
-rw-r--r-- | upstream/mageia-cauldron/man3pm/POSIX.3pm | 3060 |
1 files changed, 3060 insertions, 0 deletions
diff --git a/upstream/mageia-cauldron/man3pm/POSIX.3pm b/upstream/mageia-cauldron/man3pm/POSIX.3pm new file mode 100644 index 00000000..7b40914f --- /dev/null +++ b/upstream/mageia-cauldron/man3pm/POSIX.3pm @@ -0,0 +1,3060 @@ +.\" -*- mode: troff; coding: utf-8 -*- +.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. +.ie n \{\ +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" ======================================================================== +.\" +.IX Title "POSIX 3pm" +.TH POSIX 3pm 2023-11-28 "perl v5.38.2" "Perl Programmers Reference Guide" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH NAME +POSIX \- Perl interface to IEEE Std 1003.1 +.SH SYNOPSIS +.IX Header "SYNOPSIS" +.Vb 3 +\& use POSIX (); +\& use POSIX qw(setsid); +\& use POSIX qw(:errno_h :fcntl_h); +\& +\& printf "EINTR is %d\en", EINTR; +\& +\& my $sess_id = POSIX::setsid(); +\& +\& my $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644); +\& # note: that\*(Aqs a filedescriptor, *NOT* a filehandle +.Ve +.SH DESCRIPTION +.IX Header "DESCRIPTION" +The POSIX module permits you to access all (or nearly all) the standard +POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish +interfaces. +.PP +This document gives a condensed list of the features available in the POSIX +module. Consult your operating system's manpages for general information on +most features. Consult perlfunc for functions which are noted as being +identical or almost identical to Perl's builtin functions. +.PP +The first section describes POSIX functions from the 1003.1 specification. +The second section describes some classes for signal objects, TTY objects, +and other miscellaneous objects. The remaining sections list various +constants and macros in an organization which roughly follows IEEE Std +1003.1b\-1993. +.PP +The notation \f(CW\*(C`[C99]\*(C'\fR indicates functions that were added in the ISO/IEC +9899:1999 version of the C language standard. Some may not be available +on your system if it adheres to an earlier standard. Attempts to use +any missing one will result in a fatal runtime error message. +.SH CAVEATS +.IX Header "CAVEATS" +\&\fIEverything is exported by default\fR (with a handful of exceptions). +This is an unfortunate backwards compatibility feature and its use is +\&\fBstrongly discouraged\fR. +You should either prevent the exporting (by saying \f(CW\*(C`use\ POSIX\ ();\*(C'\fR, +as usual) and then use fully qualified names (e.g. \f(CW\*(C`POSIX::SEEK_END\*(C'\fR), +or give an explicit import list. +If you do neither and opt for the default (as in \f(CW\*(C`use\ POSIX;\*(C'\fR), you +will import \fIhundreds and hundreds\fR of symbols into your namespace. +.PP +A few functions are not implemented because they are C specific. If you +attempt to call these, they will print a message telling you that they +aren't implemented, and suggest using the Perl equivalent, should one +exist. For example, trying to access the \f(CWsetjmp()\fR call will elicit the +message "\f(CW\*(C`setjmp() is C\-specific: use eval {} instead\*(C'\fR". +.PP +Furthermore, some evil vendors will claim 1003.1 compliance, but in fact +are not so: they will not pass the PCTS (POSIX Compliance Test Suites). +For example, one vendor may not define \f(CW\*(C`EDEADLK\*(C'\fR, or the semantics of the +errno values set by \f(CWopen(2)\fR might not be quite right. Perl does not +attempt to verify POSIX compliance. That means you can currently +successfully say "use POSIX", and then later in your program you find +that your vendor has been lax and there's no usable \f(CW\*(C`ICANON\*(C'\fR macro after +all. This could be construed to be a bug. +.SH FUNCTIONS +.IX Header "FUNCTIONS" +.ie n .IP """_exit""" 8 +.el .IP \f(CW_exit\fR 8 +.IX Item "_exit" +This is identical to the C function \f(CW_exit()\fR. It exits the program +immediately which means among other things buffered I/O is \fBnot\fR flushed. +.Sp +Note that when using threads and in Linux this is \fBnot\fR a good way to +exit a thread because in Linux processes and threads are kind of the +same thing (Note: while this is the situation in early 2003 there are +projects under way to have threads with more POSIXly semantics in Linux). +If you want not to return from a thread, detach the thread. +.ie n .IP """abort""" 8 +.el .IP \f(CWabort\fR 8 +.IX Item "abort" +This is identical to the C function \f(CWabort()\fR. It terminates the +process with a \f(CW\*(C`SIGABRT\*(C'\fR signal unless caught by a signal handler or +if the handler does not return normally (it e.g. does a \f(CW\*(C`longjmp\*(C'\fR). +.ie n .IP """abs""" 8 +.el .IP \f(CWabs\fR 8 +.IX Item "abs" +This is identical to Perl's builtin \f(CWabs()\fR function, returning the absolute +value of its numerical argument (except that \f(CWPOSIX::abs()\fR must be provided +an explicit value (rather than relying on an implicit \f(CW$_\fR): +.Sp +.Vb 1 +\& $absolute_value = POSIX::abs(42); # good +\& +\& $absolute_value = POSIX::abs(); # throws exception +.Ve +.ie n .IP """access""" 8 +.el .IP \f(CWaccess\fR 8 +.IX Item "access" +Determines the accessibility of a file. +.Sp +.Vb 3 +\& if( POSIX::access( "/", &POSIX::R_OK ) ){ +\& print "have read permission\en"; +\& } +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. Note: do not use \f(CWaccess()\fR for +security purposes. Between the \f(CWaccess()\fR call and the operation +you are preparing for the permissions might change: a classic +\&\fIrace condition\fR. +.ie n .IP """acos""" 8 +.el .IP \f(CWacos\fR 8 +.IX Item "acos" +This is identical to the C function \f(CWacos()\fR, returning +the arcus cosine of its numerical argument. See also Math::Trig. +.ie n .IP """acosh""" 8 +.el .IP \f(CWacosh\fR 8 +.IX Item "acosh" +This is identical to the C function \f(CWacosh()\fR, returning the +hyperbolic arcus cosine of its numerical argument [C99]. See also +Math::Trig. Added in Perl v5.22. +.ie n .IP """alarm""" 8 +.el .IP \f(CWalarm\fR 8 +.IX Item "alarm" +This is identical to Perl's builtin \f(CWalarm()\fR function, either for arming or +disarming the \f(CW\*(C`SIGARLM\*(C'\fR timer, except that \f(CWPOSIX::alarm()\fR must be provided +an explicit value (rather than relying on an implicit \f(CW$_\fR): +.Sp +.Vb 1 +\& POSIX::alarm(3) # good +\& +\& POSIX::alarm() # throws exception +.Ve +.ie n .IP """asctime""" 8 +.el .IP \f(CWasctime\fR 8 +.IX Item "asctime" +This is identical to the C function \f(CWasctime()\fR. It returns +a string of the form +.Sp +.Vb 1 +\& "Fri Jun 2 18:22:13 2000\en\e0" +.Ve +.Sp +and it is called thusly +.Sp +.Vb 2 +\& $asctime = asctime($sec, $min, $hour, $mday, $mon, +\& $year, $wday, $yday, $isdst); +.Ve +.Sp +The \f(CW$mon\fR is zero-based: January equals \f(CW0\fR. The \f(CW$year\fR is +1900\-based: 2001 equals \f(CW101\fR. \f(CW$wday\fR and \f(CW$yday\fR default to zero +(and are usually ignored anyway), and \f(CW$isdst\fR defaults to \-1. +.Sp +Note the result is always in English. Use \f(CW"strftime"\fR instead to +get a result suitable for the current locale. That function's \f(CW%c\fR +format yields the locale's preferred representation. +.ie n .IP """asin""" 8 +.el .IP \f(CWasin\fR 8 +.IX Item "asin" +This is identical to the C function \f(CWasin()\fR, returning +the arcus sine of its numerical argument. See also Math::Trig. +.ie n .IP """asinh""" 8 +.el .IP \f(CWasinh\fR 8 +.IX Item "asinh" +This is identical to the C function \f(CWasinh()\fR, returning the +hyperbolic arcus sine of its numerical argument [C99]. See also +Math::Trig. Added in Perl v5.22. +.ie n .IP """assert""" 8 +.el .IP \f(CWassert\fR 8 +.IX Item "assert" +Unimplemented, but you can use "die" in perlfunc and the Carp module +to achieve similar things. +.ie n .IP """atan""" 8 +.el .IP \f(CWatan\fR 8 +.IX Item "atan" +This is identical to the C function \f(CWatan()\fR, returning the +arcus tangent of its numerical argument. See also Math::Trig. +.ie n .IP """atanh""" 8 +.el .IP \f(CWatanh\fR 8 +.IX Item "atanh" +This is identical to the C function \f(CWatanh()\fR, returning the +hyperbolic arcus tangent of its numerical argument [C99]. See also +Math::Trig. Added in Perl v5.22. +.ie n .IP """atan2""" 8 +.el .IP \f(CWatan2\fR 8 +.IX Item "atan2" +This is identical to Perl's builtin \f(CWatan2()\fR function, returning +the arcus tangent defined by its two numerical arguments, the \fIy\fR +coordinate and the \fIx\fR coordinate. See also Math::Trig. +.ie n .IP """atexit""" 8 +.el .IP \f(CWatexit\fR 8 +.IX Item "atexit" +Not implemented. \f(CWatexit()\fR is C\-specific: use \f(CW\*(C`END {}\*(C'\fR instead, see perlmod. +.ie n .IP """atof""" 8 +.el .IP \f(CWatof\fR 8 +.IX Item "atof" +Not implemented. \f(CWatof()\fR is C\-specific. Perl converts strings to numbers transparently. +If you need to force a scalar to a number, add a zero to it. +.ie n .IP """atoi""" 8 +.el .IP \f(CWatoi\fR 8 +.IX Item "atoi" +Not implemented. \f(CWatoi()\fR is C\-specific. Perl converts strings to numbers transparently. +If you need to force a scalar to a number, add a zero to it. +If you need to have just the integer part, see "int" in perlfunc. +.ie n .IP """atol""" 8 +.el .IP \f(CWatol\fR 8 +.IX Item "atol" +Not implemented. \f(CWatol()\fR is C\-specific. Perl converts strings to numbers transparently. +If you need to force a scalar to a number, add a zero to it. +If you need to have just the integer part, see "int" in perlfunc. +.ie n .IP """bsearch""" 8 +.el .IP \f(CWbsearch\fR 8 +.IX Item "bsearch" +\&\f(CWbsearch()\fR not supplied. For doing binary search on wordlists, +see Search::Dict. +.ie n .IP """calloc""" 8 +.el .IP \f(CWcalloc\fR 8 +.IX Item "calloc" +Not implemented. \f(CWcalloc()\fR is C\-specific. Perl does memory management transparently. +.ie n .IP """cbrt""" 8 +.el .IP \f(CWcbrt\fR 8 +.IX Item "cbrt" +The cube root [C99]. Added in Perl v5.22. +.ie n .IP """ceil""" 8 +.el .IP \f(CWceil\fR 8 +.IX Item "ceil" +This is identical to the C function \f(CWceil()\fR, returning the smallest +integer value greater than or equal to the given numerical argument. +.ie n .IP """chdir""" 8 +.el .IP \f(CWchdir\fR 8 +.IX Item "chdir" +This is identical to Perl's builtin \f(CWchdir()\fR function, allowing one to +change the working (default) directory \-\- see "chdir" in perlfunc \-\- with the +exception that \f(CWPOSIX::chdir()\fR must be provided an explicit value (rather +than relying on an implicit \f(CW$_\fR): +.Sp +.Vb 1 +\& $rv = POSIX::chdir(\*(Aqpath/to/dir\*(Aq); # good +\& +\& $rv = POSIX::chdir(); # throws exception +.Ve +.ie n .IP """chmod""" 8 +.el .IP \f(CWchmod\fR 8 +.IX Item "chmod" +This is identical to Perl's builtin \f(CWchmod()\fR function, allowing +one to change file and directory permissions \-\- see "chmod" in perlfunc \-\- with +the exception that \f(CWPOSIX::chmod()\fR can only change one file at a time +(rather than a list of files): +.Sp +.Vb 1 +\& $c = chmod 0664, $file1, $file2; # good +\& +\& $c = POSIX::chmod 0664, $file1; # throws exception +\& +\& $c = POSIX::chmod 0664, $file1, $file2; # throws exception +.Ve +.Sp +As with the built-in \f(CWchmod()\fR, \f(CW$file\fR may be a filename or a file +handle. +.ie n .IP """chown""" 8 +.el .IP \f(CWchown\fR 8 +.IX Item "chown" +This is identical to Perl's builtin \f(CWchown()\fR function, allowing one +to change file and directory owners and groups, see "chown" in perlfunc. +.ie n .IP """clearerr""" 8 +.el .IP \f(CWclearerr\fR 8 +.IX Item "clearerr" +Not implemented. Use the method \f(CWIO::Handle::clearerr()\fR instead, to reset the error +state (if any) and EOF state (if any) of the given stream. +.ie n .IP """clock""" 8 +.el .IP \f(CWclock\fR 8 +.IX Item "clock" +This is identical to the C function \f(CWclock()\fR, returning the +amount of spent processor time in microseconds. +.ie n .IP """close""" 8 +.el .IP \f(CWclose\fR 8 +.IX Item "close" +Close the file. This uses file descriptors such as those obtained by calling +\&\f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +.Vb 2 +\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY ); +\& POSIX::close( $fd ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.Sp +See also "close" in perlfunc. +.ie n .IP """closedir""" 8 +.el .IP \f(CWclosedir\fR 8 +.IX Item "closedir" +This is identical to Perl's builtin \f(CWclosedir()\fR function for closing +a directory handle, see "closedir" in perlfunc. +.ie n .IP """cos""" 8 +.el .IP \f(CWcos\fR 8 +.IX Item "cos" +This is identical to Perl's builtin \f(CWcos()\fR function, for returning +the cosine of its numerical argument, see "cos" in perlfunc. +See also Math::Trig. +.ie n .IP """cosh""" 8 +.el .IP \f(CWcosh\fR 8 +.IX Item "cosh" +This is identical to the C function \f(CWcosh()\fR, for returning +the hyperbolic cosine of its numeric argument. See also Math::Trig. +.ie n .IP """copysign""" 8 +.el .IP \f(CWcopysign\fR 8 +.IX Item "copysign" +Returns \f(CW\*(C`x\*(C'\fR but with the sign of \f(CW\*(C`y\*(C'\fR [C99]. Added in Perl v5.22. +.Sp +.Vb 1 +\& $x_with_sign_of_y = POSIX::copysign($x, $y); +.Ve +.Sp +See also "signbit". +.ie n .IP """creat""" 8 +.el .IP \f(CWcreat\fR 8 +.IX Item "creat" +Create a new file. This returns a file descriptor like the ones returned by +\&\f(CW\*(C`POSIX::open\*(C'\fR. Use \f(CW\*(C`POSIX::close\*(C'\fR to close the file. +.Sp +.Vb 2 +\& $fd = POSIX::creat( "foo", 0611 ); +\& POSIX::close( $fd ); +.Ve +.Sp +See also "sysopen" in perlfunc and its \f(CW\*(C`O_CREAT\*(C'\fR flag. +.ie n .IP """ctermid""" 8 +.el .IP \f(CWctermid\fR 8 +.IX Item "ctermid" +Generates the path name for the controlling terminal. +.Sp +.Vb 1 +\& $path = POSIX::ctermid(); +.Ve +.ie n .IP """ctime""" 8 +.el .IP \f(CWctime\fR 8 +.IX Item "ctime" +This is identical to the C function \f(CWctime()\fR and equivalent +to \f(CW\*(C`asctime(localtime(...))\*(C'\fR, see "asctime" and "localtime". +.ie n .IP """cuserid"" [POSIX.1\-1988]" 8 +.el .IP "\f(CWcuserid\fR [POSIX.1\-1988]" 8 +.IX Item "cuserid [POSIX.1-1988]" +Get the login name of the owner of the current process. +.Sp +.Vb 1 +\& $name = POSIX::cuserid(); +.Ve +.Sp +Note: this function has not been specified by POSIX since 1990 and is included +only for backwards compatibility. New code should use \f(CWgetlogin()\fR instead. +.ie n .IP """difftime""" 8 +.el .IP \f(CWdifftime\fR 8 +.IX Item "difftime" +This is identical to the C function \f(CWdifftime()\fR, for returning +the time difference (in seconds) between two times (as returned +by \f(CWtime()\fR), see "time". +.ie n .IP """div""" 8 +.el .IP \f(CWdiv\fR 8 +.IX Item "div" +Not implemented. \f(CWdiv()\fR is C\-specific, use "int" in perlfunc on the usual \f(CW\*(C`/\*(C'\fR division and +the modulus \f(CW\*(C`%\*(C'\fR. +.ie n .IP """dup""" 8 +.el .IP \f(CWdup\fR 8 +.IX Item "dup" +This is similar to the C function \f(CWdup()\fR, for duplicating a file +descriptor. +.Sp +This uses file descriptors such as those obtained by calling +\&\f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """dup2""" 8 +.el .IP \f(CWdup2\fR 8 +.IX Item "dup2" +This is similar to the C function \f(CWdup2()\fR, for duplicating a file +descriptor to an another known file descriptor. +.Sp +This uses file descriptors such as those obtained by calling +\&\f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """erf""" 8 +.el .IP \f(CWerf\fR 8 +.IX Item "erf" +The error function [C99]. Added in Perl v5.22. +.ie n .IP """erfc""" 8 +.el .IP \f(CWerfc\fR 8 +.IX Item "erfc" +The complementary error function [C99]. Added in Perl v5.22. +.ie n .IP """errno""" 8 +.el .IP \f(CWerrno\fR 8 +.IX Item "errno" +Returns the value of errno. +.Sp +.Vb 1 +\& $errno = POSIX::errno(); +.Ve +.Sp +This identical to the numerical values of the \f(CW$!\fR, see "$ERRNO" in perlvar. +.ie n .IP """execl""" 8 +.el .IP \f(CWexecl\fR 8 +.IX Item "execl" +Not implemented. \f(CWexecl()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """execle""" 8 +.el .IP \f(CWexecle\fR 8 +.IX Item "execle" +Not implemented. \f(CWexecle()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """execlp""" 8 +.el .IP \f(CWexeclp\fR 8 +.IX Item "execlp" +Not implemented. \f(CWexeclp()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """execv""" 8 +.el .IP \f(CWexecv\fR 8 +.IX Item "execv" +Not implemented. \f(CWexecv()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """execve""" 8 +.el .IP \f(CWexecve\fR 8 +.IX Item "execve" +Not implemented. \f(CWexecve()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """execvp""" 8 +.el .IP \f(CWexecvp\fR 8 +.IX Item "execvp" +Not implemented. \f(CWexecvp()\fR is C\-specific, see "exec" in perlfunc. +.ie n .IP """exit""" 8 +.el .IP \f(CWexit\fR 8 +.IX Item "exit" +This is identical to Perl's builtin \f(CWexit()\fR function for exiting the +program, see "exit" in perlfunc. +.ie n .IP """exp""" 8 +.el .IP \f(CWexp\fR 8 +.IX Item "exp" +This is identical to Perl's builtin \f(CWexp()\fR function for +returning the exponent (\fIe\fR\-based) of the numerical argument, +see "exp" in perlfunc. +.ie n .IP """expm1""" 8 +.el .IP \f(CWexpm1\fR 8 +.IX Item "expm1" +Equivalent to \f(CW\*(C`exp(x) \- 1\*(C'\fR, but more precise for small argument values [C99]. +Added in Perl v5.22. +.Sp +See also "log1p". +.ie n .IP """fabs""" 8 +.el .IP \f(CWfabs\fR 8 +.IX Item "fabs" +This is identical to Perl's builtin \f(CWabs()\fR function for returning +the absolute value of the numerical argument, see "abs" in perlfunc. +.ie n .IP """fclose""" 8 +.el .IP \f(CWfclose\fR 8 +.IX Item "fclose" +Not implemented. Use method \f(CWIO::Handle::close()\fR instead, or see "close" in perlfunc. +.ie n .IP """fcntl""" 8 +.el .IP \f(CWfcntl\fR 8 +.IX Item "fcntl" +This is identical to Perl's builtin \f(CWfcntl()\fR function, +see "fcntl" in perlfunc. +.ie n .IP """fdopen""" 8 +.el .IP \f(CWfdopen\fR 8 +.IX Item "fdopen" +Not implemented. Use method \f(CWIO::Handle::new_from_fd()\fR instead, or see "open" in perlfunc. +.ie n .IP """feof""" 8 +.el .IP \f(CWfeof\fR 8 +.IX Item "feof" +Not implemented. Use method \f(CWIO::Handle::eof()\fR instead, or see "eof" in perlfunc. +.ie n .IP """ferror""" 8 +.el .IP \f(CWferror\fR 8 +.IX Item "ferror" +Not implemented. Use method \f(CWIO::Handle::error()\fR instead. +.ie n .IP """fflush""" 8 +.el .IP \f(CWfflush\fR 8 +.IX Item "fflush" +Not implemented. Use method \f(CWIO::Handle::flush()\fR instead. +See also \f(CW\*(C`"$OUTPUT_AUTOFLUSH" in perlvar\*(C'\fR. +.ie n .IP """fgetc""" 8 +.el .IP \f(CWfgetc\fR 8 +.IX Item "fgetc" +Not implemented. Use method \f(CWIO::Handle::getc()\fR instead, or see "read" in perlfunc. +.ie n .IP """fgetpos""" 8 +.el .IP \f(CWfgetpos\fR 8 +.IX Item "fgetpos" +Not implemented. Use method \f(CWIO::Seekable::getpos()\fR instead, or see "seek" in perlfunc. +.ie n .IP """fgets""" 8 +.el .IP \f(CWfgets\fR 8 +.IX Item "fgets" +Not implemented. Use method \f(CWIO::Handle::gets()\fR instead. Similar to <>, also known +as "readline" in perlfunc. +.ie n .IP """fileno""" 8 +.el .IP \f(CWfileno\fR 8 +.IX Item "fileno" +Not implemented. Use method \f(CWIO::Handle::fileno()\fR instead, or see "fileno" in perlfunc. +.ie n .IP """floor""" 8 +.el .IP \f(CWfloor\fR 8 +.IX Item "floor" +This is identical to the C function \f(CWfloor()\fR, returning the largest +integer value less than or equal to the numerical argument. +.ie n .IP """fdim""" 8 +.el .IP \f(CWfdim\fR 8 +.IX Item "fdim" +"Positive difference", \f(CW\*(C`x\ \-\ y\*(C'\fR if \f(CW\*(C`x\ >\ y\*(C'\fR, zero otherwise [C99]. +Added in Perl v5.22. +.ie n .IP """fegetround""" 8 +.el .IP \f(CWfegetround\fR 8 +.IX Item "fegetround" +Returns the current floating point rounding mode, one of +.Sp +.Vb 1 +\& FE_TONEAREST FE_TOWARDZERO FE_UPWARD FE_DOWNWARD +.Ve +.Sp +\&\f(CW\*(C`FE_TONEAREST\*(C'\fR is like "round", \f(CW\*(C`FE_TOWARDZERO\*(C'\fR is like "trunc" [C99]. +Added in Perl v5.22. +.ie n .IP """fesetround""" 8 +.el .IP \f(CWfesetround\fR 8 +.IX Item "fesetround" +Sets the floating point rounding mode, see "fegetround" [C99]. Added in +Perl v5.22. +.ie n .IP """fma""" 8 +.el .IP \f(CWfma\fR 8 +.IX Item "fma" +"Fused multiply-add", \f(CW\*(C`x\ *\ y\ +\ z\*(C'\fR, possibly faster (and less lossy) +than the explicit two operations [C99]. Added in Perl v5.22. +.Sp +.Vb 1 +\& my $fused = POSIX::fma($x, $y, $z); +.Ve +.ie n .IP """fmax""" 8 +.el .IP \f(CWfmax\fR 8 +.IX Item "fmax" +Maximum of \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR, except when either is \f(CW\*(C`NaN\*(C'\fR, returns the other [C99]. +Added in Perl v5.22. +.Sp +.Vb 1 +\& my $max = POSIX::fmax($x, $y); +.Ve +.ie n .IP """fmin""" 8 +.el .IP \f(CWfmin\fR 8 +.IX Item "fmin" +Minimum of \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR, except when either is \f(CW\*(C`NaN\*(C'\fR, returns the other [C99]. +Added in Perl v5.22. +.Sp +.Vb 1 +\& my $min = POSIX::fmin($x, $y); +.Ve +.ie n .IP """fmod""" 8 +.el .IP \f(CWfmod\fR 8 +.IX Item "fmod" +This is identical to the C function \f(CWfmod()\fR. +.Sp +.Vb 1 +\& $r = fmod($x, $y); +.Ve +.Sp +It returns the remainder \f(CW\*(C`$r\ =\ $x\ \-\ $n*$y\*(C'\fR, where \f(CW\*(C`$n\ =\ trunc($x/$y)\*(C'\fR. +The \f(CW$r\fR has the same sign as \f(CW$x\fR and magnitude (absolute value) +less than the magnitude of \f(CW$y\fR. +.ie n .IP """fopen""" 8 +.el .IP \f(CWfopen\fR 8 +.IX Item "fopen" +Not implemented. Use method \f(CWIO::File::open()\fR instead, or see "open" in perlfunc. +.ie n .IP """fork""" 8 +.el .IP \f(CWfork\fR 8 +.IX Item "fork" +This is identical to Perl's builtin \f(CWfork()\fR function +for duplicating the current process, see "fork" in perlfunc +and perlfork if you are in Windows. +.ie n .IP """fpathconf""" 8 +.el .IP \f(CWfpathconf\fR 8 +.IX Item "fpathconf" +Retrieves the value of a configurable limit on a file or directory. This +uses file descriptors such as those obtained by calling \f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +The following will determine the maximum length of the longest allowable +pathname on the filesystem which holds \fI/var/foo\fR. +.Sp +.Vb 2 +\& $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY ); +\& $path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """fpclassify""" 8 +.el .IP \f(CWfpclassify\fR 8 +.IX Item "fpclassify" +Returns one of +.Sp +.Vb 1 +\& FP_NORMAL FP_ZERO FP_SUBNORMAL FP_INFINITE FP_NAN +.Ve +.Sp +telling the class of the argument [C99]. \f(CW\*(C`FP_INFINITE\*(C'\fR is positive +or negative infinity, \f(CW\*(C`FP_NAN\*(C'\fR is not-a-number. \f(CW\*(C`FP_SUBNORMAL\*(C'\fR +means subnormal numbers (also known as denormals), very small numbers +with low precision. \f(CW\*(C`FP_ZERO\*(C'\fR is zero. \f(CW\*(C`FP_NORMAL\*(C'\fR is all the rest. +Added in Perl v5.22. +.ie n .IP """fprintf""" 8 +.el .IP \f(CWfprintf\fR 8 +.IX Item "fprintf" +Not implemented. \f(CWfprintf()\fR is C\-specific, see "printf" in perlfunc instead. +.ie n .IP """fputc""" 8 +.el .IP \f(CWfputc\fR 8 +.IX Item "fputc" +Not implemented. \f(CWfputc()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """fputs""" 8 +.el .IP \f(CWfputs\fR 8 +.IX Item "fputs" +Not implemented. \f(CWfputs()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """fread""" 8 +.el .IP \f(CWfread\fR 8 +.IX Item "fread" +Not implemented. \f(CWfread()\fR is C\-specific, see "read" in perlfunc instead. +.ie n .IP """free""" 8 +.el .IP \f(CWfree\fR 8 +.IX Item "free" +Not implemented. \f(CWfree()\fR is C\-specific. Perl does memory management transparently. +.ie n .IP """freopen""" 8 +.el .IP \f(CWfreopen\fR 8 +.IX Item "freopen" +Not implemented. \f(CWfreopen()\fR is C\-specific, see "open" in perlfunc instead. +.ie n .IP """frexp""" 8 +.el .IP \f(CWfrexp\fR 8 +.IX Item "frexp" +Return the mantissa and exponent of a floating-point number. +.Sp +.Vb 1 +\& ($mantissa, $exponent) = POSIX::frexp( 1.234e56 ); +.Ve +.ie n .IP """fscanf""" 8 +.el .IP \f(CWfscanf\fR 8 +.IX Item "fscanf" +Not implemented. \f(CWfscanf()\fR is C\-specific, use <> and regular expressions instead. +.ie n .IP """fseek""" 8 +.el .IP \f(CWfseek\fR 8 +.IX Item "fseek" +Not implemented. Use method \f(CWIO::Seekable::seek()\fR instead, or see "seek" in perlfunc. +.ie n .IP """fsetpos""" 8 +.el .IP \f(CWfsetpos\fR 8 +.IX Item "fsetpos" +Not implemented. Use method \f(CWIO::Seekable::setpos()\fR instead, or seek "seek" in perlfunc. +.ie n .IP """fstat""" 8 +.el .IP \f(CWfstat\fR 8 +.IX Item "fstat" +Get file status. This uses file descriptors such as those obtained by +calling \f(CW\*(C`POSIX::open\*(C'\fR. The data returned is identical to the data from +Perl's builtin \f(CW\*(C`stat\*(C'\fR function. +.Sp +.Vb 2 +\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY ); +\& @stats = POSIX::fstat( $fd ); +.Ve +.ie n .IP """fsync""" 8 +.el .IP \f(CWfsync\fR 8 +.IX Item "fsync" +Not implemented. Use method \f(CWIO::Handle::sync()\fR instead. +.ie n .IP """ftell""" 8 +.el .IP \f(CWftell\fR 8 +.IX Item "ftell" +Not implemented. Use method \f(CWIO::Seekable::tell()\fR instead, or see "tell" in perlfunc. +.ie n .IP """fwrite""" 8 +.el .IP \f(CWfwrite\fR 8 +.IX Item "fwrite" +Not implemented. \f(CWfwrite()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """getc""" 8 +.el .IP \f(CWgetc\fR 8 +.IX Item "getc" +This is identical to Perl's builtin \f(CWgetc()\fR function, +see "getc" in perlfunc. +.ie n .IP """getchar""" 8 +.el .IP \f(CWgetchar\fR 8 +.IX Item "getchar" +Returns one character from STDIN. Identical to Perl's \f(CWgetc()\fR, +see "getc" in perlfunc. +.ie n .IP """getcwd""" 8 +.el .IP \f(CWgetcwd\fR 8 +.IX Item "getcwd" +Returns the name of the current working directory. +See also Cwd. +.ie n .IP """getegid""" 8 +.el .IP \f(CWgetegid\fR 8 +.IX Item "getegid" +Returns the effective group identifier. Similar to Perl' s builtin +variable \f(CW$(\fR, see "$EGID" in perlvar. +.ie n .IP """getenv""" 8 +.el .IP \f(CWgetenv\fR 8 +.IX Item "getenv" +Returns the value of the specified environment variable. +The same information is available through the \f(CW%ENV\fR array. +.ie n .IP """geteuid""" 8 +.el .IP \f(CWgeteuid\fR 8 +.IX Item "geteuid" +Returns the effective user identifier. Identical to Perl's builtin \f(CW$>\fR +variable, see "$EUID" in perlvar. +.ie n .IP """getgid""" 8 +.el .IP \f(CWgetgid\fR 8 +.IX Item "getgid" +Returns the user's real group identifier. Similar to Perl's builtin +variable \f(CW$)\fR, see "$GID" in perlvar. +.ie n .IP """getgrgid""" 8 +.el .IP \f(CWgetgrgid\fR 8 +.IX Item "getgrgid" +This is identical to Perl's builtin \f(CWgetgrgid()\fR function for +returning group entries by group identifiers, see +"getgrgid" in perlfunc. +.ie n .IP """getgrnam""" 8 +.el .IP \f(CWgetgrnam\fR 8 +.IX Item "getgrnam" +This is identical to Perl's builtin \f(CWgetgrnam()\fR function for +returning group entries by group names, see "getgrnam" in perlfunc. +.ie n .IP """getgroups""" 8 +.el .IP \f(CWgetgroups\fR 8 +.IX Item "getgroups" +Returns the ids of the user's supplementary groups. Similar to Perl's +builtin variable \f(CW$)\fR, see "$GID" in perlvar. +.ie n .IP """getlogin""" 8 +.el .IP \f(CWgetlogin\fR 8 +.IX Item "getlogin" +This is identical to Perl's builtin \f(CWgetlogin()\fR function for +returning the user name associated with the current session, see +"getlogin" in perlfunc. +.ie n .IP """getpayload""" 8 +.el .IP \f(CWgetpayload\fR 8 +.IX Item "getpayload" +.Vb 2 +\& use POSIX \*(Aq:nan_payload\*(Aq; +\& getpayload($var) +.Ve +.Sp +Returns the \f(CW\*(C`NaN\*(C'\fR payload. Added in Perl v5.24. +.Sp +Note the API instability warning in "setpayload". +.Sp +See "nan" for more discussion about \f(CW\*(C`NaN\*(C'\fR. +.ie n .IP """getpgrp""" 8 +.el .IP \f(CWgetpgrp\fR 8 +.IX Item "getpgrp" +This is identical to Perl's builtin \f(CWgetpgrp()\fR function for +returning the process group identifier of the current process, see +"getpgrp" in perlfunc. +.ie n .IP """getpid""" 8 +.el .IP \f(CWgetpid\fR 8 +.IX Item "getpid" +Returns the process identifier. Identical to Perl's builtin +variable \f(CW$$\fR, see "$PID" in perlvar. +.ie n .IP """getppid""" 8 +.el .IP \f(CWgetppid\fR 8 +.IX Item "getppid" +This is identical to Perl's builtin \f(CWgetppid()\fR function for +returning the process identifier of the parent process of the current +process , see "getppid" in perlfunc. +.ie n .IP """getpwnam""" 8 +.el .IP \f(CWgetpwnam\fR 8 +.IX Item "getpwnam" +This is identical to Perl's builtin \f(CWgetpwnam()\fR function for +returning user entries by user names, see "getpwnam" in perlfunc. +.ie n .IP """getpwuid""" 8 +.el .IP \f(CWgetpwuid\fR 8 +.IX Item "getpwuid" +This is identical to Perl's builtin \f(CWgetpwuid()\fR function for +returning user entries by user identifiers, see "getpwuid" in perlfunc. +.ie n .IP """gets""" 8 +.el .IP \f(CWgets\fR 8 +.IX Item "gets" +Returns one line from \f(CW\*(C`STDIN\*(C'\fR, similar to <>, also known +as the \f(CWreadline()\fR function, see "readline" in perlfunc. +.Sp +\&\fBNOTE\fR: if you have C programs that still use \f(CWgets()\fR, be very +afraid. The \f(CWgets()\fR function is a source of endless grief because +it has no buffer overrun checks. It should \fBnever\fR be used. The +\&\f(CWfgets()\fR function should be preferred instead. +.ie n .IP """getuid""" 8 +.el .IP \f(CWgetuid\fR 8 +.IX Item "getuid" +Returns the user's identifier. Identical to Perl's builtin \f(CW$<\fR variable, +see "$UID" in perlvar. +.ie n .IP """gmtime""" 8 +.el .IP \f(CWgmtime\fR 8 +.IX Item "gmtime" +This is identical to Perl's builtin \f(CWgmtime()\fR function for +converting seconds since the epoch to a date in Greenwich Mean Time, +see "gmtime" in perlfunc. +.ie n .IP """hypot""" 8 +.el .IP \f(CWhypot\fR 8 +.IX Item "hypot" +Equivalent to \f(CWsqrt(x\ *\ x\ +\ y\ *\ y)\fR except more stable on very large +or very small arguments [C99]. Added in Perl v5.22. +.ie n .IP """ilogb""" 8 +.el .IP \f(CWilogb\fR 8 +.IX Item "ilogb" +Integer binary logarithm [C99]. Added in Perl v5.22. +.Sp +For example \f(CWilogb(20)\fR is 4, as an integer. +.Sp +See also "logb". +.ie n .IP """Inf""" 8 +.el .IP \f(CWInf\fR 8 +.IX Item "Inf" +The infinity as a constant: +.Sp +.Vb 3 +\& use POSIX qw(Inf); +\& my $pos_inf = +Inf; # Or just Inf. +\& my $neg_inf = \-Inf; +.Ve +.Sp +See also "isinf", and "fpclassify". +.ie n .IP """isalnum""" 8 +.el .IP \f(CWisalnum\fR 8 +.IX Item "isalnum" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:alnum:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isalpha""" 8 +.el .IP \f(CWisalpha\fR 8 +.IX Item "isalpha" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:alpha:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isatty""" 8 +.el .IP \f(CWisatty\fR 8 +.IX Item "isatty" +Returns a boolean indicating whether the specified filehandle is connected +to a tty. Similar to the \f(CW\*(C`\-t\*(C'\fR operator, see "\-X" in perlfunc. +.ie n .IP """iscntrl""" 8 +.el .IP \f(CWiscntrl\fR 8 +.IX Item "iscntrl" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:cntrl:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isdigit""" 8 +.el .IP \f(CWisdigit\fR 8 +.IX Item "isdigit" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:digit:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isfinite""" 8 +.el .IP \f(CWisfinite\fR 8 +.IX Item "isfinite" +Returns true if the argument is a finite number (that is, not an +infinity, or the not-a-number) [C99]. Added in Perl v5.22. +.Sp +See also "isinf", "isnan", and "fpclassify". +.ie n .IP """isgraph""" 8 +.el .IP \f(CWisgraph\fR 8 +.IX Item "isgraph" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:graph:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isgreater""" 8 +.el .IP \f(CWisgreater\fR 8 +.IX Item "isgreater" +(Also \f(CW\*(C`isgreaterequal\*(C'\fR, \f(CW\*(C`isless\*(C'\fR, \f(CW\*(C`islessequal\*(C'\fR, \f(CW\*(C`islessgreater\*(C'\fR, +\&\f(CW\*(C`isunordered\*(C'\fR) +.Sp +Floating point comparisons which handle the \f(CW\*(C`NaN\*(C'\fR [C99]. Added in Perl +v5.22. +.ie n .IP """isinf""" 8 +.el .IP \f(CWisinf\fR 8 +.IX Item "isinf" +Returns true if the argument is an infinity (positive or negative) [C99]. +Added in Perl v5.22. +.Sp +See also "Inf", "isnan", "isfinite", and "fpclassify". +.ie n .IP """islower""" 8 +.el .IP \f(CWislower\fR 8 +.IX Item "islower" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:lower:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isnan""" 8 +.el .IP \f(CWisnan\fR 8 +.IX Item "isnan" +Returns true if the argument is \f(CW\*(C`NaN\*(C'\fR (not-a-number) [C99]. Added in +Perl v5.22. +.Sp +Note that you can also test for "\f(CW\*(C`NaN\*(C'\fR\-ness" with +equality operators (\f(CW\*(C`==\*(C'\fR or \f(CW\*(C`!=\*(C'\fR), as in +.Sp +.Vb 1 +\& print "x is not a NaN\en" if $x == $x; +.Ve +.Sp +since the \f(CW\*(C`NaN\*(C'\fR is not equal to anything, \fBincluding itself\fR. +.Sp +See also "nan", "NaN", "isinf", and "fpclassify". +.ie n .IP """isnormal""" 8 +.el .IP \f(CWisnormal\fR 8 +.IX Item "isnormal" +Returns true if the argument is normal (that is, not a subnormal/denormal, +and not an infinity, or a not-a-number) [C99]. Added in Perl v5.22. +.Sp +See also "isfinite", and "fpclassify". +.ie n .IP """isprint""" 8 +.el .IP \f(CWisprint\fR 8 +.IX Item "isprint" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:print:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """ispunct""" 8 +.el .IP \f(CWispunct\fR 8 +.IX Item "ispunct" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:punct:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """issignaling""" 8 +.el .IP \f(CWissignaling\fR 8 +.IX Item "issignaling" +.Vb 2 +\& use POSIX \*(Aq:nan_payload\*(Aq; +\& issignaling($var, $payload) +.Ve +.Sp +Return true if the argument is a \fIsignaling\fR NaN. Added in Perl v5.24. +.Sp +Note the API instability warning in "setpayload". +.Sp +See "nan" for more discussion about \f(CW\*(C`NaN\*(C'\fR. +.ie n .IP """isspace""" 8 +.el .IP \f(CWisspace\fR 8 +.IX Item "isspace" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:space:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isupper""" 8 +.el .IP \f(CWisupper\fR 8 +.IX Item "isupper" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:upper:]]+\ $\ /x\*(C'\fR, which you should convert +to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """isxdigit""" 8 +.el .IP \f(CWisxdigit\fR 8 +.IX Item "isxdigit" +This function has been removed as of Perl v5.24. It was very similar to +matching against \f(CW\*(C`qr/\ ^\ [[:xdigit:]]+\ $\ /x\*(C'\fR, which you should +convert to use instead. See "POSIX Character Classes" in perlrecharclass. +.ie n .IP """j0""" 8 +.el .IP \f(CWj0\fR 8 +.IX Item "j0" +.PD 0 +.ie n .IP """j1""" 8 +.el .IP \f(CWj1\fR 8 +.IX Item "j1" +.ie n .IP """jn""" 8 +.el .IP \f(CWjn\fR 8 +.IX Item "jn" +.ie n .IP """y0""" 8 +.el .IP \f(CWy0\fR 8 +.IX Item "y0" +.ie n .IP """y1""" 8 +.el .IP \f(CWy1\fR 8 +.IX Item "y1" +.ie n .IP """yn""" 8 +.el .IP \f(CWyn\fR 8 +.IX Item "yn" +.PD +The Bessel function of the first kind of the order zero. +.ie n .IP """kill""" 8 +.el .IP \f(CWkill\fR 8 +.IX Item "kill" +This is identical to Perl's builtin \f(CWkill()\fR function for sending +signals to processes (often to terminate them), see "kill" in perlfunc. +.ie n .IP """labs""" 8 +.el .IP \f(CWlabs\fR 8 +.IX Item "labs" +Not implemented. (For returning absolute values of long integers.) +\&\f(CWlabs()\fR is C\-specific, see "abs" in perlfunc instead. +.ie n .IP """lchown""" 8 +.el .IP \f(CWlchown\fR 8 +.IX Item "lchown" +This is identical to the C function, except the order of arguments is +consistent with Perl's builtin \f(CWchown()\fR with the added restriction +of only one path, not a list of paths. Does the same thing as the +\&\f(CWchown()\fR function but changes the owner of a symbolic link instead +of the file the symbolic link points to. +.Sp +.Vb 1 +\& POSIX::lchown($uid, $gid, $file_path); +.Ve +.ie n .IP """ldexp""" 8 +.el .IP \f(CWldexp\fR 8 +.IX Item "ldexp" +This is identical to the C function \f(CWldexp()\fR +for multiplying floating point numbers with powers of two. +.Sp +.Vb 1 +\& $x_quadrupled = POSIX::ldexp($x, 2); +.Ve +.ie n .IP """ldiv""" 8 +.el .IP \f(CWldiv\fR 8 +.IX Item "ldiv" +Not implemented. (For computing dividends of long integers.) +\&\f(CWldiv()\fR is C\-specific, use \f(CW\*(C`/\*(C'\fR and \f(CWint()\fR instead. +.ie n .IP """lgamma""" 8 +.el .IP \f(CWlgamma\fR 8 +.IX Item "lgamma" +The logarithm of the Gamma function [C99]. Added in Perl v5.22. +.Sp +See also "tgamma". +.ie n .IP """log1p""" 8 +.el .IP \f(CWlog1p\fR 8 +.IX Item "log1p" +Equivalent to \f(CW\*(C`log(1\ +\ x)\*(C'\fR, but more stable results for small argument +values [C99]. Added in Perl v5.22. +.ie n .IP """log2""" 8 +.el .IP \f(CWlog2\fR 8 +.IX Item "log2" +Logarithm base two [C99]. Added in Perl v5.22. +.Sp +See also "expm1". +.ie n .IP """logb""" 8 +.el .IP \f(CWlogb\fR 8 +.IX Item "logb" +Integer binary logarithm [C99]. Added in Perl v5.22. +.Sp +For example \f(CWlogb(20)\fR is 4, as a floating point number. +.Sp +See also "ilogb". +.ie n .IP """link""" 8 +.el .IP \f(CWlink\fR 8 +.IX Item "link" +This is identical to Perl's builtin \f(CWlink()\fR function +for creating hard links into files, see "link" in perlfunc. +.ie n .IP """localeconv""" 8 +.el .IP \f(CWlocaleconv\fR 8 +.IX Item "localeconv" +Get numeric formatting information. Returns a reference to a hash +containing the formatting values of the locale that currently underlies +the program, regardless of whether or not it is called from within the +scope of a \f(CW\*(C`use\ locale\*(C'\fR. Users of this function should also read +perllocale, which provides a comprehensive discussion of Perl locale +handling, including +a section devoted to this function. +Prior to Perl 5.28, or when operating in a non thread-safe environment, +it should not be used in a threaded application unless it's certain that +the underlying locale is C or POSIX. This is because it otherwise +changes the locale, which globally affects all threads simultaneously. +Windows platforms starting with Visual Studio 2005 are mostly +thread-safe, but use of this function in those prior to Visual Studio +2015 can have a race with a thread that has called +"switch_to_global_locale" in perlapi. +.Sp +Here is how to query the database for the \fBde\fR (Deutsch or German) locale. +.Sp +.Vb 10 +\& my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" ); +\& print "Locale: \e"$loc\e"\en"; +\& my $lconv = POSIX::localeconv(); +\& foreach my $property (qw( +\& decimal_point +\& thousands_sep +\& grouping +\& int_curr_symbol +\& currency_symbol +\& mon_decimal_point +\& mon_thousands_sep +\& mon_grouping +\& positive_sign +\& negative_sign +\& int_frac_digits +\& frac_digits +\& p_cs_precedes +\& p_sep_by_space +\& n_cs_precedes +\& n_sep_by_space +\& p_sign_posn +\& n_sign_posn +\& int_p_cs_precedes +\& int_p_sep_by_space +\& int_n_cs_precedes +\& int_n_sep_by_space +\& int_p_sign_posn +\& int_n_sign_posn +\& )) +\& { +\& printf qq(%s: "%s",\en), +\& $property, $lconv\->{$property}; +\& } +.Ve +.Sp +The members whose names begin with \f(CW\*(C`int_p_\*(C'\fR and \f(CW\*(C`int_n_\*(C'\fR were added by +POSIX.1\-2008 and are only available on systems that support them. +.Sp +A value of \-1 returned for numeric entries indicates that the field is +not applicable to the locale. This is rare except in the C and related +locales, which don't have most monetary values defined. It can also +happen, quirkily, in fields that are otherwise boolean to indicate that +the value is kind of neither true nor false. This happens in \f(CW\*(C`p_cs_precedes\*(C'\fR +and \f(CW\*(C`int_p_cs_precedes\*(C'\fR when the currency symbol neither precedes nor +succeeds a positive value but is infixed, by replacing the radix +character. +.Sp +Prior to Perl v5.37.7, empty string fields and numeric fields with value +\&\-1 were omittted from the returned hash. +.ie n .IP """localtime""" 8 +.el .IP \f(CWlocaltime\fR 8 +.IX Item "localtime" +This is identical to Perl's builtin \f(CWlocaltime()\fR function for +converting seconds since the epoch to a date see "localtime" in perlfunc except +that \f(CWPOSIX::localtime()\fR must be provided an explicit value (rather than +relying on an implicit \f(CW$_\fR): +.Sp +.Vb 1 +\& @localtime = POSIX::localtime(time); # good +\& +\& @localtime = localtime(); # good +\& +\& @localtime = POSIX::localtime(); # throws exception +.Ve +.ie n .IP """log""" 8 +.el .IP \f(CWlog\fR 8 +.IX Item "log" +This is identical to Perl's builtin \f(CWlog()\fR function, +returning the natural (\fIe\fR\-based) logarithm of the numerical argument, +see "log" in perlfunc. +.ie n .IP """log10""" 8 +.el .IP \f(CWlog10\fR 8 +.IX Item "log10" +This is identical to the C function \f(CWlog10()\fR, +returning the 10\-base logarithm of the numerical argument. +You can also use +.Sp +.Vb 1 +\& sub log10 { log($_[0]) / log(10) } +.Ve +.Sp +or +.Sp +.Vb 1 +\& sub log10 { log($_[0]) / 2.30258509299405 } +.Ve +.Sp +or +.Sp +.Vb 1 +\& sub log10 { log($_[0]) * 0.434294481903252 } +.Ve +.ie n .IP """longjmp""" 8 +.el .IP \f(CWlongjmp\fR 8 +.IX Item "longjmp" +Not implemented. \f(CWlongjmp()\fR is C\-specific: use "die" in perlfunc instead. +.ie n .IP """lseek""" 8 +.el .IP \f(CWlseek\fR 8 +.IX Item "lseek" +Move the file's read/write position. This uses file descriptors such as +those obtained by calling \f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +.Vb 2 +\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY ); +\& $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """lrint""" 8 +.el .IP \f(CWlrint\fR 8 +.IX Item "lrint" +Depending on the current floating point rounding mode, rounds the +argument either toward nearest (like "round"), toward zero (like +"trunc"), downward (toward negative infinity), or upward (toward +positive infinity) [C99]. Added in Perl v5.22. +.Sp +For the rounding mode, see "fegetround". +.ie n .IP """lround""" 8 +.el .IP \f(CWlround\fR 8 +.IX Item "lround" +Like "round", but as integer, as opposed to floating point [C99]. Added +in Perl v5.22. +.Sp +See also "ceil", "floor", "trunc". +.Sp +Owing to an oversight, this is not currently exported by default, or as part of +the \f(CW\*(C`:math_h_c99\*(C'\fR export tag; importing it must therefore be done by explicit +name. +.ie n .IP """malloc""" 8 +.el .IP \f(CWmalloc\fR 8 +.IX Item "malloc" +Not implemented. \f(CWmalloc()\fR is C\-specific. Perl does memory management transparently. +.ie n .IP """mblen""" 8 +.el .IP \f(CWmblen\fR 8 +.IX Item "mblen" +This is the same as the C function \f(CWmblen()\fR on unthreaded perls. On +threaded perls, it transparently (almost) substitutes the more +thread-safe \f(CW\*(C`mbrlen\*(C'\fR(3), if available, instead of \f(CW\*(C`mblen\*(C'\fR. +.Sp +Core Perl does not have any support for wide and multibyte locales, +except Unicode UTF\-8 locales. This function, in conjunction with +"mbtowc" and "wctomb" may be used to roll your own decoding/encoding +of other types of multi-byte locales. +.Sp +Use \f(CW\*(C`undef\*(C'\fR as the first parameter to this function to get the effect +of passing NULL as the first parameter to \f(CW\*(C`mblen\*(C'\fR. This resets any +shift state to its initial value. The return value is undefined if +\&\f(CW\*(C`mbrlen\*(C'\fR was substituted, so you should never rely on it. +.Sp +When the first parameter is a scalar containing a value that either is a +PV string or can be forced into one, the return value is the number of +bytes occupied by the first character of that string; or 0 if that first +character is the wide NUL character; or negative if there is an error. +This is based on the locale that currently underlies the program, +regardless of whether or not the function is called from Perl code that +is within the scope of \f(CW\*(C`use\ locale\*(C'\fR. Perl makes no attempt at +hiding from your code any differences in the \f(CW\*(C`errno\*(C'\fR setting between +\&\f(CW\*(C`mblen\*(C'\fR and \f(CW\*(C`mbrlen\*(C'\fR. It does set \f(CW\*(C`errno\*(C'\fR to 0 before calling them. +.Sp +The optional second parameter is ignored if it is larger than the +actual length of the first parameter string. +.ie n .IP """mbtowc""" 8 +.el .IP \f(CWmbtowc\fR 8 +.IX Item "mbtowc" +This is the same as the C function \f(CWmbtowc()\fR on unthreaded perls. On +threaded perls, it transparently (almost) substitutes the more +thread-safe \f(CW\*(C`mbrtowc\*(C'\fR(3), if available, instead of \f(CW\*(C`mbtowc\*(C'\fR. +.Sp +Core Perl does not have any support for wide and multibyte locales, +except Unicode UTF\-8 locales. This function, in conjunction with +"mblen" and "wctomb" may be used to roll your own decoding/encoding +of other types of multi-byte locales. +.Sp +The first parameter is a scalar into which, upon success, the wide +character represented by the multi-byte string contained in the second +parameter is stored. The optional third parameter is ignored if it is +larger than the actual length of the second parameter string. +.Sp +Use \f(CW\*(C`undef\*(C'\fR as the second parameter to this function to get the effect +of passing NULL as the second parameter to \f(CW\*(C`mbtowc\*(C'\fR. This ignores the +first parameter, and resets any shift state to its initial value. The +return value is undefined if \f(CW\*(C`mbrtowc\*(C'\fR was substituted, so you should +never rely on it. +.Sp +When the second parameter is a scalar containing a value that either is +a PV string or can be forced into one, the return value is the number of +bytes occupied by the first character of that string; or 0 if that first +character is the wide NUL character; or negative if there is an error. +This is based on the locale that currently underlies the program, +regardless of whether or not the function is called from Perl code that +is within the scope of \f(CW\*(C`use\ locale\*(C'\fR. Perl makes no attempt at +hiding from your code any differences in the \f(CW\*(C`errno\*(C'\fR setting between +\&\f(CW\*(C`mbtowc\*(C'\fR and \f(CW\*(C`mbrtowc\*(C'\fR. It does set \f(CW\*(C`errno\*(C'\fR to 0 before calling +them. +.ie n .IP """memchr""" 8 +.el .IP \f(CWmemchr\fR 8 +.IX Item "memchr" +Not implemented. \f(CWmemchr()\fR is C\-specific, see "index" in perlfunc instead. +.ie n .IP """memcmp""" 8 +.el .IP \f(CWmemcmp\fR 8 +.IX Item "memcmp" +Not implemented. \f(CWmemcmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR instead, see perlop. +.ie n .IP """memcpy""" 8 +.el .IP \f(CWmemcpy\fR 8 +.IX Item "memcpy" +Not implemented. \f(CWmemcpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR, see perlop, or see "substr" in perlfunc. +.ie n .IP """memmove""" 8 +.el .IP \f(CWmemmove\fR 8 +.IX Item "memmove" +Not implemented. \f(CWmemmove()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR, see perlop, or see "substr" in perlfunc. +.ie n .IP """memset""" 8 +.el .IP \f(CWmemset\fR 8 +.IX Item "memset" +Not implemented. \f(CWmemset()\fR is C\-specific, use \f(CW\*(C`x\*(C'\fR instead, see perlop. +.ie n .IP """mkdir""" 8 +.el .IP \f(CWmkdir\fR 8 +.IX Item "mkdir" +This is identical to Perl's builtin \f(CWmkdir()\fR function +for creating directories, see "mkdir" in perlfunc. +.ie n .IP """mkfifo""" 8 +.el .IP \f(CWmkfifo\fR 8 +.IX Item "mkfifo" +This is similar to the C function \f(CWmkfifo()\fR for creating +FIFO special files. +.Sp +.Vb 1 +\& if (mkfifo($path, $mode)) { .... +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. The \f(CW$mode\fR is similar to the +mode of \f(CWmkdir()\fR, see "mkdir" in perlfunc, though for \f(CW\*(C`mkfifo\*(C'\fR +you \fBmust\fR specify the \f(CW$mode\fR. +.ie n .IP """mktime""" 8 +.el .IP \f(CWmktime\fR 8 +.IX Item "mktime" +Convert date/time info to a calendar time. +.Sp +Synopsis: +.Sp +.Vb 2 +\& mktime(sec, min, hour, mday, mon, year, wday = 0, +\& yday = 0, isdst = \-1) +.Ve +.Sp +The month (\f(CW\*(C`mon\*(C'\fR), weekday (\f(CW\*(C`wday\*(C'\fR), and yearday (\f(CW\*(C`yday\*(C'\fR) begin at zero, +\&\fIi.e.\fR, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The +year (\f(CW\*(C`year\*(C'\fR) is given in years since 1900; \fIi.e.\fR, the year 1995 is 95; the +year 2001 is 101. Consult your system's \f(CWmktime()\fR manpage for details +about these and the other arguments. +.Sp +Calendar time for December 12, 1995, at 10:30 am. +.Sp +.Vb 2 +\& $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 ); +\& print "Date = ", POSIX::ctime($time_t); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """modf""" 8 +.el .IP \f(CWmodf\fR 8 +.IX Item "modf" +Return the integral and fractional parts of a floating-point number. +.Sp +.Vb 1 +\& ($fractional, $integral) = POSIX::modf( 3.14 ); +.Ve +.Sp +See also "round". +.ie n .IP """NaN""" 8 +.el .IP \f(CWNaN\fR 8 +.IX Item "NaN" +The not-a-number as a constant: +.Sp +.Vb 2 +\& use POSIX qw(NaN); +\& my $nan = NaN; +.Ve +.Sp +See also "nan", \f(CW\*(C`/isnan\*(C'\fR, and "fpclassify". +.ie n .IP """nan""" 8 +.el .IP \f(CWnan\fR 8 +.IX Item "nan" +.Vb 1 +\& my $nan = nan(); +.Ve +.Sp +Returns \f(CW\*(C`NaN\*(C'\fR, not-a-number [C99]. Added in Perl v5.22. +.Sp +The returned NaN is always a \fIquiet\fR NaN, as opposed to \fIsignaling\fR. +.Sp +With an argument, can be used to generate a NaN with \fIpayload\fR. +The argument is first interpreted as a floating point number, +but then any fractional parts are truncated (towards zero), +and the value is interpreted as an unsigned integer. +The bits of this integer are stored in the unused bits of the NaN. +.Sp +The result has a dual nature: it is a NaN, but it also carries +the integer inside it. The integer can be retrieved with "getpayload". +Note, though, that the payload is not propagated, not even on copies, +and definitely not in arithmetic operations. +.Sp +How many bits fit in the NaN depends on what kind of floating points +are being used, but on the most common platforms (64\-bit IEEE 754, +or the x86 80\-bit long doubles) there are 51 and 61 bits available, +respectively. (There would be 52 and 62, but the quiet/signaling +bit of NaNs takes away one.) However, because of the floating\-point\-to\- +integer-and-back conversions, please test carefully whether you get back +what you put in. If your integers are only 32 bits wide, you probably +should not rely on more than 32 bits of payload. +.Sp +Whether a "signaling" NaN is in any way different from a "quiet" NaN, +depends on the platform. Also note that the payload of the default +NaN (no argument to \fBnan()\fR) is not necessarily zero, use \f(CW\*(C`setpayload\*(C'\fR +to explicitly set the payload. On some platforms like the 32\-bit x86, +(unless using the 80\-bit long doubles) the signaling bit is not supported +at all. +.Sp +See also "isnan", "NaN", "setpayload" and "issignaling". +.ie n .IP """nearbyint""" 8 +.el .IP \f(CWnearbyint\fR 8 +.IX Item "nearbyint" +Returns the nearest integer to the argument, according to the current +rounding mode (see "fegetround") [C99]. Added in Perl v5.22. +.ie n .IP """nextafter""" 8 +.el .IP \f(CWnextafter\fR 8 +.IX Item "nextafter" +Returns the next representable floating point number after \f(CW\*(C`x\*(C'\fR in the +direction of \f(CW\*(C`y\*(C'\fR [C99]. Added in Perl v5.22. +.Sp +.Vb 1 +\& my $nextafter = POSIX::nextafter($x, $y); +.Ve +.Sp +Like "nexttoward", but potentially less accurate. +.ie n .IP """nexttoward""" 8 +.el .IP \f(CWnexttoward\fR 8 +.IX Item "nexttoward" +Returns the next representable floating point number after \f(CW\*(C`x\*(C'\fR in the +direction of \f(CW\*(C`y\*(C'\fR [C99]. Added in Perl v5.22. +.Sp +.Vb 1 +\& my $nexttoward = POSIX::nexttoward($x, $y); +.Ve +.Sp +Like "nextafter", but potentially more accurate. +.ie n .IP """nice""" 8 +.el .IP \f(CWnice\fR 8 +.IX Item "nice" +This is similar to the C function \f(CWnice()\fR, for changing +the scheduling preference of the current process. Positive +arguments mean a more polite process, negative values a more +needy process. Normal (non-root) user processes can only change towards +being more polite. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """offsetof""" 8 +.el .IP \f(CWoffsetof\fR 8 +.IX Item "offsetof" +Not implemented. \f(CWoffsetof()\fR is C\-specific, you probably want to see "pack" in perlfunc instead. +.ie n .IP """open""" 8 +.el .IP \f(CWopen\fR 8 +.IX Item "open" +Open a file for reading for writing. This returns file descriptors, not +Perl filehandles. Use \f(CW\*(C`POSIX::close\*(C'\fR to close the file. +.Sp +Open a file read-only with mode 0666. +.Sp +.Vb 1 +\& $fd = POSIX::open( "foo" ); +.Ve +.Sp +Open a file for read and write. +.Sp +.Vb 1 +\& $fd = POSIX::open( "foo", &POSIX::O_RDWR ); +.Ve +.Sp +Open a file for write, with truncation. +.Sp +.Vb 3 +\& $fd = POSIX::open( +\& "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC +\& ); +.Ve +.Sp +Create a new file with mode 0640. Set up the file for writing. +.Sp +.Vb 3 +\& $fd = POSIX::open( +\& "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 +\& ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.Sp +See also "sysopen" in perlfunc. +.ie n .IP """opendir""" 8 +.el .IP \f(CWopendir\fR 8 +.IX Item "opendir" +Open a directory for reading. +.Sp +.Vb 3 +\& $dir = POSIX::opendir( "/var" ); +\& @files = POSIX::readdir( $dir ); +\& POSIX::closedir( $dir ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """pathconf""" 8 +.el .IP \f(CWpathconf\fR 8 +.IX Item "pathconf" +Retrieves the value of a configurable limit on a file or directory. +.Sp +The following will determine the maximum length of the longest allowable +pathname on the filesystem which holds \f(CW\*(C`/var\*(C'\fR. +.Sp +.Vb 2 +\& $path_max = POSIX::pathconf( "/var", +\& &POSIX::_PC_PATH_MAX ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """pause""" 8 +.el .IP \f(CWpause\fR 8 +.IX Item "pause" +This is similar to the C function \f(CWpause()\fR, which suspends +the execution of the current process until a signal is received. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """perror""" 8 +.el .IP \f(CWperror\fR 8 +.IX Item "perror" +This is identical to the C function \f(CWperror()\fR, which outputs to the +standard error stream the specified message followed by \f(CW": "\fR and the +current error string. Use the \f(CWwarn()\fR function and the \f(CW$!\fR +variable instead, see "warn" in perlfunc and "$ERRNO" in perlvar. +.ie n .IP """pipe""" 8 +.el .IP \f(CWpipe\fR 8 +.IX Item "pipe" +Create an interprocess channel. This returns file descriptors like those +returned by \f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +.Vb 3 +\& my ($read, $write) = POSIX::pipe(); +\& POSIX::write( $write, "hello", 5 ); +\& POSIX::read( $read, $buf, 5 ); +.Ve +.Sp +See also "pipe" in perlfunc. +.ie n .IP """pow""" 8 +.el .IP \f(CWpow\fR 8 +.IX Item "pow" +Computes \f(CW$x\fR raised to the power \f(CW$exponent\fR. +.Sp +.Vb 1 +\& $ret = POSIX::pow( $x, $exponent ); +.Ve +.Sp +You can also use the \f(CW\*(C`**\*(C'\fR operator, see perlop. +.ie n .IP """printf""" 8 +.el .IP \f(CWprintf\fR 8 +.IX Item "printf" +Formats and prints the specified arguments to \f(CW\*(C`STDOUT\*(C'\fR. +See also "printf" in perlfunc. +.ie n .IP """putc""" 8 +.el .IP \f(CWputc\fR 8 +.IX Item "putc" +Not implemented. \f(CWputc()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """putchar""" 8 +.el .IP \f(CWputchar\fR 8 +.IX Item "putchar" +Not implemented. \f(CWputchar()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """puts""" 8 +.el .IP \f(CWputs\fR 8 +.IX Item "puts" +Not implemented. \f(CWputs()\fR is C\-specific, see "print" in perlfunc instead. +.ie n .IP """qsort""" 8 +.el .IP \f(CWqsort\fR 8 +.IX Item "qsort" +Not implemented. \f(CWqsort()\fR is C\-specific, see "sort" in perlfunc instead. +.ie n .IP """raise""" 8 +.el .IP \f(CWraise\fR 8 +.IX Item "raise" +Sends the specified signal to the current process. +See also "kill" in perlfunc and the \f(CW$$\fR in "$PID" in perlvar. +.ie n .IP """rand""" 8 +.el .IP \f(CWrand\fR 8 +.IX Item "rand" +Not implemented. \f(CWrand()\fR is non-portable, see "rand" in perlfunc instead. +.ie n .IP """read""" 8 +.el .IP \f(CWread\fR 8 +.IX Item "read" +Read from a file. This uses file descriptors such as those obtained by +calling \f(CW\*(C`POSIX::open\*(C'\fR. If the buffer \f(CW$buf\fR is not large enough for the +read then Perl will extend it to make room for the request. +.Sp +.Vb 2 +\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY ); +\& $bytes = POSIX::read( $fd, $buf, 3 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.Sp +See also "sysread" in perlfunc. +.ie n .IP """readdir""" 8 +.el .IP \f(CWreaddir\fR 8 +.IX Item "readdir" +This is identical to Perl's builtin \f(CWreaddir()\fR function +for reading directory entries, see "readdir" in perlfunc. +.ie n .IP """realloc""" 8 +.el .IP \f(CWrealloc\fR 8 +.IX Item "realloc" +Not implemented. \f(CWrealloc()\fR is C\-specific. Perl does memory management transparently. +.ie n .IP """remainder""" 8 +.el .IP \f(CWremainder\fR 8 +.IX Item "remainder" +Given \f(CW\*(C`x\*(C'\fR and \f(CW\*(C`y\*(C'\fR, returns the value \f(CW\*(C`x\ \-\ n*y\*(C'\fR, where \f(CW\*(C`n\*(C'\fR is the integer +closest to \f(CW\*(C`x\*(C'\fR/\f(CW\*(C`y\*(C'\fR [C99]. Added in Perl v5.22. +.Sp +.Vb 1 +\& my $remainder = POSIX::remainder($x, $y) +.Ve +.Sp +See also "remquo". +.ie n .IP """remove""" 8 +.el .IP \f(CWremove\fR 8 +.IX Item "remove" +Deletes a name from the filesystem. Calls "unlink" in perlfunc for +files and "rmdir" in perlfunc for directories. +.ie n .IP """remquo""" 8 +.el .IP \f(CWremquo\fR 8 +.IX Item "remquo" +Like "remainder" but also returns the low-order bits of the quotient (n) +[C99]. Added in Perl v5.22. +.Sp +(This is quite esoteric interface, mainly used to implement numerical +algorithms.) +.ie n .IP """rename""" 8 +.el .IP \f(CWrename\fR 8 +.IX Item "rename" +This is identical to Perl's builtin \f(CWrename()\fR function +for renaming files, see "rename" in perlfunc. +.ie n .IP """rewind""" 8 +.el .IP \f(CWrewind\fR 8 +.IX Item "rewind" +Seeks to the beginning of the file. +.ie n .IP """rewinddir""" 8 +.el .IP \f(CWrewinddir\fR 8 +.IX Item "rewinddir" +This is identical to Perl's builtin \f(CWrewinddir()\fR function for +rewinding directory entry streams, see "rewinddir" in perlfunc. +.ie n .IP """rint""" 8 +.el .IP \f(CWrint\fR 8 +.IX Item "rint" +Identical to "lrint". +.ie n .IP """rmdir""" 8 +.el .IP \f(CWrmdir\fR 8 +.IX Item "rmdir" +This is identical to Perl's builtin \f(CWrmdir()\fR function +for removing (empty) directories, see "rmdir" in perlfunc. +.ie n .IP """round""" 8 +.el .IP \f(CWround\fR 8 +.IX Item "round" +Returns the integer (but still as floating point) nearest to the +argument [C99]. Added in Perl v5.22. +.Sp +See also "ceil", "floor", "lround", "modf", and "trunc". +.ie n .IP """scalbn""" 8 +.el .IP \f(CWscalbn\fR 8 +.IX Item "scalbn" +Returns \f(CW\*(C`x\ *\ 2**y\*(C'\fR [C99]. Added in Perl v5.22. +.Sp +See also "frexp" and "ldexp". +.ie n .IP """scanf""" 8 +.el .IP \f(CWscanf\fR 8 +.IX Item "scanf" +Not implemented. \f(CWscanf()\fR is C\-specific, use <> and regular expressions instead, +see perlre. +.ie n .IP """setgid""" 8 +.el .IP \f(CWsetgid\fR 8 +.IX Item "setgid" +Sets the real group identifier and the effective group identifier for +this process. Similar to assigning a value to the Perl's builtin +\&\f(CW$)\fR variable, see "$EGID" in perlvar, except that the latter +will change only the real user identifier, and that the \fBsetgid()\fR +uses only a single numeric argument, as opposed to a space-separated +list of numbers. +.ie n .IP """setjmp""" 8 +.el .IP \f(CWsetjmp\fR 8 +.IX Item "setjmp" +Not implemented. \f(CWsetjmp()\fR is C\-specific: use \f(CW\*(C`eval {}\*(C'\fR instead, +see "eval" in perlfunc. +.ie n .IP """setlocale""" 8 +.el .IP \f(CWsetlocale\fR 8 +.IX Item "setlocale" +WARNING! Prior to Perl 5.28 or on a system that does not support +thread-safe locale operations, do NOT use this function in a +thread. The locale will change in all other threads at the +same time, and should your thread get paused by the operating system, +and another started, that thread will not have the locale it is +expecting. On some platforms, there can be a race leading to segfaults +if two threads call this function nearly simultaneously. This warning +does not apply on unthreaded builds, or on perls where +\&\f(CW\*(C`${^SAFE_LOCALES}\*(C'\fR exists and is non-zero; namely Perl 5.28 and later +compiled to be locale-thread-safe. +.Sp +This function +modifies and queries the program's underlying locale. Users of this +function should read perllocale, whch provides a comprehensive +discussion of Perl locale handling, knowledge of which is necessary to +properly use this function. It contains +a section devoted to this function. +The discussion here is merely a summary reference for \f(CWsetlocale()\fR. +Note that Perl itself is almost entirely unaffected by the locale +except within the scope of \f(CW"use\ locale"\fR. (Exceptions are listed +in "Not within the scope of "use locale"" in perllocale, and +locale-dependent functions within the POSIX module ARE always affected +by the current locale.) +.Sp +The following examples assume +.Sp +.Vb 1 +\& use POSIX qw(setlocale LC_ALL LC_CTYPE); +.Ve +.Sp +has been issued. +.Sp +The following will set the traditional UNIX system locale behavior +(the second argument \f(CW"C"\fR). +.Sp +.Vb 1 +\& $loc = setlocale( LC_ALL, "C" ); +.Ve +.Sp +The following will query the current \f(CW\*(C`LC_CTYPE\*(C'\fR category. (No second +argument means 'query'.) +.Sp +.Vb 1 +\& $loc = setlocale( LC_CTYPE ); +.Ve +.Sp +The following will set the \f(CW\*(C`LC_CTYPE\*(C'\fR behaviour according to the locale +environment variables (the second argument \f(CW""\fR). +Please see your system's \f(CWsetlocale(3)\fR documentation for the locale +environment variables' meaning or consult perllocale. +.Sp +.Vb 1 +\& $loc = setlocale( LC_CTYPE, "" ); +.Ve +.Sp +The following will set the \f(CW\*(C`LC_COLLATE\*(C'\fR behaviour to Argentinian +Spanish. \fBNOTE\fR: The naming and availability of locales depends on +your operating system. Please consult perllocale for how to find +out which locales are available in your system. +.Sp +.Vb 1 +\& $loc = setlocale( LC_COLLATE, "es_AR.ISO8859\-1" ); +.Ve +.ie n .IP """setpayload""" 8 +.el .IP \f(CWsetpayload\fR 8 +.IX Item "setpayload" +.Vb 2 +\& use POSIX \*(Aq:nan_payload\*(Aq; +\& setpayload($var, $payload); +.Ve +.Sp +Sets the \f(CW\*(C`NaN\*(C'\fR payload of var. Added in Perl v5.24. +.Sp +NOTE: the NaN payload APIs are based on the latest (as of June 2015) +proposed ISO C interfaces, but they are not yet a standard. Things +may change. +.Sp +See "nan" for more discussion about \f(CW\*(C`NaN\*(C'\fR. +.Sp +See also "setpayloadsig", "isnan", "getpayload", and "issignaling". +.ie n .IP """setpayloadsig""" 8 +.el .IP \f(CWsetpayloadsig\fR 8 +.IX Item "setpayloadsig" +.Vb 2 +\& use POSIX \*(Aq:nan_payload\*(Aq; +\& setpayloadsig($var, $payload); +.Ve +.Sp +Like "setpayload" but also makes the NaN \fIsignaling\fR. Added in Perl +v5.24. +.Sp +Depending on the platform the NaN may or may not behave differently. +.Sp +Note the API instability warning in "setpayload". +.Sp +Note that because how the floating point formats work out, on the most +common platforms signaling payload of zero is best avoided, +since it might end up being identical to \f(CW\*(C`+Inf\*(C'\fR. +.Sp +See also "nan", "isnan", "getpayload", and "issignaling". +.ie n .IP """setpgid""" 8 +.el .IP \f(CWsetpgid\fR 8 +.IX Item "setpgid" +This is similar to the C function \f(CWsetpgid()\fR for +setting the process group identifier of the current process. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """setsid""" 8 +.el .IP \f(CWsetsid\fR 8 +.IX Item "setsid" +This is identical to the C function \f(CWsetsid()\fR for +setting the session identifier of the current process. +.ie n .IP """setuid""" 8 +.el .IP \f(CWsetuid\fR 8 +.IX Item "setuid" +Sets the real user identifier and the effective user identifier for +this process. Similar to assigning a value to the Perl's builtin +\&\f(CW$<\fR variable, see "$UID" in perlvar, except that the latter +will change only the real user identifier. +.ie n .IP """sigaction""" 8 +.el .IP \f(CWsigaction\fR 8 +.IX Item "sigaction" +Detailed signal management. This uses \f(CW\*(C`POSIX::SigAction\*(C'\fR objects for +the \f(CW\*(C`action\*(C'\fR and \f(CW\*(C`oldaction\*(C'\fR arguments (the oldaction can also be +just a hash reference). Consult your system's \f(CW\*(C`sigaction\*(C'\fR manpage +for details, see also "POSIX::SigRt". +.Sp +Synopsis: +.Sp +.Vb 1 +\& sigaction(signal, action, oldaction = 0) +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. The \f(CW\*(C`signal\*(C'\fR must be a number (like +\&\f(CW\*(C`SIGHUP\*(C'\fR), not a string (like \f(CW"SIGHUP"\fR), though Perl does try hard +to understand you. +.Sp +If you use the \f(CW\*(C`SA_SIGINFO\*(C'\fR flag, the signal handler will in addition to +the first argument, the signal name, also receive a second argument, a +hash reference, inside which are the following keys with the following +semantics, as defined by POSIX/SUSv3: +.Sp +.Vb 5 +\& signo the signal number +\& errno the error number +\& code if this is zero or less, the signal was sent by +\& a user process and the uid and pid make sense, +\& otherwise the signal was sent by the kernel +.Ve +.Sp +The constants for specific \f(CW\*(C`code\*(C'\fR values can be imported individually +or using the \f(CW\*(C`:signal_h_si_code\*(C'\fR tag, since Perl v5.24. +.Sp +The following are also defined by POSIX/SUSv3, but unfortunately +not very widely implemented: +.Sp +.Vb 6 +\& pid the process id generating the signal +\& uid the uid of the process id generating the signal +\& status exit value or signal for SIGCHLD +\& band band event for SIGPOLL +\& addr address of faulting instruction or memory +\& reference for SIGILL, SIGFPE, SIGSEGV or SIGBUS +.Ve +.Sp +A third argument is also passed to the handler, which contains a copy +of the raw binary contents of the \f(CW\*(C`siginfo\*(C'\fR structure: if a system has +some non-POSIX fields, this third argument is where to \f(CWunpack()\fR them +from. +.Sp +Note that not all \f(CW\*(C`siginfo\*(C'\fR values make sense simultaneously (some are +valid only for certain signals, for example), and not all values make +sense from Perl perspective, you should to consult your system's +\&\f(CW\*(C`sigaction\*(C'\fR and possibly also \f(CW\*(C`siginfo\*(C'\fR documentation. +.ie n .IP """siglongjmp""" 8 +.el .IP \f(CWsiglongjmp\fR 8 +.IX Item "siglongjmp" +Not implemented. \f(CWsiglongjmp()\fR is C\-specific: use "die" in perlfunc instead. +.ie n .IP """signbit""" 8 +.el .IP \f(CWsignbit\fR 8 +.IX Item "signbit" +Returns zero for positive arguments, non-zero for negative arguments [C99]. +Added in Perl v5.22. +.ie n .IP """sigpending""" 8 +.el .IP \f(CWsigpending\fR 8 +.IX Item "sigpending" +Examine signals that are blocked and pending. This uses \f(CW\*(C`POSIX::SigSet\*(C'\fR +objects for the \f(CW\*(C`sigset\*(C'\fR argument. Consult your system's \f(CW\*(C`sigpending\*(C'\fR +manpage for details. +.Sp +Synopsis: +.Sp +.Vb 1 +\& sigpending(sigset) +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """sigprocmask""" 8 +.el .IP \f(CWsigprocmask\fR 8 +.IX Item "sigprocmask" +Change and/or examine calling process's signal mask. This uses +\&\f(CW\*(C`POSIX::SigSet\*(C'\fR objects for the \f(CW\*(C`sigset\*(C'\fR and \f(CW\*(C`oldsigset\*(C'\fR arguments. +Consult your system's \f(CW\*(C`sigprocmask\*(C'\fR manpage for details. +.Sp +Synopsis: +.Sp +.Vb 1 +\& sigprocmask(how, sigset, oldsigset = 0) +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.Sp +Note that you can't reliably block or unblock a signal from its own signal +handler if you're using safe signals. Other signals can be blocked or unblocked +reliably. +.ie n .IP """sigsetjmp""" 8 +.el .IP \f(CWsigsetjmp\fR 8 +.IX Item "sigsetjmp" +Not implemented. \f(CWsigsetjmp()\fR is C\-specific: use \f(CW\*(C`eval {}\*(C'\fR instead, +see "eval" in perlfunc. +.ie n .IP """sigsuspend""" 8 +.el .IP \f(CWsigsuspend\fR 8 +.IX Item "sigsuspend" +Install a signal mask and suspend process until signal arrives. This uses +\&\f(CW\*(C`POSIX::SigSet\*(C'\fR objects for the \f(CW\*(C`signal_mask\*(C'\fR argument. Consult your +system's \f(CW\*(C`sigsuspend\*(C'\fR manpage for details. +.Sp +Synopsis: +.Sp +.Vb 1 +\& sigsuspend(signal_mask) +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """sin""" 8 +.el .IP \f(CWsin\fR 8 +.IX Item "sin" +This is identical to Perl's builtin \f(CWsin()\fR function +for returning the sine of the numerical argument, +see "sin" in perlfunc. See also Math::Trig. +.ie n .IP """sinh""" 8 +.el .IP \f(CWsinh\fR 8 +.IX Item "sinh" +This is identical to the C function \f(CWsinh()\fR +for returning the hyperbolic sine of the numerical argument. +See also Math::Trig. +.ie n .IP """sleep""" 8 +.el .IP \f(CWsleep\fR 8 +.IX Item "sleep" +This is functionally identical to Perl's builtin \f(CWsleep()\fR function +for suspending the execution of the current for process for certain +number of seconds, see "sleep" in perlfunc. There is one significant +difference, however: \f(CWPOSIX::sleep()\fR returns the number of +\&\fBunslept\fR seconds, while the \f(CWCORE::sleep()\fR returns the +number of slept seconds. +.ie n .IP """sprintf""" 8 +.el .IP \f(CWsprintf\fR 8 +.IX Item "sprintf" +This is similar to Perl's builtin \f(CWsprintf()\fR function +for returning a string that has the arguments formatted as requested, +see "sprintf" in perlfunc. +.ie n .IP """sqrt""" 8 +.el .IP \f(CWsqrt\fR 8 +.IX Item "sqrt" +This is identical to Perl's builtin \f(CWsqrt()\fR function. +for returning the square root of the numerical argument, +see "sqrt" in perlfunc. +.ie n .IP """srand""" 8 +.el .IP \f(CWsrand\fR 8 +.IX Item "srand" +Give a seed the pseudorandom number generator, see "srand" in perlfunc. +.ie n .IP """sscanf""" 8 +.el .IP \f(CWsscanf\fR 8 +.IX Item "sscanf" +Not implemented. \f(CWsscanf()\fR is C\-specific, use regular expressions instead, +see perlre. +.ie n .IP """stat""" 8 +.el .IP \f(CWstat\fR 8 +.IX Item "stat" +This is identical to Perl's builtin \f(CWstat()\fR function +for returning information about files and directories. +.ie n .IP """strcat""" 8 +.el .IP \f(CWstrcat\fR 8 +.IX Item "strcat" +Not implemented. \f(CWstrcat()\fR is C\-specific, use \f(CW\*(C`.=\*(C'\fR instead, see perlop. +.ie n .IP """strchr""" 8 +.el .IP \f(CWstrchr\fR 8 +.IX Item "strchr" +Not implemented. \f(CWstrchr()\fR is C\-specific, see "index" in perlfunc instead. +.ie n .IP """strcmp""" 8 +.el .IP \f(CWstrcmp\fR 8 +.IX Item "strcmp" +Not implemented. \f(CWstrcmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR or \f(CW\*(C`cmp\*(C'\fR instead, see perlop. +.ie n .IP """strcoll""" 8 +.el .IP \f(CWstrcoll\fR 8 +.IX Item "strcoll" +This is identical to the C function \f(CWstrcoll()\fR +for collating (comparing) strings transformed using +the \f(CWstrxfrm()\fR function. Not really needed since +Perl can do this transparently, see perllocale. +.Sp +Beware that in a UTF\-8 locale, anything you pass to this function must +be in UTF\-8; and when not in a UTF\-8 locale, anything passed must not be +UTF\-8 encoded. +.Sp +Note also that it doesn't make sense for a string to be encoded in one +locale (say, ISO\-8859\-6, Arabic) and to collate it based on another +(like ISO\-8859\-7, Greek). The results will be essentially meaningless. +.ie n .IP """strcpy""" 8 +.el .IP \f(CWstrcpy\fR 8 +.IX Item "strcpy" +Not implemented. \f(CWstrcpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR instead, see perlop. +.ie n .IP """strcspn""" 8 +.el .IP \f(CWstrcspn\fR 8 +.IX Item "strcspn" +Not implemented. \f(CWstrcspn()\fR is C\-specific, use regular expressions instead, +see perlre. +.ie n .IP """strerror""" 8 +.el .IP \f(CWstrerror\fR 8 +.IX Item "strerror" +Returns the error string for the specified errno. +Identical to the string form of \f(CW$!\fR, see "$ERRNO" in perlvar. +.ie n .IP """strftime""" 8 +.el .IP \f(CWstrftime\fR 8 +.IX Item "strftime" +Convert date and time information to string. Returns the string. +.Sp +Synopsis: +.Sp +.Vb 2 +\& strftime(fmt, sec, min, hour, mday, mon, year, +\& wday = \-1, yday = \-1, isdst = \-1) +.Ve +.Sp +The month (\f(CW\*(C`mon\*(C'\fR), weekday (\f(CW\*(C`wday\*(C'\fR), and yearday (\f(CW\*(C`yday\*(C'\fR) begin at zero, +\&\fIi.e.\fR, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The +year (\f(CW\*(C`year\*(C'\fR) is given in years since 1900, \fIi.e.\fR, the year 1995 is 95; the +year 2001 is 101. Consult your system's \f(CWstrftime()\fR manpage for details +about these and the other arguments. +.Sp +If you want your code to be portable, your format (\f(CW\*(C`fmt\*(C'\fR) argument +should use only the conversion specifiers defined by the ANSI C +standard (C99, to play safe). These are \f(CW\*(C`aAbBcdHIjmMpSUwWxXyYZ%\*(C'\fR. +But even then, the \fBresults\fR of some of the conversion specifiers are +non-portable. For example, the specifiers \f(CW\*(C`aAbBcpZ\*(C'\fR change according +to the locale settings of the user, and both how to set locales (the +locale names) and what output to expect are non-standard. +The specifier \f(CW\*(C`c\*(C'\fR changes according to the timezone settings of the +user and the timezone computation rules of the operating system. +The \f(CW\*(C`Z\*(C'\fR specifier is notoriously unportable since the names of +timezones are non-standard. Sticking to the numeric specifiers is the +safest route. +.Sp +The given arguments are made consistent as though by calling +\&\f(CWmktime()\fR before calling your system's \f(CWstrftime()\fR function, +except that the \f(CW\*(C`isdst\*(C'\fR value is not affected. +.Sp +The string for Tuesday, December 12, 1995. +.Sp +.Vb 3 +\& $str = POSIX::strftime( "%A, %B %d, %Y", +\& 0, 0, 0, 12, 11, 95, 2 ); +\& print "$str\en"; +.Ve +.ie n .IP """strlen""" 8 +.el .IP \f(CWstrlen\fR 8 +.IX Item "strlen" +Not implemented. \f(CWstrlen()\fR is C\-specific, use \f(CWlength()\fR instead, see "length" in perlfunc. +.ie n .IP """strncat""" 8 +.el .IP \f(CWstrncat\fR 8 +.IX Item "strncat" +Not implemented. \f(CWstrncat()\fR is C\-specific, use \f(CW\*(C`.=\*(C'\fR instead, see perlop. +.ie n .IP """strncmp""" 8 +.el .IP \f(CWstrncmp\fR 8 +.IX Item "strncmp" +Not implemented. \f(CWstrncmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR instead, see perlop. +.ie n .IP """strncpy""" 8 +.el .IP \f(CWstrncpy\fR 8 +.IX Item "strncpy" +Not implemented. \f(CWstrncpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR instead, see perlop. +.ie n .IP """strpbrk""" 8 +.el .IP \f(CWstrpbrk\fR 8 +.IX Item "strpbrk" +Not implemented. \f(CWstrpbrk()\fR is C\-specific, use regular expressions instead, +see perlre. +.ie n .IP """strrchr""" 8 +.el .IP \f(CWstrrchr\fR 8 +.IX Item "strrchr" +Not implemented. \f(CWstrrchr()\fR is C\-specific, see "rindex" in perlfunc instead. +.ie n .IP """strspn""" 8 +.el .IP \f(CWstrspn\fR 8 +.IX Item "strspn" +Not implemented. \f(CWstrspn()\fR is C\-specific, use regular expressions instead, +see perlre. +.ie n .IP """strstr""" 8 +.el .IP \f(CWstrstr\fR 8 +.IX Item "strstr" +This is identical to Perl's builtin \f(CWindex()\fR function, +see "index" in perlfunc. +.ie n .IP """strtod""" 8 +.el .IP \f(CWstrtod\fR 8 +.IX Item "strtod" +String to double translation. Returns the parsed number and the number +of characters in the unparsed portion of the string. Truly +POSIX-compliant systems set \f(CW$!\fR (\f(CW$ERRNO\fR) to indicate a translation +error, so clear \f(CW$!\fR before calling \f(CW\*(C`strtod\*(C'\fR. However, non-POSIX systems +may not check for overflow, and therefore will never set \f(CW$!\fR. +.Sp +\&\f(CW\*(C`strtod\*(C'\fR respects any POSIX \f(CWsetlocale()\fR \f(CW\*(C`LC_NUMERIC\*(C'\fR settings, +regardless of whether or not it is called from Perl code that is within +the scope of \f(CW\*(C`use\ locale\*(C'\fR. Prior to Perl 5.28, or when operating in +a non thread-safe environment, it should not be used in a threaded +application unless it's certain that the underlying locale is C +or POSIX. This is because it otherwise changes the locale, which +globally affects all threads simultaneously. +.Sp +To parse a string \f(CW$str\fR as a floating point number use +.Sp +.Vb 2 +\& $! = 0; +\& ($num, $n_unparsed) = POSIX::strtod($str); +.Ve +.Sp +The second returned item and \f(CW$!\fR can be used to check for valid input: +.Sp +.Vb 3 +\& if (($str eq \*(Aq\*(Aq) || ($n_unparsed != 0) || $!) { +\& die "Non\-numeric input $str" . ($! ? ": $!\en" : "\en"); +\& } +.Ve +.Sp +When called in a scalar context \f(CW\*(C`strtod\*(C'\fR returns the parsed number. +.ie n .IP """strtok""" 8 +.el .IP \f(CWstrtok\fR 8 +.IX Item "strtok" +Not implemented. \f(CWstrtok()\fR is C\-specific, use regular expressions instead, see +perlre, or "split" in perlfunc. +.ie n .IP """strtol""" 8 +.el .IP \f(CWstrtol\fR 8 +.IX Item "strtol" +String to (long) integer translation. Returns the parsed number and +the number of characters in the unparsed portion of the string. Truly +POSIX-compliant systems set \f(CW$!\fR (\f(CW$ERRNO\fR) to indicate a translation +error, so clear \f(CW$!\fR before calling \f(CW\*(C`strtol\*(C'\fR. However, non-POSIX systems +may not check for overflow, and therefore will never set \f(CW$!\fR. +.Sp +\&\f(CW\*(C`strtol\*(C'\fR should respect any POSIX \fR\f(BIsetlocale()\fR\fI\fR settings. +.Sp +To parse a string \f(CW$str\fR as a number in some base \f(CW$base\fR use +.Sp +.Vb 2 +\& $! = 0; +\& ($num, $n_unparsed) = POSIX::strtol($str, $base); +.Ve +.Sp +The base should be zero or between 2 and 36, inclusive. When the base +is zero or omitted \f(CW\*(C`strtol\*(C'\fR will use the string itself to determine the +base: a leading "0x" or "0X" means hexadecimal; a leading "0" means +octal; any other leading characters mean decimal. Thus, "1234" is +parsed as a decimal number, "01234" as an octal number, and "0x1234" +as a hexadecimal number. +.Sp +The second returned item and \f(CW$!\fR can be used to check for valid input: +.Sp +.Vb 3 +\& if (($str eq \*(Aq\*(Aq) || ($n_unparsed != 0) || !$!) { +\& die "Non\-numeric input $str" . $! ? ": $!\en" : "\en"; +\& } +.Ve +.Sp +When called in a scalar context \f(CW\*(C`strtol\*(C'\fR returns the parsed number. +.ie n .IP """strtold""" 8 +.el .IP \f(CWstrtold\fR 8 +.IX Item "strtold" +Like "strtod" but for long doubles. Defined only if the +system supports long doubles. +.ie n .IP """strtoul""" 8 +.el .IP \f(CWstrtoul\fR 8 +.IX Item "strtoul" +String to unsigned (long) integer translation. \f(CWstrtoul()\fR is identical +to \f(CWstrtol()\fR except that \f(CWstrtoul()\fR only parses unsigned integers. See +"strtol" for details. +.Sp +Note: Some vendors supply \f(CWstrtod()\fR and \f(CWstrtol()\fR but not \f(CWstrtoul()\fR. +Other vendors that do supply \f(CWstrtoul()\fR parse "\-1" as a valid value. +.ie n .IP """strxfrm""" 8 +.el .IP \f(CWstrxfrm\fR 8 +.IX Item "strxfrm" +String transformation. Returns the transformed string. +.Sp +.Vb 1 +\& $dst = POSIX::strxfrm( $src ); +.Ve +.Sp +Used with \f(CW\*(C`eq\*(C'\fR or \f(CW\*(C`cmp\*(C'\fR as an alternative to \f(CW"strcoll"\fR. +.Sp +Not really needed since Perl can do this transparently, see +perllocale. +.Sp +Unlike the libc \f(CW\*(C`strxfrm\*(C'\fR, this allows NUL characters in the input +\&\f(CW$src\fR. +.Sp +It doesn't make sense for a string to be encoded in one locale (say, +ISO\-8859\-6, Arabic) and to collate it based on another (like ISO\-8859\-7, +Greek). Perl assumes that the current \f(CW\*(C`LC_CTYPE\*(C'\fR locale correctly +represents the encoding of \f(CW$src\fR, and ignores the value of +\&\f(CW\*(C`LC_COLLATE\*(C'\fR. +.ie n .IP """sysconf""" 8 +.el .IP \f(CWsysconf\fR 8 +.IX Item "sysconf" +Retrieves values of system configurable variables. +.Sp +The following will get the machine's clock speed. +.Sp +.Vb 1 +\& $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """system""" 8 +.el .IP \f(CWsystem\fR 8 +.IX Item "system" +This is identical to Perl's builtin \f(CWsystem()\fR function, see +"system" in perlfunc. +.ie n .IP """tan""" 8 +.el .IP \f(CWtan\fR 8 +.IX Item "tan" +This is identical to the C function \f(CWtan()\fR, returning the +tangent of the numerical argument. See also Math::Trig. +.ie n .IP """tanh""" 8 +.el .IP \f(CWtanh\fR 8 +.IX Item "tanh" +This is identical to the C function \f(CWtanh()\fR, returning the +hyperbolic tangent of the numerical argument. See also Math::Trig. +.ie n .IP """tcdrain""" 8 +.el .IP \f(CWtcdrain\fR 8 +.IX Item "tcdrain" +This is similar to the C function \f(CWtcdrain()\fR for draining +the output queue of its argument stream. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """tcflow""" 8 +.el .IP \f(CWtcflow\fR 8 +.IX Item "tcflow" +This is similar to the C function \f(CWtcflow()\fR for controlling +the flow of its argument stream. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """tcflush""" 8 +.el .IP \f(CWtcflush\fR 8 +.IX Item "tcflush" +This is similar to the C function \f(CWtcflush()\fR for flushing +the I/O buffers of its argument stream. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """tcgetpgrp""" 8 +.el .IP \f(CWtcgetpgrp\fR 8 +.IX Item "tcgetpgrp" +This is identical to the C function \f(CWtcgetpgrp()\fR for returning the +process group identifier of the foreground process group of the controlling +terminal. +.ie n .IP """tcsendbreak""" 8 +.el .IP \f(CWtcsendbreak\fR 8 +.IX Item "tcsendbreak" +This is similar to the C function \f(CWtcsendbreak()\fR for sending +a break on its argument stream. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """tcsetpgrp""" 8 +.el .IP \f(CWtcsetpgrp\fR 8 +.IX Item "tcsetpgrp" +This is similar to the C function \f(CWtcsetpgrp()\fR for setting the +process group identifier of the foreground process group of the controlling +terminal. +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """tgamma""" 8 +.el .IP \f(CWtgamma\fR 8 +.IX Item "tgamma" +The Gamma function [C99]. Added in Perl v5.22. +.Sp +See also "lgamma". +.ie n .IP """time""" 8 +.el .IP \f(CWtime\fR 8 +.IX Item "time" +This is identical to Perl's builtin \f(CWtime()\fR function +for returning the number of seconds since the epoch +(whatever it is for the system), see "time" in perlfunc. +.ie n .IP """times""" 8 +.el .IP \f(CWtimes\fR 8 +.IX Item "times" +The \f(CWtimes()\fR function returns elapsed realtime since some point in the past +(such as system startup), user and system times for this process, and user +and system times used by child processes. All times are returned in clock +ticks. +.Sp +.Vb 2 +\& ($realtime, $user, $system, $cuser, $csystem) +\& = POSIX::times(); +.Ve +.Sp +Note: Perl's builtin \f(CWtimes()\fR function returns four values, measured in +seconds. +.ie n .IP """tmpfile""" 8 +.el .IP \f(CWtmpfile\fR 8 +.IX Item "tmpfile" +Not implemented. Use method \f(CWIO::File::new_tmpfile()\fR instead, or see File::Temp. +.ie n .IP """tmpnam""" 8 +.el .IP \f(CWtmpnam\fR 8 +.IX Item "tmpnam" +For security reasons, which are probably detailed in your system's +documentation for the C library \f(CWtmpnam()\fR function, this interface +is no longer available since Perl v5.26; instead use File::Temp. +.ie n .IP """tolower""" 8 +.el .IP \f(CWtolower\fR 8 +.IX Item "tolower" +This function has been removed as of Perl v5.26. +This is identical to the C function, except that it can apply to a single +character or to a whole string, and currently operates as if the locale +always is "C". Consider using the \f(CWlc()\fR function, see "lc" in perlfunc, +see "lc" in perlfunc, or the equivalent \f(CW\*(C`\eL\*(C'\fR operator inside doublequotish +strings. +.ie n .IP """toupper""" 8 +.el .IP \f(CWtoupper\fR 8 +.IX Item "toupper" +This function has been removed as of Perl v5.26. +This is similar to the C function, except that it can apply to a single +character or to a whole string, and currently operates as if the locale +always is "C". Consider using the \f(CWuc()\fR function, see "uc" in perlfunc, +or the equivalent \f(CW\*(C`\eU\*(C'\fR operator inside doublequotish strings. +.ie n .IP """trunc""" 8 +.el .IP \f(CWtrunc\fR 8 +.IX Item "trunc" +Returns the integer toward zero from the argument [C99]. Added in Perl +v5.22. +.Sp +See also "ceil", "floor", and "round". +.ie n .IP """ttyname""" 8 +.el .IP \f(CWttyname\fR 8 +.IX Item "ttyname" +This is identical to the C function \f(CWttyname()\fR for returning the +name of the current terminal. +.ie n .IP """tzname""" 8 +.el .IP \f(CWtzname\fR 8 +.IX Item "tzname" +Retrieves the time conversion information from the \f(CW\*(C`tzname\*(C'\fR variable. +.Sp +.Vb 2 +\& POSIX::tzset(); +\& ($std, $dst) = POSIX::tzname(); +.Ve +.ie n .IP """tzset""" 8 +.el .IP \f(CWtzset\fR 8 +.IX Item "tzset" +This is identical to the C function \f(CWtzset()\fR for setting +the current timezone based on the environment variable \f(CW\*(C`TZ\*(C'\fR, +to be used by \f(CWctime()\fR, \f(CWlocaltime()\fR, \f(CWmktime()\fR, and \f(CWstrftime()\fR +functions. +.ie n .IP """umask""" 8 +.el .IP \f(CWumask\fR 8 +.IX Item "umask" +This is identical to Perl's builtin \f(CWumask()\fR function +for setting (and querying) the file creation permission mask, +see "umask" in perlfunc. +.ie n .IP """uname""" 8 +.el .IP \f(CWuname\fR 8 +.IX Item "uname" +Get name of current operating system. +.Sp +.Vb 2 +\& ($sysname, $nodename, $release, $version, $machine) +\& = POSIX::uname(); +.Ve +.Sp +Note that the actual meanings of the various fields are not +that well standardized, do not expect any great portability. +The \f(CW$sysname\fR might be the name of the operating system, +the \f(CW$nodename\fR might be the name of the host, the \f(CW$release\fR +might be the (major) release number of the operating system, +the \f(CW$version\fR might be the (minor) release number of the +operating system, and the \f(CW$machine\fR might be a hardware identifier. +Maybe. +.ie n .IP """ungetc""" 8 +.el .IP \f(CWungetc\fR 8 +.IX Item "ungetc" +Not implemented. Use method \f(CWIO::Handle::ungetc()\fR instead. +.ie n .IP """unlink""" 8 +.el .IP \f(CWunlink\fR 8 +.IX Item "unlink" +This is identical to Perl's builtin \f(CWunlink()\fR function +for removing files, see "unlink" in perlfunc. +.ie n .IP """utime""" 8 +.el .IP \f(CWutime\fR 8 +.IX Item "utime" +This is identical to Perl's builtin \f(CWutime()\fR function +for changing the time stamps of files and directories, +see "utime" in perlfunc. +.ie n .IP """vfprintf""" 8 +.el .IP \f(CWvfprintf\fR 8 +.IX Item "vfprintf" +Not implemented. \f(CWvfprintf()\fR is C\-specific, see "printf" in perlfunc instead. +.ie n .IP """vprintf""" 8 +.el .IP \f(CWvprintf\fR 8 +.IX Item "vprintf" +Not implemented. \f(CWvprintf()\fR is C\-specific, see "printf" in perlfunc instead. +.ie n .IP """vsprintf""" 8 +.el .IP \f(CWvsprintf\fR 8 +.IX Item "vsprintf" +Not implemented. \f(CWvsprintf()\fR is C\-specific, see "sprintf" in perlfunc instead. +.ie n .IP """wait""" 8 +.el .IP \f(CWwait\fR 8 +.IX Item "wait" +This is identical to Perl's builtin \f(CWwait()\fR function, +see "wait" in perlfunc. +.ie n .IP """waitpid""" 8 +.el .IP \f(CWwaitpid\fR 8 +.IX Item "waitpid" +Wait for a child process to change state. This is identical to Perl's +builtin \f(CWwaitpid()\fR function, see "waitpid" in perlfunc. +.Sp +.Vb 2 +\& $pid = POSIX::waitpid( \-1, POSIX::WNOHANG ); +\& print "status = ", ($? / 256), "\en"; +.Ve +.Sp +See "mblen". +.ie n .IP """wctomb""" 8 +.el .IP \f(CWwctomb\fR 8 +.IX Item "wctomb" +This is the same as the C function \f(CWwctomb()\fR on unthreaded perls. On +threaded perls, it transparently (almost) substitutes the more +thread-safe \f(CW\*(C`wcrtomb\*(C'\fR(3), if available, instead of \f(CW\*(C`wctomb\*(C'\fR. +.Sp +Core Perl does not have any support for wide and multibyte locales, +except Unicode UTF\-8 locales. This function, in conjunction with +"mblen" and "mbtowc" may be used to roll your own decoding/encoding +of other types of multi-byte locales. +.Sp +Use \f(CW\*(C`undef\*(C'\fR as the first parameter to this function to get the effect +of passing NULL as the first parameter to \f(CW\*(C`wctomb\*(C'\fR. This ignores the +second parameter, and resets any shift state to its initial value. The +return value is undefined if \f(CW\*(C`wcrtomb\*(C'\fR was substituted, so you should +never rely on it. +.Sp +When the first parameter is a scalar, the code point contained in the +scalar second parameter is converted into a multi-byte string and stored +into the first parameter scalar. This is based on the locale that +currently underlies the program, regardless of whether or not the +function is called from Perl code that is within the scope of \f(CW\*(C`use\ locale\*(C'\fR. The return value is the number of bytes stored; or negative +if the code point isn't representable in the current locale. Perl makes +no attempt at hiding from your code any differences in the \f(CW\*(C`errno\*(C'\fR +setting between \f(CW\*(C`wctomb\*(C'\fR and \f(CW\*(C`wcrtomb\*(C'\fR. It does set \f(CW\*(C`errno\*(C'\fR to 0 +before calling them. +.ie n .IP """write""" 8 +.el .IP \f(CWwrite\fR 8 +.IX Item "write" +Write to a file. This uses file descriptors such as those obtained by +calling \f(CW\*(C`POSIX::open\*(C'\fR. +.Sp +.Vb 3 +\& $fd = POSIX::open( "foo", &POSIX::O_WRONLY ); +\& $buf = "hello"; +\& $bytes = POSIX::write( $fd, $buf, 5 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.Sp +See also "syswrite" in perlfunc. +.SH CLASSES +.IX Header "CLASSES" +.ie n .SS """POSIX::SigAction""" +.el .SS \f(CWPOSIX::SigAction\fP +.IX Subsection "POSIX::SigAction" +.ie n .IP """new""" 8 +.el .IP \f(CWnew\fR 8 +.IX Item "new" +Creates a new \f(CW\*(C`POSIX::SigAction\*(C'\fR object which corresponds to the C +\&\f(CW\*(C`struct sigaction\*(C'\fR. This object will be destroyed automatically when +it is no longer needed. The first parameter is the handler, a sub +reference. The second parameter is a \f(CW\*(C`POSIX::SigSet\*(C'\fR object, it +defaults to the empty set. The third parameter contains the +\&\f(CW\*(C`sa_flags\*(C'\fR, it defaults to 0. +.Sp +.Vb 4 +\& $sigset = POSIX::SigSet\->new(SIGINT, SIGQUIT); +\& $sigaction = POSIX::SigAction\->new( +\& \e&handler, $sigset, &POSIX::SA_NOCLDSTOP +\& ); +.Ve +.Sp +This \f(CW\*(C`POSIX::SigAction\*(C'\fR object is intended for use with the \f(CWPOSIX::sigaction()\fR +function. +.ie n .IP """handler""" 8 +.el .IP \f(CWhandler\fR 8 +.IX Item "handler" +.PD 0 +.ie n .IP """mask""" 8 +.el .IP \f(CWmask\fR 8 +.IX Item "mask" +.ie n .IP """flags""" 8 +.el .IP \f(CWflags\fR 8 +.IX Item "flags" +.PD +accessor functions to get/set the values of a SigAction object. +.Sp +.Vb 2 +\& $sigset = $sigaction\->mask; +\& $sigaction\->flags(&POSIX::SA_RESTART); +.Ve +.ie n .IP """safe""" 8 +.el .IP \f(CWsafe\fR 8 +.IX Item "safe" +accessor function for the "safe signals" flag of a SigAction object; see +perlipc for general information on safe (a.k.a. "deferred") signals. If +you wish to handle a signal safely, use this accessor to set the "safe" flag +in the \f(CW\*(C`POSIX::SigAction\*(C'\fR object: +.Sp +.Vb 1 +\& $sigaction\->safe(1); +.Ve +.Sp +You may also examine the "safe" flag on the output action object which is +filled in when given as the third parameter to \f(CWPOSIX::sigaction()\fR: +.Sp +.Vb 4 +\& sigaction(SIGINT, $new_action, $old_action); +\& if ($old_action\->safe) { +\& # previous SIGINT handler used safe signals +\& } +.Ve +.ie n .SS """POSIX::SigRt""" +.el .SS \f(CWPOSIX::SigRt\fP +.IX Subsection "POSIX::SigRt" +.ie n .IP %SIGRT 8 +.el .IP \f(CW%SIGRT\fR 8 +.IX Item "%SIGRT" +A hash of the POSIX realtime signal handlers. It is an extension of +the standard \f(CW%SIG\fR, the \f(CW$POSIX::SIGRT{SIGRTMIN}\fR is roughly equivalent +to \f(CW$SIG{SIGRTMIN}\fR, but the right POSIX moves (see below) are made with +the \f(CW\*(C`POSIX::SigSet\*(C'\fR and \f(CW\*(C`POSIX::sigaction\*(C'\fR instead of accessing the \f(CW%SIG\fR. +.Sp +You can set the \f(CW%POSIX::SIGRT\fR elements to set the POSIX realtime +signal handlers, use \f(CW\*(C`delete\*(C'\fR and \f(CW\*(C`exists\*(C'\fR on the elements, and use +\&\f(CW\*(C`scalar\*(C'\fR on the \f(CW%POSIX::SIGRT\fR to find out how many POSIX realtime +signals there are available \f(CW\*(C`(SIGRTMAX\ \-\ SIGRTMIN\ +\ 1\*(C'\fR, the \f(CW\*(C`SIGRTMAX\*(C'\fR is +a valid POSIX realtime signal). +.Sp +Setting the \f(CW%SIGRT\fR elements is equivalent to calling this: +.Sp +.Vb 6 +\& sub new { +\& my ($rtsig, $handler, $flags) = @_; +\& my $sigset = POSIX::SigSet($rtsig); +\& my $sigact = POSIX::SigAction\->new($handler,$sigset,$flags); +\& sigaction($rtsig, $sigact); +\& } +.Ve +.Sp +The flags default to zero, if you want something different you can +either use \f(CW\*(C`local\*(C'\fR on \f(CW$POSIX::SigRt::SIGACTION_FLAGS\fR, or you can +derive from POSIX::SigRt and define your own \f(CWnew()\fR (the tied hash +STORE method of the \f(CW%SIGRT\fR calls \f(CW\*(C`new($rtsig, $handler, $SIGACTION_FLAGS)\*(C'\fR, +where the \f(CW$rtsig\fR ranges from zero to \f(CW\*(C`SIGRTMAX\ \-\ SIGRTMIN\ +\ 1)\*(C'\fR. +.Sp +Just as with any signal, you can use \f(CW\*(C`sigaction($rtsig, undef, $oa)\*(C'\fR to +retrieve the installed signal handler (or, rather, the signal action). +.Sp +\&\fBNOTE:\fR whether POSIX realtime signals really work in your system, or +whether Perl has been compiled so that it works with them, is outside +of this discussion. +.ie n .IP """SIGRTMIN""" 8 +.el .IP \f(CWSIGRTMIN\fR 8 +.IX Item "SIGRTMIN" +Return the minimum POSIX realtime signal number available, or \f(CW\*(C`undef\*(C'\fR +if no POSIX realtime signals are available. +.ie n .IP """SIGRTMAX""" 8 +.el .IP \f(CWSIGRTMAX\fR 8 +.IX Item "SIGRTMAX" +Return the maximum POSIX realtime signal number available, or \f(CW\*(C`undef\*(C'\fR +if no POSIX realtime signals are available. +.ie n .SS """POSIX::SigSet""" +.el .SS \f(CWPOSIX::SigSet\fP +.IX Subsection "POSIX::SigSet" +.ie n .IP """new""" 8 +.el .IP \f(CWnew\fR 8 +.IX Item "new" +Create a new SigSet object. This object will be destroyed automatically +when it is no longer needed. Arguments may be supplied to initialize the +set. +.Sp +Create an empty set. +.Sp +.Vb 1 +\& $sigset = POSIX::SigSet\->new; +.Ve +.Sp +Create a set with \f(CW\*(C`SIGUSR1\*(C'\fR. +.Sp +.Vb 1 +\& $sigset = POSIX::SigSet\->new( &POSIX::SIGUSR1 ); +.Ve +.Sp +Throws an error if any of the signals supplied cannot be added to the +set. +.ie n .IP """addset""" 8 +.el .IP \f(CWaddset\fR 8 +.IX Item "addset" +Add a signal to a SigSet object. +.Sp +.Vb 1 +\& $sigset\->addset( &POSIX::SIGUSR2 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """delset""" 8 +.el .IP \f(CWdelset\fR 8 +.IX Item "delset" +Remove a signal from the SigSet object. +.Sp +.Vb 1 +\& $sigset\->delset( &POSIX::SIGUSR2 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """emptyset""" 8 +.el .IP \f(CWemptyset\fR 8 +.IX Item "emptyset" +Initialize the SigSet object to be empty. +.Sp +.Vb 1 +\& $sigset\->emptyset(); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """fillset""" 8 +.el .IP \f(CWfillset\fR 8 +.IX Item "fillset" +Initialize the SigSet object to include all signals. +.Sp +.Vb 1 +\& $sigset\->fillset(); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """ismember""" 8 +.el .IP \f(CWismember\fR 8 +.IX Item "ismember" +Tests the SigSet object to see if it contains a specific signal. +.Sp +.Vb 3 +\& if( $sigset\->ismember( &POSIX::SIGUSR1 ) ){ +\& print "contains SIGUSR1\en"; +\& } +.Ve +.ie n .SS """POSIX::Termios""" +.el .SS \f(CWPOSIX::Termios\fP +.IX Subsection "POSIX::Termios" +.ie n .IP """new""" 8 +.el .IP \f(CWnew\fR 8 +.IX Item "new" +Create a new Termios object. This object will be destroyed automatically +when it is no longer needed. A Termios object corresponds to the \f(CW\*(C`termios\*(C'\fR +C struct. \f(CWnew()\fR mallocs a new one, \f(CWgetattr()\fR fills it from a file descriptor, +and \f(CWsetattr()\fR sets a file descriptor's parameters to match Termios' contents. +.Sp +.Vb 1 +\& $termios = POSIX::Termios\->new; +.Ve +.ie n .IP """getattr""" 8 +.el .IP \f(CWgetattr\fR 8 +.IX Item "getattr" +Get terminal control attributes. +.Sp +Obtain the attributes for \f(CW\*(C`stdin\*(C'\fR. +.Sp +.Vb 2 +\& $termios\->getattr( 0 ) # Recommended for clarity. +\& $termios\->getattr() +.Ve +.Sp +Obtain the attributes for stdout. +.Sp +.Vb 1 +\& $termios\->getattr( 1 ) +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """getcc""" 8 +.el .IP \f(CWgetcc\fR 8 +.IX Item "getcc" +Retrieve a value from the \f(CW\*(C`c_cc\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. The \f(CW\*(C`c_cc\*(C'\fR field is +an array so an index must be specified. +.Sp +.Vb 1 +\& $c_cc[1] = $termios\->getcc(1); +.Ve +.ie n .IP """getcflag""" 8 +.el .IP \f(CWgetcflag\fR 8 +.IX Item "getcflag" +Retrieve the \f(CW\*(C`c_cflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $c_cflag = $termios\->getcflag; +.Ve +.ie n .IP """getiflag""" 8 +.el .IP \f(CWgetiflag\fR 8 +.IX Item "getiflag" +Retrieve the \f(CW\*(C`c_iflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $c_iflag = $termios\->getiflag; +.Ve +.ie n .IP """getispeed""" 8 +.el .IP \f(CWgetispeed\fR 8 +.IX Item "getispeed" +Retrieve the input baud rate. +.Sp +.Vb 1 +\& $ispeed = $termios\->getispeed; +.Ve +.ie n .IP """getlflag""" 8 +.el .IP \f(CWgetlflag\fR 8 +.IX Item "getlflag" +Retrieve the \f(CW\*(C`c_lflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $c_lflag = $termios\->getlflag; +.Ve +.ie n .IP """getoflag""" 8 +.el .IP \f(CWgetoflag\fR 8 +.IX Item "getoflag" +Retrieve the \f(CW\*(C`c_oflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $c_oflag = $termios\->getoflag; +.Ve +.ie n .IP """getospeed""" 8 +.el .IP \f(CWgetospeed\fR 8 +.IX Item "getospeed" +Retrieve the output baud rate. +.Sp +.Vb 1 +\& $ospeed = $termios\->getospeed; +.Ve +.ie n .IP """setattr""" 8 +.el .IP \f(CWsetattr\fR 8 +.IX Item "setattr" +Set terminal control attributes. +.Sp +Set attributes immediately for stdout. +.Sp +.Vb 1 +\& $termios\->setattr( 1, &POSIX::TCSANOW ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """setcc""" 8 +.el .IP \f(CWsetcc\fR 8 +.IX Item "setcc" +Set a value in the \f(CW\*(C`c_cc\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. The \f(CW\*(C`c_cc\*(C'\fR field is an +array so an index must be specified. +.Sp +.Vb 1 +\& $termios\->setcc( &POSIX::VEOF, 1 ); +.Ve +.ie n .IP """setcflag""" 8 +.el .IP \f(CWsetcflag\fR 8 +.IX Item "setcflag" +Set the \f(CW\*(C`c_cflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $termios\->setcflag( $c_cflag | &POSIX::CLOCAL ); +.Ve +.ie n .IP """setiflag""" 8 +.el .IP \f(CWsetiflag\fR 8 +.IX Item "setiflag" +Set the \f(CW\*(C`c_iflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $termios\->setiflag( $c_iflag | &POSIX::BRKINT ); +.Ve +.ie n .IP """setispeed""" 8 +.el .IP \f(CWsetispeed\fR 8 +.IX Item "setispeed" +Set the input baud rate. +.Sp +.Vb 1 +\& $termios\->setispeed( &POSIX::B9600 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.ie n .IP """setlflag""" 8 +.el .IP \f(CWsetlflag\fR 8 +.IX Item "setlflag" +Set the \f(CW\*(C`c_lflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $termios\->setlflag( $c_lflag | &POSIX::ECHO ); +.Ve +.ie n .IP """setoflag""" 8 +.el .IP \f(CWsetoflag\fR 8 +.IX Item "setoflag" +Set the \f(CW\*(C`c_oflag\*(C'\fR field of a \f(CW\*(C`termios\*(C'\fR object. +.Sp +.Vb 1 +\& $termios\->setoflag( $c_oflag | &POSIX::OPOST ); +.Ve +.ie n .IP """setospeed""" 8 +.el .IP \f(CWsetospeed\fR 8 +.IX Item "setospeed" +Set the output baud rate. +.Sp +.Vb 1 +\& $termios\->setospeed( &POSIX::B9600 ); +.Ve +.Sp +Returns \f(CW\*(C`undef\*(C'\fR on failure. +.IP "Baud rate values" 8 +.IX Item "Baud rate values" +\&\f(CW\*(C`B38400\*(C'\fR \f(CW\*(C`B75\*(C'\fR \f(CW\*(C`B200\*(C'\fR \f(CW\*(C`B134\*(C'\fR \f(CW\*(C`B300\*(C'\fR \f(CW\*(C`B1800\*(C'\fR \f(CW\*(C`B150\*(C'\fR \f(CW\*(C`B0\*(C'\fR \f(CW\*(C`B19200\*(C'\fR \f(CW\*(C`B1200\*(C'\fR \f(CW\*(C`B9600\*(C'\fR \f(CW\*(C`B600\*(C'\fR \f(CW\*(C`B4800\*(C'\fR \f(CW\*(C`B50\*(C'\fR \f(CW\*(C`B2400\*(C'\fR \f(CW\*(C`B110\*(C'\fR +.IP "Terminal interface values" 8 +.IX Item "Terminal interface values" +\&\f(CW\*(C`TCSADRAIN\*(C'\fR \f(CW\*(C`TCSANOW\*(C'\fR \f(CW\*(C`TCOON\*(C'\fR \f(CW\*(C`TCIOFLUSH\*(C'\fR \f(CW\*(C`TCOFLUSH\*(C'\fR \f(CW\*(C`TCION\*(C'\fR \f(CW\*(C`TCIFLUSH\*(C'\fR \f(CW\*(C`TCSAFLUSH\*(C'\fR \f(CW\*(C`TCIOFF\*(C'\fR \f(CW\*(C`TCOOFF\*(C'\fR +.ie n .IP """c_cc"" field values" 8 +.el .IP "\f(CWc_cc\fR field values" 8 +.IX Item "c_cc field values" +\&\f(CW\*(C`VEOF\*(C'\fR \f(CW\*(C`VEOL\*(C'\fR \f(CW\*(C`VERASE\*(C'\fR \f(CW\*(C`VINTR\*(C'\fR \f(CW\*(C`VKILL\*(C'\fR \f(CW\*(C`VQUIT\*(C'\fR \f(CW\*(C`VSUSP\*(C'\fR \f(CW\*(C`VSTART\*(C'\fR \f(CW\*(C`VSTOP\*(C'\fR \f(CW\*(C`VMIN\*(C'\fR \f(CW\*(C`VTIME\*(C'\fR \f(CW\*(C`NCCS\*(C'\fR +.ie n .IP """c_cflag"" field values" 8 +.el .IP "\f(CWc_cflag\fR field values" 8 +.IX Item "c_cflag field values" +\&\f(CW\*(C`CLOCAL\*(C'\fR \f(CW\*(C`CREAD\*(C'\fR \f(CW\*(C`CSIZE\*(C'\fR \f(CW\*(C`CS5\*(C'\fR \f(CW\*(C`CS6\*(C'\fR \f(CW\*(C`CS7\*(C'\fR \f(CW\*(C`CS8\*(C'\fR \f(CW\*(C`CSTOPB\*(C'\fR \f(CW\*(C`HUPCL\*(C'\fR \f(CW\*(C`PARENB\*(C'\fR \f(CW\*(C`PARODD\*(C'\fR +.ie n .IP """c_iflag"" field values" 8 +.el .IP "\f(CWc_iflag\fR field values" 8 +.IX Item "c_iflag field values" +\&\f(CW\*(C`BRKINT\*(C'\fR \f(CW\*(C`ICRNL\*(C'\fR \f(CW\*(C`IGNBRK\*(C'\fR \f(CW\*(C`IGNCR\*(C'\fR \f(CW\*(C`IGNPAR\*(C'\fR \f(CW\*(C`INLCR\*(C'\fR \f(CW\*(C`INPCK\*(C'\fR \f(CW\*(C`ISTRIP\*(C'\fR \f(CW\*(C`IXOFF\*(C'\fR \f(CW\*(C`IXON\*(C'\fR \f(CW\*(C`PARMRK\*(C'\fR +.ie n .IP """c_lflag"" field values" 8 +.el .IP "\f(CWc_lflag\fR field values" 8 +.IX Item "c_lflag field values" +\&\f(CW\*(C`ECHO\*(C'\fR \f(CW\*(C`ECHOE\*(C'\fR \f(CW\*(C`ECHOK\*(C'\fR \f(CW\*(C`ECHONL\*(C'\fR \f(CW\*(C`ICANON\*(C'\fR \f(CW\*(C`IEXTEN\*(C'\fR \f(CW\*(C`ISIG\*(C'\fR \f(CW\*(C`NOFLSH\*(C'\fR \f(CW\*(C`TOSTOP\*(C'\fR +.ie n .IP """c_oflag"" field values" 8 +.el .IP "\f(CWc_oflag\fR field values" 8 +.IX Item "c_oflag field values" +\&\f(CW\*(C`OPOST\*(C'\fR +.SH "PATHNAME CONSTANTS" +.IX Header "PATHNAME CONSTANTS" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`_PC_CHOWN_RESTRICTED\*(C'\fR \f(CW\*(C`_PC_LINK_MAX\*(C'\fR \f(CW\*(C`_PC_MAX_CANON\*(C'\fR \f(CW\*(C`_PC_MAX_INPUT\*(C'\fR \f(CW\*(C`_PC_NAME_MAX\*(C'\fR +\&\f(CW\*(C`_PC_NO_TRUNC\*(C'\fR \f(CW\*(C`_PC_PATH_MAX\*(C'\fR \f(CW\*(C`_PC_PIPE_BUF\*(C'\fR \f(CW\*(C`_PC_VDISABLE\*(C'\fR +.SH "POSIX CONSTANTS" +.IX Header "POSIX CONSTANTS" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`_POSIX_ARG_MAX\*(C'\fR \f(CW\*(C`_POSIX_CHILD_MAX\*(C'\fR \f(CW\*(C`_POSIX_CHOWN_RESTRICTED\*(C'\fR \f(CW\*(C`_POSIX_JOB_CONTROL\*(C'\fR +\&\f(CW\*(C`_POSIX_LINK_MAX\*(C'\fR \f(CW\*(C`_POSIX_MAX_CANON\*(C'\fR \f(CW\*(C`_POSIX_MAX_INPUT\*(C'\fR \f(CW\*(C`_POSIX_NAME_MAX\*(C'\fR +\&\f(CW\*(C`_POSIX_NGROUPS_MAX\*(C'\fR \f(CW\*(C`_POSIX_NO_TRUNC\*(C'\fR \f(CW\*(C`_POSIX_OPEN_MAX\*(C'\fR \f(CW\*(C`_POSIX_PATH_MAX\*(C'\fR +\&\f(CW\*(C`_POSIX_PIPE_BUF\*(C'\fR \f(CW\*(C`_POSIX_SAVED_IDS\*(C'\fR \f(CW\*(C`_POSIX_SSIZE_MAX\*(C'\fR \f(CW\*(C`_POSIX_STREAM_MAX\*(C'\fR +\&\f(CW\*(C`_POSIX_TZNAME_MAX\*(C'\fR \f(CW\*(C`_POSIX_VDISABLE\*(C'\fR \f(CW\*(C`_POSIX_VERSION\*(C'\fR +.SH "RESOURCE CONSTANTS" +.IX Header "RESOURCE CONSTANTS" +Imported with the \f(CW\*(C`:sys_resource_h\*(C'\fR tag. +.IP Constants 8 +.IX Item "Constants" +Added in Perl v5.28: +.Sp +\&\f(CW\*(C`PRIO_PROCESS\*(C'\fR \f(CW\*(C`PRIO_PGRP\*(C'\fR \f(CW\*(C`PRIO_USER\*(C'\fR +.SH "SYSTEM CONFIGURATION" +.IX Header "SYSTEM CONFIGURATION" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`_SC_ARG_MAX\*(C'\fR \f(CW\*(C`_SC_CHILD_MAX\*(C'\fR \f(CW\*(C`_SC_CLK_TCK\*(C'\fR \f(CW\*(C`_SC_JOB_CONTROL\*(C'\fR \f(CW\*(C`_SC_NGROUPS_MAX\*(C'\fR +\&\f(CW\*(C`_SC_OPEN_MAX\*(C'\fR \f(CW\*(C`_SC_PAGESIZE\*(C'\fR \f(CW\*(C`_SC_SAVED_IDS\*(C'\fR \f(CW\*(C`_SC_STREAM_MAX\*(C'\fR \f(CW\*(C`_SC_TZNAME_MAX\*(C'\fR +\&\f(CW\*(C`_SC_VERSION\*(C'\fR +.SH ERRNO +.IX Header "ERRNO" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`E2BIG\*(C'\fR \f(CW\*(C`EACCES\*(C'\fR \f(CW\*(C`EADDRINUSE\*(C'\fR \f(CW\*(C`EADDRNOTAVAIL\*(C'\fR \f(CW\*(C`EAFNOSUPPORT\*(C'\fR \f(CW\*(C`EAGAIN\*(C'\fR \f(CW\*(C`EALREADY\*(C'\fR \f(CW\*(C`EBADF\*(C'\fR \f(CW\*(C`EBADMSG\*(C'\fR +\&\f(CW\*(C`EBUSY\*(C'\fR \f(CW\*(C`ECANCELED\*(C'\fR \f(CW\*(C`ECHILD\*(C'\fR \f(CW\*(C`ECONNABORTED\*(C'\fR \f(CW\*(C`ECONNREFUSED\*(C'\fR \f(CW\*(C`ECONNRESET\*(C'\fR \f(CW\*(C`EDEADLK\*(C'\fR \f(CW\*(C`EDESTADDRREQ\*(C'\fR +\&\f(CW\*(C`EDOM\*(C'\fR \f(CW\*(C`EDQUOT\*(C'\fR \f(CW\*(C`EEXIST\*(C'\fR \f(CW\*(C`EFAULT\*(C'\fR \f(CW\*(C`EFBIG\*(C'\fR \f(CW\*(C`EHOSTDOWN\*(C'\fR \f(CW\*(C`EHOSTUNREACH\*(C'\fR \f(CW\*(C`EIDRM\*(C'\fR \f(CW\*(C`EILSEQ\*(C'\fR \f(CW\*(C`EINPROGRESS\*(C'\fR +\&\f(CW\*(C`EINTR\*(C'\fR \f(CW\*(C`EINVAL\*(C'\fR \f(CW\*(C`EIO\*(C'\fR \f(CW\*(C`EISCONN\*(C'\fR \f(CW\*(C`EISDIR\*(C'\fR \f(CW\*(C`ELOOP\*(C'\fR \f(CW\*(C`EMFILE\*(C'\fR \f(CW\*(C`EMLINK\*(C'\fR \f(CW\*(C`EMSGSIZE\*(C'\fR \f(CW\*(C`ENAMETOOLONG\*(C'\fR +\&\f(CW\*(C`ENETDOWN\*(C'\fR \f(CW\*(C`ENETRESET\*(C'\fR \f(CW\*(C`ENETUNREACH\*(C'\fR \f(CW\*(C`ENFILE\*(C'\fR \f(CW\*(C`ENOBUFS\*(C'\fR \f(CW\*(C`ENODATA\*(C'\fR \f(CW\*(C`ENODEV\*(C'\fR \f(CW\*(C`ENOENT\*(C'\fR \f(CW\*(C`ENOEXEC\*(C'\fR +\&\f(CW\*(C`ENOLCK\*(C'\fR \f(CW\*(C`ENOLINK\*(C'\fR \f(CW\*(C`ENOMEM\*(C'\fR \f(CW\*(C`ENOMSG\*(C'\fR \f(CW\*(C`ENOPROTOOPT\*(C'\fR \f(CW\*(C`ENOSPC\*(C'\fR \f(CW\*(C`ENOSR\*(C'\fR \f(CW\*(C`ENOSTR\*(C'\fR \f(CW\*(C`ENOSYS\*(C'\fR \f(CW\*(C`ENOTBLK\*(C'\fR +\&\f(CW\*(C`ENOTCONN\*(C'\fR \f(CW\*(C`ENOTDIR\*(C'\fR \f(CW\*(C`ENOTEMPTY\*(C'\fR \f(CW\*(C`ENOTRECOVERABLE\*(C'\fR \f(CW\*(C`ENOTSOCK\*(C'\fR \f(CW\*(C`ENOTSUP\*(C'\fR \f(CW\*(C`ENOTTY\*(C'\fR \f(CW\*(C`ENXIO\*(C'\fR +\&\f(CW\*(C`EOPNOTSUPP\*(C'\fR \f(CW\*(C`EOTHER\*(C'\fR \f(CW\*(C`EOVERFLOW\*(C'\fR \f(CW\*(C`EOWNERDEAD\*(C'\fR \f(CW\*(C`EPERM\*(C'\fR \f(CW\*(C`EPFNOSUPPORT\*(C'\fR \f(CW\*(C`EPIPE\*(C'\fR \f(CW\*(C`EPROCLIM\*(C'\fR \f(CW\*(C`EPROTO\*(C'\fR +\&\f(CW\*(C`EPROTONOSUPPORT\*(C'\fR \f(CW\*(C`EPROTOTYPE\*(C'\fR \f(CW\*(C`ERANGE\*(C'\fR \f(CW\*(C`EREMOTE\*(C'\fR \f(CW\*(C`ERESTART\*(C'\fR \f(CW\*(C`EROFS\*(C'\fR \f(CW\*(C`ESHUTDOWN\*(C'\fR +\&\f(CW\*(C`ESOCKTNOSUPPORT\*(C'\fR \f(CW\*(C`ESPIPE\*(C'\fR \f(CW\*(C`ESRCH\*(C'\fR \f(CW\*(C`ESTALE\*(C'\fR \f(CW\*(C`ETIME\*(C'\fR \f(CW\*(C`ETIMEDOUT\*(C'\fR \f(CW\*(C`ETOOMANYREFS\*(C'\fR \f(CW\*(C`ETXTBSY\*(C'\fR \f(CW\*(C`EUSERS\*(C'\fR +\&\f(CW\*(C`EWOULDBLOCK\*(C'\fR \f(CW\*(C`EXDEV\*(C'\fR +.SH FCNTL +.IX Header "FCNTL" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`FD_CLOEXEC\*(C'\fR \f(CW\*(C`F_DUPFD\*(C'\fR \f(CW\*(C`F_GETFD\*(C'\fR \f(CW\*(C`F_GETFL\*(C'\fR \f(CW\*(C`F_GETLK\*(C'\fR \f(CW\*(C`F_OK\*(C'\fR \f(CW\*(C`F_RDLCK\*(C'\fR \f(CW\*(C`F_SETFD\*(C'\fR \f(CW\*(C`F_SETFL\*(C'\fR \f(CW\*(C`F_SETLK\*(C'\fR +\&\f(CW\*(C`F_SETLKW\*(C'\fR \f(CW\*(C`F_UNLCK\*(C'\fR \f(CW\*(C`F_WRLCK\*(C'\fR \f(CW\*(C`O_ACCMODE\*(C'\fR \f(CW\*(C`O_APPEND\*(C'\fR \f(CW\*(C`O_CREAT\*(C'\fR \f(CW\*(C`O_EXCL\*(C'\fR \f(CW\*(C`O_NOCTTY\*(C'\fR \f(CW\*(C`O_NONBLOCK\*(C'\fR +\&\f(CW\*(C`O_RDONLY\*(C'\fR \f(CW\*(C`O_RDWR\*(C'\fR \f(CW\*(C`O_TRUNC\*(C'\fR \f(CW\*(C`O_WRONLY\*(C'\fR +.SH FLOAT +.IX Header "FLOAT" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`DBL_DIG\*(C'\fR \f(CW\*(C`DBL_EPSILON\*(C'\fR \f(CW\*(C`DBL_MANT_DIG\*(C'\fR \f(CW\*(C`DBL_MAX\*(C'\fR \f(CW\*(C`DBL_MAX_10_EXP\*(C'\fR \f(CW\*(C`DBL_MAX_EXP\*(C'\fR \f(CW\*(C`DBL_MIN\*(C'\fR +\&\f(CW\*(C`DBL_MIN_10_EXP\*(C'\fR \f(CW\*(C`DBL_MIN_EXP\*(C'\fR \f(CW\*(C`FLT_DIG\*(C'\fR \f(CW\*(C`FLT_EPSILON\*(C'\fR \f(CW\*(C`FLT_MANT_DIG\*(C'\fR \f(CW\*(C`FLT_MAX\*(C'\fR +\&\f(CW\*(C`FLT_MAX_10_EXP\*(C'\fR \f(CW\*(C`FLT_MAX_EXP\*(C'\fR \f(CW\*(C`FLT_MIN\*(C'\fR \f(CW\*(C`FLT_MIN_10_EXP\*(C'\fR \f(CW\*(C`FLT_MIN_EXP\*(C'\fR \f(CW\*(C`FLT_RADIX\*(C'\fR +\&\f(CW\*(C`FLT_ROUNDS\*(C'\fR \f(CW\*(C`LDBL_DIG\*(C'\fR \f(CW\*(C`LDBL_EPSILON\*(C'\fR \f(CW\*(C`LDBL_MANT_DIG\*(C'\fR \f(CW\*(C`LDBL_MAX\*(C'\fR \f(CW\*(C`LDBL_MAX_10_EXP\*(C'\fR +\&\f(CW\*(C`LDBL_MAX_EXP\*(C'\fR \f(CW\*(C`LDBL_MIN\*(C'\fR \f(CW\*(C`LDBL_MIN_10_EXP\*(C'\fR \f(CW\*(C`LDBL_MIN_EXP\*(C'\fR +.SH "FLOATING-POINT ENVIRONMENT" +.IX Header "FLOATING-POINT ENVIRONMENT" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`FE_DOWNWARD\*(C'\fR \f(CW\*(C`FE_TONEAREST\*(C'\fR \f(CW\*(C`FE_TOWARDZERO\*(C'\fR \f(CW\*(C`FE_UPWARD\*(C'\fR +on systems that support them. +.SH LIMITS +.IX Header "LIMITS" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`ARG_MAX\*(C'\fR \f(CW\*(C`CHAR_BIT\*(C'\fR \f(CW\*(C`CHAR_MAX\*(C'\fR \f(CW\*(C`CHAR_MIN\*(C'\fR \f(CW\*(C`CHILD_MAX\*(C'\fR \f(CW\*(C`INT_MAX\*(C'\fR \f(CW\*(C`INT_MIN\*(C'\fR \f(CW\*(C`LINK_MAX\*(C'\fR \f(CW\*(C`LONG_MAX\*(C'\fR +\&\f(CW\*(C`LONG_MIN\*(C'\fR \f(CW\*(C`MAX_CANON\*(C'\fR \f(CW\*(C`MAX_INPUT\*(C'\fR \f(CW\*(C`MB_LEN_MAX\*(C'\fR \f(CW\*(C`NAME_MAX\*(C'\fR \f(CW\*(C`NGROUPS_MAX\*(C'\fR \f(CW\*(C`OPEN_MAX\*(C'\fR \f(CW\*(C`PATH_MAX\*(C'\fR +\&\f(CW\*(C`PIPE_BUF\*(C'\fR \f(CW\*(C`SCHAR_MAX\*(C'\fR \f(CW\*(C`SCHAR_MIN\*(C'\fR \f(CW\*(C`SHRT_MAX\*(C'\fR \f(CW\*(C`SHRT_MIN\*(C'\fR \f(CW\*(C`SSIZE_MAX\*(C'\fR \f(CW\*(C`STREAM_MAX\*(C'\fR \f(CW\*(C`TZNAME_MAX\*(C'\fR +\&\f(CW\*(C`UCHAR_MAX\*(C'\fR \f(CW\*(C`UINT_MAX\*(C'\fR \f(CW\*(C`ULONG_MAX\*(C'\fR \f(CW\*(C`USHRT_MAX\*(C'\fR +.SH LOCALE +.IX Header "LOCALE" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`LC_ALL\*(C'\fR \f(CW\*(C`LC_COLLATE\*(C'\fR \f(CW\*(C`LC_CTYPE\*(C'\fR \f(CW\*(C`LC_MONETARY\*(C'\fR \f(CW\*(C`LC_NUMERIC\*(C'\fR \f(CW\*(C`LC_TIME\*(C'\fR \f(CW\*(C`LC_MESSAGES\*(C'\fR +on systems that support them. +.SH MATH +.IX Header "MATH" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`HUGE_VAL\*(C'\fR +.Sp +Added in Perl v5.22: +.Sp +\&\f(CW\*(C`FP_ILOGB0\*(C'\fR \f(CW\*(C`FP_ILOGBNAN\*(C'\fR \f(CW\*(C`FP_INFINITE\*(C'\fR \f(CW\*(C`FP_NAN\*(C'\fR \f(CW\*(C`FP_NORMAL\*(C'\fR \f(CW\*(C`FP_SUBNORMAL\*(C'\fR \f(CW\*(C`FP_ZERO\*(C'\fR +\&\f(CW\*(C`INFINITY\*(C'\fR \f(CW\*(C`NAN\*(C'\fR \f(CW\*(C`Inf\*(C'\fR \f(CW\*(C`NaN\*(C'\fR +\&\f(CW\*(C`M_1_PI\*(C'\fR \f(CW\*(C`M_2_PI\*(C'\fR \f(CW\*(C`M_2_SQRTPI\*(C'\fR \f(CW\*(C`M_E\*(C'\fR \f(CW\*(C`M_LN10\*(C'\fR \f(CW\*(C`M_LN2\*(C'\fR \f(CW\*(C`M_LOG10E\*(C'\fR \f(CW\*(C`M_LOG2E\*(C'\fR \f(CW\*(C`M_PI\*(C'\fR +\&\f(CW\*(C`M_PI_2\*(C'\fR \f(CW\*(C`M_PI_4\*(C'\fR \f(CW\*(C`M_SQRT1_2\*(C'\fR \f(CW\*(C`M_SQRT2\*(C'\fR +on systems with C99 support. +.SH SIGNAL +.IX Header "SIGNAL" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`SA_NOCLDSTOP\*(C'\fR \f(CW\*(C`SA_NOCLDWAIT\*(C'\fR \f(CW\*(C`SA_NODEFER\*(C'\fR \f(CW\*(C`SA_ONSTACK\*(C'\fR \f(CW\*(C`SA_RESETHAND\*(C'\fR \f(CW\*(C`SA_RESTART\*(C'\fR +\&\f(CW\*(C`SA_SIGINFO\*(C'\fR \f(CW\*(C`SIGABRT\*(C'\fR \f(CW\*(C`SIGALRM\*(C'\fR \f(CW\*(C`SIGCHLD\*(C'\fR \f(CW\*(C`SIGCONT\*(C'\fR \f(CW\*(C`SIGFPE\*(C'\fR \f(CW\*(C`SIGHUP\*(C'\fR \f(CW\*(C`SIGILL\*(C'\fR \f(CW\*(C`SIGINT\*(C'\fR +\&\f(CW\*(C`SIGKILL\*(C'\fR \f(CW\*(C`SIGPIPE\*(C'\fR \f(CW\*(C`SIGQUIT\*(C'\fR \f(CW\*(C`SIGSEGV\*(C'\fR \f(CW\*(C`SIGSTOP\*(C'\fR \f(CW\*(C`SIGTERM\*(C'\fR \f(CW\*(C`SIGTSTP\*(C'\fR \f(CW\*(C`SIGTTIN\*(C'\fR \f(CW\*(C`SIGTTOU\*(C'\fR +\&\f(CW\*(C`SIGUSR1\*(C'\fR \f(CW\*(C`SIGUSR2\*(C'\fR \f(CW\*(C`SIG_BLOCK\*(C'\fR \f(CW\*(C`SIG_DFL\*(C'\fR \f(CW\*(C`SIG_ERR\*(C'\fR \f(CW\*(C`SIG_IGN\*(C'\fR \f(CW\*(C`SIG_SETMASK\*(C'\fR +\&\f(CW\*(C`SIG_UNBLOCK\*(C'\fR +.Sp +Added in Perl v5.24: +.Sp +\&\f(CW\*(C`ILL_ILLOPC\*(C'\fR \f(CW\*(C`ILL_ILLOPN\*(C'\fR \f(CW\*(C`ILL_ILLADR\*(C'\fR \f(CW\*(C`ILL_ILLTRP\*(C'\fR \f(CW\*(C`ILL_PRVOPC\*(C'\fR \f(CW\*(C`ILL_PRVREG\*(C'\fR \f(CW\*(C`ILL_COPROC\*(C'\fR +\&\f(CW\*(C`ILL_BADSTK\*(C'\fR \f(CW\*(C`FPE_INTDIV\*(C'\fR \f(CW\*(C`FPE_INTOVF\*(C'\fR \f(CW\*(C`FPE_FLTDIV\*(C'\fR \f(CW\*(C`FPE_FLTOVF\*(C'\fR \f(CW\*(C`FPE_FLTUND\*(C'\fR \f(CW\*(C`FPE_FLTRES\*(C'\fR +\&\f(CW\*(C`FPE_FLTINV\*(C'\fR \f(CW\*(C`FPE_FLTSUB\*(C'\fR \f(CW\*(C`SEGV_MAPERR\*(C'\fR \f(CW\*(C`SEGV_ACCERR\*(C'\fR \f(CW\*(C`BUS_ADRALN\*(C'\fR \f(CW\*(C`BUS_ADRERR\*(C'\fR +\&\f(CW\*(C`BUS_OBJERR\*(C'\fR \f(CW\*(C`TRAP_BRKPT\*(C'\fR \f(CW\*(C`TRAP_TRACE\*(C'\fR \f(CW\*(C`CLD_EXITED\*(C'\fR \f(CW\*(C`CLD_KILLED\*(C'\fR \f(CW\*(C`CLD_DUMPED\*(C'\fR \f(CW\*(C`CLD_TRAPPED\*(C'\fR +\&\f(CW\*(C`CLD_STOPPED\*(C'\fR \f(CW\*(C`CLD_CONTINUED\*(C'\fR \f(CW\*(C`POLL_IN\*(C'\fR \f(CW\*(C`POLL_OUT\*(C'\fR \f(CW\*(C`POLL_MSG\*(C'\fR \f(CW\*(C`POLL_ERR\*(C'\fR \f(CW\*(C`POLL_PRI\*(C'\fR +\&\f(CW\*(C`POLL_HUP\*(C'\fR \f(CW\*(C`SI_USER\*(C'\fR \f(CW\*(C`SI_QUEUE\*(C'\fR \f(CW\*(C`SI_TIMER\*(C'\fR \f(CW\*(C`SI_ASYNCIO\*(C'\fR \f(CW\*(C`SI_MESGQ\*(C'\fR +.SH STAT +.IX Header "STAT" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`S_IRGRP\*(C'\fR \f(CW\*(C`S_IROTH\*(C'\fR \f(CW\*(C`S_IRUSR\*(C'\fR \f(CW\*(C`S_IRWXG\*(C'\fR \f(CW\*(C`S_IRWXO\*(C'\fR \f(CW\*(C`S_IRWXU\*(C'\fR \f(CW\*(C`S_ISGID\*(C'\fR \f(CW\*(C`S_ISUID\*(C'\fR \f(CW\*(C`S_IWGRP\*(C'\fR \f(CW\*(C`S_IWOTH\*(C'\fR +\&\f(CW\*(C`S_IWUSR\*(C'\fR \f(CW\*(C`S_IXGRP\*(C'\fR \f(CW\*(C`S_IXOTH\*(C'\fR \f(CW\*(C`S_IXUSR\*(C'\fR +.IP Macros 8 +.IX Item "Macros" +\&\f(CW\*(C`S_ISBLK\*(C'\fR \f(CW\*(C`S_ISCHR\*(C'\fR \f(CW\*(C`S_ISDIR\*(C'\fR \f(CW\*(C`S_ISFIFO\*(C'\fR \f(CW\*(C`S_ISLNK\*(C'\fR \f(CW\*(C`S_ISREG\*(C'\fR \f(CW\*(C`S_ISSOCK\*(C'\fR +.SH STDLIB +.IX Header "STDLIB" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`EXIT_FAILURE\*(C'\fR \f(CW\*(C`EXIT_SUCCESS\*(C'\fR \f(CW\*(C`MB_CUR_MAX\*(C'\fR \f(CW\*(C`RAND_MAX\*(C'\fR +.SH STDIO +.IX Header "STDIO" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`BUFSIZ\*(C'\fR \f(CW\*(C`EOF\*(C'\fR \f(CW\*(C`FILENAME_MAX\*(C'\fR \f(CW\*(C`L_ctermid\*(C'\fR \f(CW\*(C`L_cuserid\*(C'\fR \f(CW\*(C`TMP_MAX\*(C'\fR +.SH TIME +.IX Header "TIME" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`CLK_TCK\*(C'\fR \f(CW\*(C`CLOCKS_PER_SEC\*(C'\fR +.SH UNISTD +.IX Header "UNISTD" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`R_OK\*(C'\fR \f(CW\*(C`SEEK_CUR\*(C'\fR \f(CW\*(C`SEEK_END\*(C'\fR \f(CW\*(C`SEEK_SET\*(C'\fR \f(CW\*(C`STDIN_FILENO\*(C'\fR \f(CW\*(C`STDOUT_FILENO\*(C'\fR \f(CW\*(C`STDERR_FILENO\*(C'\fR \f(CW\*(C`W_OK\*(C'\fR \f(CW\*(C`X_OK\*(C'\fR +.SH WAIT +.IX Header "WAIT" +.IP Constants 8 +.IX Item "Constants" +\&\f(CW\*(C`WNOHANG\*(C'\fR \f(CW\*(C`WUNTRACED\*(C'\fR +.RS 8 +.ie n .IP """WNOHANG""" 16 +.el .IP \f(CWWNOHANG\fR 16 +.IX Item "WNOHANG" +Do not suspend the calling process until a child process +changes state but instead return immediately. +.ie n .IP """WUNTRACED""" 16 +.el .IP \f(CWWUNTRACED\fR 16 +.IX Item "WUNTRACED" +Catch stopped child processes. +.RE +.RS 8 +.RE +.IP Macros 8 +.IX Item "Macros" +\&\f(CW\*(C`WIFEXITED\*(C'\fR \f(CW\*(C`WEXITSTATUS\*(C'\fR \f(CW\*(C`WIFSIGNALED\*(C'\fR \f(CW\*(C`WTERMSIG\*(C'\fR \f(CW\*(C`WIFSTOPPED\*(C'\fR \f(CW\*(C`WSTOPSIG\*(C'\fR +.RS 8 +.ie n .IP """WIFEXITED""" 16 +.el .IP \f(CWWIFEXITED\fR 16 +.IX Item "WIFEXITED" +\&\f(CWWIFEXITED(${^CHILD_ERROR_NATIVE})\fR returns true if the child process +exited normally (\f(CWexit()\fR or by falling off the end of \f(CWmain()\fR) +.ie n .IP """WEXITSTATUS""" 16 +.el .IP \f(CWWEXITSTATUS\fR 16 +.IX Item "WEXITSTATUS" +\&\f(CWWEXITSTATUS(${^CHILD_ERROR_NATIVE})\fR returns the normal exit status of +the child process (only meaningful if \f(CWWIFEXITED(${^CHILD_ERROR_NATIVE})\fR +is true) +.ie n .IP """WIFSIGNALED""" 16 +.el .IP \f(CWWIFSIGNALED\fR 16 +.IX Item "WIFSIGNALED" +\&\f(CWWIFSIGNALED(${^CHILD_ERROR_NATIVE})\fR returns true if the child process +terminated because of a signal +.ie n .IP """WTERMSIG""" 16 +.el .IP \f(CWWTERMSIG\fR 16 +.IX Item "WTERMSIG" +\&\f(CWWTERMSIG(${^CHILD_ERROR_NATIVE})\fR returns the signal the child process +terminated for (only meaningful if +\&\f(CWWIFSIGNALED(${^CHILD_ERROR_NATIVE})\fR +is true) +.ie n .IP """WIFSTOPPED""" 16 +.el .IP \f(CWWIFSTOPPED\fR 16 +.IX Item "WIFSTOPPED" +\&\f(CWWIFSTOPPED(${^CHILD_ERROR_NATIVE})\fR returns true if the child process is +currently stopped (can happen only if you specified the WUNTRACED flag +to \f(CWwaitpid()\fR) +.ie n .IP """WSTOPSIG""" 16 +.el .IP \f(CWWSTOPSIG\fR 16 +.IX Item "WSTOPSIG" +\&\f(CWWSTOPSIG(${^CHILD_ERROR_NATIVE})\fR returns the signal the child process +was stopped for (only meaningful if +\&\f(CWWIFSTOPPED(${^CHILD_ERROR_NATIVE})\fR +is true) +.RE +.RS 8 +.RE +.SH WINSOCK +.IX Header "WINSOCK" +(Windows only.) +.IP Constants 8 +.IX Item "Constants" +Added in Perl v5.24: +.Sp +\&\f(CW\*(C`WSAEINTR\*(C'\fR \f(CW\*(C`WSAEBADF\*(C'\fR \f(CW\*(C`WSAEACCES\*(C'\fR \f(CW\*(C`WSAEFAULT\*(C'\fR \f(CW\*(C`WSAEINVAL\*(C'\fR \f(CW\*(C`WSAEMFILE\*(C'\fR \f(CW\*(C`WSAEWOULDBLOCK\*(C'\fR +\&\f(CW\*(C`WSAEINPROGRESS\*(C'\fR \f(CW\*(C`WSAEALREADY\*(C'\fR \f(CW\*(C`WSAENOTSOCK\*(C'\fR \f(CW\*(C`WSAEDESTADDRREQ\*(C'\fR \f(CW\*(C`WSAEMSGSIZE\*(C'\fR +\&\f(CW\*(C`WSAEPROTOTYPE\*(C'\fR \f(CW\*(C`WSAENOPROTOOPT\*(C'\fR \f(CW\*(C`WSAEPROTONOSUPPORT\*(C'\fR \f(CW\*(C`WSAESOCKTNOSUPPORT\*(C'\fR +\&\f(CW\*(C`WSAEOPNOTSUPP\*(C'\fR \f(CW\*(C`WSAEPFNOSUPPORT\*(C'\fR \f(CW\*(C`WSAEAFNOSUPPORT\*(C'\fR \f(CW\*(C`WSAEADDRINUSE\*(C'\fR +\&\f(CW\*(C`WSAEADDRNOTAVAIL\*(C'\fR \f(CW\*(C`WSAENETDOWN\*(C'\fR \f(CW\*(C`WSAENETUNREACH\*(C'\fR \f(CW\*(C`WSAENETRESET\*(C'\fR \f(CW\*(C`WSAECONNABORTED\*(C'\fR +\&\f(CW\*(C`WSAECONNRESET\*(C'\fR \f(CW\*(C`WSAENOBUFS\*(C'\fR \f(CW\*(C`WSAEISCONN\*(C'\fR \f(CW\*(C`WSAENOTCONN\*(C'\fR \f(CW\*(C`WSAESHUTDOWN\*(C'\fR +\&\f(CW\*(C`WSAETOOMANYREFS\*(C'\fR \f(CW\*(C`WSAETIMEDOUT\*(C'\fR \f(CW\*(C`WSAECONNREFUSED\*(C'\fR \f(CW\*(C`WSAELOOP\*(C'\fR \f(CW\*(C`WSAENAMETOOLONG\*(C'\fR +\&\f(CW\*(C`WSAEHOSTDOWN\*(C'\fR \f(CW\*(C`WSAEHOSTUNREACH\*(C'\fR \f(CW\*(C`WSAENOTEMPTY\*(C'\fR \f(CW\*(C`WSAEPROCLIM\*(C'\fR \f(CW\*(C`WSAEUSERS\*(C'\fR +\&\f(CW\*(C`WSAEDQUOT\*(C'\fR \f(CW\*(C`WSAESTALE\*(C'\fR \f(CW\*(C`WSAEREMOTE\*(C'\fR \f(CW\*(C`WSAEDISCON\*(C'\fR \f(CW\*(C`WSAENOMORE\*(C'\fR \f(CW\*(C`WSAECANCELLED\*(C'\fR +\&\f(CW\*(C`WSAEINVALIDPROCTABLE\*(C'\fR \f(CW\*(C`WSAEINVALIDPROVIDER\*(C'\fR \f(CW\*(C`WSAEPROVIDERFAILEDINIT\*(C'\fR +\&\f(CW\*(C`WSAEREFUSED\*(C'\fR |