1POSIX(3pm)             Perl Programmers Reference Guide             POSIX(3pm)
2
3
4

NAME

6       POSIX - Perl interface to IEEE Std 1003.1
7

SYNOPSIS

9           use POSIX ();
10           use POSIX qw(setsid);
11           use POSIX qw(:errno_h :fcntl_h);
12
13           printf "EINTR is %d\n", EINTR;
14
15           $sess_id = POSIX::setsid();
16
17           $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
18               # note: that's a filedescriptor, *NOT* a filehandle
19

DESCRIPTION

21       The POSIX module permits you to access all (or nearly all) the standard
22       POSIX 1003.1 identifiers.  Many of these identifiers have been given
23       Perl-ish interfaces.
24
25       This document gives a condensed list of the features available in the
26       POSIX module.  Consult your operating system's manpages for general
27       information on most features.  Consult perlfunc for functions which are
28       noted as being identical or almost identical to Perl's builtin
29       functions.
30
31       The first section describes POSIX functions from the 1003.1
32       specification.  The second section describes some classes for signal
33       objects, TTY objects, and other miscellaneous objects.  The remaining
34       sections list various constants and macros in an organization which
35       roughly follows IEEE Std 1003.1b-1993.
36

CAVEATS

38       Everything is exported by default (with a handful of exceptions).  This
39       is an unfortunate backwards compatibility feature and its use is
40       strongly discouraged.  You should either prevent the exporting (by
41       saying "use POSIX ();", as usual) and then use fully qualified names
42       (e.g. "POSIX::SEEK_END"), or give an explicit import list.  If you do
43       neither and opt for the default (as in "use POSIX;"), you will import
44       hundreds and hundreds of symbols into your namespace.
45
46       A few functions are not implemented because they are C specific.  If
47       you attempt to call these, they will print a message telling you that
48       they aren't implemented, and suggest using the Perl equivalent, should
49       one exist.  For example, trying to access the "setjmp()" call will
50       elicit the message ""setjmp() is C-specific: use eval {} instead"".
51
52       Furthermore, some evil vendors will claim 1003.1 compliance, but in
53       fact are not so: they will not pass the PCTS (POSIX Compliance Test
54       Suites).  For example, one vendor may not define "EDEADLK", or the
55       semantics of the errno values set by open(2) might not be quite right.
56       Perl does not attempt to verify POSIX compliance.  That means you can
57       currently successfully say "use POSIX",  and then later in your program
58       you find that your vendor has been lax and there's no usable "ICANON"
59       macro after all.  This could be construed to be a bug.
60

FUNCTIONS

62       "_exit" This is identical to the C function "_exit()".  It exits the
63               program immediately which means among other things buffered I/O
64               is not flushed.
65
66               Note that when using threads and in Linux this is not a good
67               way to exit a thread because in Linux processes and threads are
68               kind of the same thing (Note: while this is the situation in
69               early 2003 there are projects under way to have threads with
70               more POSIXly semantics in Linux).  If you want not to return
71               from a thread, detach the thread.
72
73       "abort" This is identical to the C function "abort()".  It terminates
74               the process with a "SIGABRT" signal unless caught by a signal
75               handler or if the handler does not return normally (it e.g.
76               does a "longjmp").
77
78       "abs"   This is identical to Perl's builtin "abs()" function, returning
79               the absolute value of its numerical argument (except that
80               "POSIX::abs()" must be provided an explicit value (rather than
81               relying on an implicit $_):
82
83                   $absolute_value = POSIX::abs(42);   # good
84
85                   $absolute_value = POSIX::abs();     # throws exception
86
87       "access"
88               Determines the accessibility of a file.
89
90                       if( POSIX::access( "/", &POSIX::R_OK ) ){
91                               print "have read permission\n";
92                       }
93
94               Returns "undef" on failure.  Note: do not use "access()" for
95               security purposes.  Between the "access()" call and the
96               operation you are preparing for the permissions might change: a
97               classic race condition.
98
99       "acos"  This is identical to the C function "acos()", returning the
100               arcus cosine of its numerical argument.  See also Math::Trig.
101
102       "acosh" This is identical to the C function "acosh()", returning the
103               hyperbolic arcus cosine of its numerical argument [C99].  See
104               also Math::Trig.
105
106       "alarm" This is identical to Perl's builtin "alarm()" function, either
107               for arming or disarming the "SIGARLM" timer, except that
108               "POSIX::alarm()" must be provided an explicit value (rather
109               than relying on an implicit $_):
110
111                   POSIX::alarm(3)     # good
112
113                   POSIX::alarm()      # throws exception
114
115       "asctime"
116               This is identical to the C function "asctime()".  It returns a
117               string of the form
118
119                       "Fri Jun  2 18:22:13 2000\n\0"
120
121               and it is called thusly
122
123                       $asctime = asctime($sec, $min, $hour, $mday, $mon,
124                                          $year, $wday, $yday, $isdst);
125
126               The $mon is zero-based: January equals 0.  The $year is
127               1900-based: 2001 equals 101.  $wday and $yday default to zero
128               (and are usually ignored anyway), and $isdst defaults to -1.
129
130       "asin"  This is identical to the C function "asin()", returning the
131               arcus sine of its numerical argument.  See also Math::Trig.
132
133       "asinh" This is identical to the C function "asinh()", returning the
134               hyperbolic arcus sine of its numerical argument [C99].  See
135               also Math::Trig.
136
137       "assert"
138               Unimplemented, but you can use "die" in perlfunc and the Carp
139               module to achieve similar things.
140
141       "atan"  This is identical to the C function "atan()", returning the
142               arcus tangent of its numerical argument.  See also Math::Trig.
143
144       "atanh" This is identical to the C function "atanh()", returning the
145               hyperbolic arcus tangent of its numerical argument [C99].  See
146               also Math::Trig.
147
148       "atan2" This is identical to Perl's builtin "atan2()" function,
149               returning the arcus tangent defined by its two numerical
150               arguments, the y coordinate and the x coordinate.  See also
151               Math::Trig.
152
153       "atexit"
154               Not implemented.  "atexit()" is C-specific: use "END {}"
155               instead, see perlmod.
156
157       "atof"  Not implemented.  "atof()" is C-specific.  Perl converts
158               strings to numbers transparently.  If you need to force a
159               scalar to a number, add a zero to it.
160
161       "atoi"  Not implemented.  "atoi()" is C-specific.  Perl converts
162               strings to numbers transparently.  If you need to force a
163               scalar to a number, add a zero to it.  If you need to have just
164               the integer part, see "int" in perlfunc.
165
166       "atol"  Not implemented.  "atol()" is C-specific.  Perl converts
167               strings to numbers transparently.  If you need to force a
168               scalar to a number, add a zero to it.  If you need to have just
169               the integer part, see "int" in perlfunc.
170
171       "bsearch"
172               "bsearch()" not supplied.  For doing binary search on
173               wordlists, see Search::Dict.
174
175       "calloc"
176               Not implemented.  "calloc()" is C-specific.  Perl does memory
177               management transparently.
178
179       "cbrt"  The cube root [C99].
180
181       "ceil"  This is identical to the C function "ceil()", returning the
182               smallest integer value greater than or equal to the given
183               numerical argument.
184
185       "chdir" This is identical to Perl's builtin "chdir()" function,
186               allowing one to change the working (default) directory -- see
187               "chdir" in perlfunc -- with the exception that "POSIX::chdir()"
188               must be provided an explicit value (rather than relying on an
189               implicit $_):
190
191                   $rv = POSIX::chdir('path/to/dir');      # good
192
193                   $rv = POSIX::chdir();                   # throws exception
194
195       "chmod" This is identical to Perl's builtin "chmod()" function,
196               allowing one to change file and directory permissions -- see
197               "chmod" in perlfunc -- with the exception that "POSIX::chmod()"
198               can only change one file at a time (rather than a list of
199               files):
200
201                   $c = chmod 0664, $file1, $file2;          # good
202
203                   $c = POSIX::chmod 0664, $file1;           # throws exception
204
205                   $c = POSIX::chmod 0664, $file1, $file2;   # throws exception
206
207               As with the built-in "chmod()", $file may be a filename or a
208               file handle.
209
210       "chown" This is identical to Perl's builtin "chown()" function,
211               allowing one to change file and directory owners and groups,
212               see "chown" in perlfunc.
213
214       "clearerr"
215               Not implemented.  Use the method "IO::Handle::clearerr()"
216               instead, to reset the error state (if any) and EOF state (if
217               any) of the given stream.
218
219       "clock" This is identical to the C function "clock()", returning the
220               amount of spent processor time in microseconds.
221
222       "close" Close the file.  This uses file descriptors such as those
223               obtained by calling "POSIX::open".
224
225                       $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
226                       POSIX::close( $fd );
227
228               Returns "undef" on failure.
229
230               See also "close" in perlfunc.
231
232       "closedir"
233               This is identical to Perl's builtin "closedir()" function for
234               closing a directory handle, see "closedir" in perlfunc.
235
236       "cos"   This is identical to Perl's builtin "cos()" function, for
237               returning the cosine of its numerical argument, see "cos" in
238               perlfunc.  See also Math::Trig.
239
240       "cosh"  This is identical to the C function "cosh()", for returning the
241               hyperbolic cosine of its numeric argument.  See also
242               Math::Trig.
243
244       "copysign"
245               Returns "x" but with the sign of "y" [C99].
246
247                $x_with_sign_of_y = POSIX::copysign($x, $y);
248
249               See also "signbit".
250
251       "creat" Create a new file.  This returns a file descriptor like the
252               ones returned by "POSIX::open".  Use "POSIX::close" to close
253               the file.
254
255                       $fd = POSIX::creat( "foo", 0611 );
256                       POSIX::close( $fd );
257
258               See also "sysopen" in perlfunc and its "O_CREAT" flag.
259
260       "ctermid"
261               Generates the path name for the controlling terminal.
262
263                       $path = POSIX::ctermid();
264
265       "ctime" This is identical to the C function "ctime()" and equivalent to
266               "asctime(localtime(...))", see "asctime" and "localtime".
267
268       "cuserid" [POSIX.1-1988]
269               Get the login name of the owner of the current process.
270
271                       $name = POSIX::cuserid();
272
273               Note: this function has not been specified by POSIX since 1990
274               and is included only for backwards compatibility. New code
275               should use "getlogin()" instead.
276
277       "difftime"
278               This is identical to the C function "difftime()", for returning
279               the time difference (in seconds) between two times (as returned
280               by "time()"), see "time".
281
282       "div"   Not implemented.  "div()" is C-specific, use "int" in perlfunc
283               on the usual "/" division and the modulus "%".
284
285       "dup"   This is similar to the C function "dup()", for duplicating a
286               file descriptor.
287
288               This uses file descriptors such as those obtained by calling
289               "POSIX::open".
290
291               Returns "undef" on failure.
292
293       "dup2"  This is similar to the C function "dup2()", for duplicating a
294               file descriptor to an another known file descriptor.
295
296               This uses file descriptors such as those obtained by calling
297               "POSIX::open".
298
299               Returns "undef" on failure.
300
301       "erf"   The error function [C99].
302
303       "erfc"  The complementary error function [C99].
304
305       "errno" Returns the value of errno.
306
307                       $errno = POSIX::errno();
308
309               This identical to the numerical values of the $!, see "$ERRNO"
310               in perlvar.
311
312       "execl" Not implemented.  "execl()" is C-specific, see "exec" in
313               perlfunc.
314
315       "execle"
316               Not implemented.  "execle()" is C-specific, see "exec" in
317               perlfunc.
318
319       "execlp"
320               Not implemented.  "execlp()" is C-specific, see "exec" in
321               perlfunc.
322
323       "execv" Not implemented.  "execv()" is C-specific, see "exec" in
324               perlfunc.
325
326       "execve"
327               Not implemented.  "execve()" is C-specific, see "exec" in
328               perlfunc.
329
330       "execvp"
331               Not implemented.  "execvp()" is C-specific, see "exec" in
332               perlfunc.
333
334       "exit"  This is identical to Perl's builtin "exit()" function for
335               exiting the program, see "exit" in perlfunc.
336
337       "exp"   This is identical to Perl's builtin "exp()" function for
338               returning the exponent (e-based) of the numerical argument, see
339               "exp" in perlfunc.
340
341       "expm1" Equivalent to "exp(x) - 1", but more precise for small argument
342               values [C99].
343
344               See also "log1p".
345
346       "fabs"  This is identical to Perl's builtin "abs()" function for
347               returning the absolute value of the numerical argument, see
348               "abs" in perlfunc.
349
350       "fclose"
351               Not implemented.  Use method "IO::Handle::close()" instead, or
352               see "close" in perlfunc.
353
354       "fcntl" This is identical to Perl's builtin "fcntl()" function, see
355               "fcntl" in perlfunc.
356
357       "fdopen"
358               Not implemented.  Use method "IO::Handle::new_from_fd()"
359               instead, or see "open" in perlfunc.
360
361       "feof"  Not implemented.  Use method "IO::Handle::eof()" instead, or
362               see "eof" in perlfunc.
363
364       "ferror"
365               Not implemented.  Use method "IO::Handle::error()" instead.
366
367       "fflush"
368               Not implemented.  Use method "IO::Handle::flush()" instead.
369               See also ""$OUTPUT_AUTOFLUSH" in perlvar".
370
371       "fgetc" Not implemented.  Use method "IO::Handle::getc()" instead, or
372               see "read" in perlfunc.
373
374       "fgetpos"
375               Not implemented.  Use method "IO::Seekable::getpos()" instead,
376               or see "seek" in perlfunc.
377
378       "fgets" Not implemented.  Use method "IO::Handle::gets()" instead.
379               Similar to <>, also known as "readline" in perlfunc.
380
381       "fileno"
382               Not implemented.  Use method "IO::Handle::fileno()" instead, or
383               see "fileno" in perlfunc.
384
385       "floor" This is identical to the C function "floor()", returning the
386               largest integer value less than or equal to the numerical
387               argument.
388
389       "fdim"  "Positive difference", "x - y" if "x > y", zero otherwise
390               [C99].
391
392       "fegetround"
393               Returns the current floating point rounding mode, one of
394
395                 FE_TONEAREST FE_TOWARDZERO FE_UPWARD FE_UPWARD
396
397               "FE_TONEAREST" is like "round", "FE_TOWARDZERO" is like "trunc"
398               [C99].
399
400       "fesetround"
401               Sets the floating point rounding mode, see "fegetround" [C99].
402
403       "fma"   "Fused multiply-add", "x * y + z", possibly faster (and less
404               lossy) than the explicit two operations [C99].
405
406                my $fused = POSIX::fma($x, $y, $z);
407
408       "fmax"  Maximum of "x" and "y", except when either is "NaN", returns
409               the other [C99].
410
411                my $min = POSIX::fmax($x, $y);
412
413       "fmin"  Minimum of "x" and "y", except when either is "NaN", returns
414               the other [C99].
415
416                my $min = POSIX::fmin($x, $y);
417
418       "fmod"  This is identical to the C function "fmod()".
419
420                       $r = fmod($x, $y);
421
422               It returns the remainder "$r = $x - $n*$y", where
423               "$n = trunc($x/$y)".  The $r has the same sign as $x and
424               magnitude (absolute value) less than the magnitude of $y.
425
426       "fopen" Not implemented.  Use method "IO::File::open()" instead, or see
427               "open" in perlfunc.
428
429       "fork"  This is identical to Perl's builtin "fork()" function for
430               duplicating the current process, see "fork" in perlfunc and
431               perlfork if you are in Windows.
432
433       "fpathconf"
434               Retrieves the value of a configurable limit on a file or
435               directory.  This uses file descriptors such as those obtained
436               by calling "POSIX::open".
437
438               The following will determine the maximum length of the longest
439               allowable pathname on the filesystem which holds /var/foo.
440
441                       $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
442                       $path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX);
443
444               Returns "undef" on failure.
445
446       "fpclassify"
447               Returns one of
448
449                 FP_NORMAL FP_ZERO FP_SUBNORMAL FP_INFINITE FP_NAN
450
451               telling the class of the argument [C99].  "FP_INFINITE" is
452               positive or negative infinity, "FP_NAN" is not-a-number.
453               "FP_SUBNORMAL" means subnormal numbers (also known as
454               denormals), very small numbers with low precision. "FP_ZERO" is
455               zero.  "FP_NORMAL" is all the rest.
456
457       "fprintf"
458               Not implemented.  "fprintf()" is C-specific, see "printf" in
459               perlfunc instead.
460
461       "fputc" Not implemented.  "fputc()" is C-specific, see "print" in
462               perlfunc instead.
463
464       "fputs" Not implemented.  "fputs()" is C-specific, see "print" in
465               perlfunc instead.
466
467       "fread" Not implemented.  "fread()" is C-specific, see "read" in
468               perlfunc instead.
469
470       "free"  Not implemented.  "free()" is C-specific.  Perl does memory
471               management transparently.
472
473       "freopen"
474               Not implemented.  "freopen()" is C-specific, see "open" in
475               perlfunc instead.
476
477       "frexp" Return the mantissa and exponent of a floating-point number.
478
479                       ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
480
481       "fscanf"
482               Not implemented.  "fscanf()" is C-specific, use <> and regular
483               expressions instead.
484
485       "fseek" Not implemented.  Use method "IO::Seekable::seek()" instead, or
486               see "seek" in perlfunc.
487
488       "fsetpos"
489               Not implemented.  Use method "IO::Seekable::setpos()" instead,
490               or seek "seek" in perlfunc.
491
492       "fstat" Get file status.  This uses file descriptors such as those
493               obtained by calling "POSIX::open".  The data returned is
494               identical to the data from Perl's builtin "stat" function.
495
496                       $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
497                       @stats = POSIX::fstat( $fd );
498
499       "fsync" Not implemented.  Use method "IO::Handle::sync()" instead.
500
501       "ftell" Not implemented.  Use method "IO::Seekable::tell()" instead, or
502               see "tell" in perlfunc.
503
504       "fwrite"
505               Not implemented.  "fwrite()" is C-specific, see "print" in
506               perlfunc instead.
507
508       "getc"  This is identical to Perl's builtin "getc()" function, see
509               "getc" in perlfunc.
510
511       "getchar"
512               Returns one character from STDIN.  Identical to Perl's
513               "getc()", see "getc" in perlfunc.
514
515       "getcwd"
516               Returns the name of the current working directory.  See also
517               Cwd.
518
519       "getegid"
520               Returns the effective group identifier.  Similar to Perl' s
521               builtin variable $(, see "$EGID" in perlvar.
522
523       "getenv"
524               Returns the value of the specified environment variable.  The
525               same information is available through the %ENV array.
526
527       "geteuid"
528               Returns the effective user identifier.  Identical to Perl's
529               builtin $> variable, see "$EUID" in perlvar.
530
531       "getgid"
532               Returns the user's real group identifier.  Similar to Perl's
533               builtin variable $), see "$GID" in perlvar.
534
535       "getgrgid"
536               This is identical to Perl's builtin "getgrgid()" function for
537               returning group entries by group identifiers, see "getgrgid" in
538               perlfunc.
539
540       "getgrnam"
541               This is identical to Perl's builtin "getgrnam()" function for
542               returning group entries by group names, see "getgrnam" in
543               perlfunc.
544
545       "getgroups"
546               Returns the ids of the user's supplementary groups.  Similar to
547               Perl's builtin variable $), see "$GID" in perlvar.
548
549       "getlogin"
550               This is identical to Perl's builtin "getlogin()" function for
551               returning the user name associated with the current session,
552               see "getlogin" in perlfunc.
553
554       "getpayload"
555                       use POSIX ':nan_payload';
556                       getpayload($var)
557
558               Returns the "NaN" payload.
559
560               Note the API instability warning in "setpayload".
561
562               See "nan" for more discussion about "NaN".
563
564       "getpgrp"
565               This is identical to Perl's builtin "getpgrp()" function for
566               returning the process group identifier of the current process,
567               see "getpgrp" in perlfunc.
568
569       "getpid"
570               Returns the process identifier.  Identical to Perl's builtin
571               variable $$, see "$PID" in perlvar.
572
573       "getppid"
574               This is identical to Perl's builtin "getppid()" function for
575               returning the process identifier of the parent process of the
576               current process , see "getppid" in perlfunc.
577
578       "getpwnam"
579               This is identical to Perl's builtin "getpwnam()" function for
580               returning user entries by user names, see "getpwnam" in
581               perlfunc.
582
583       "getpwuid"
584               This is identical to Perl's builtin "getpwuid()" function for
585               returning user entries by user identifiers, see "getpwuid" in
586               perlfunc.
587
588       "gets"  Returns one line from "STDIN", similar to <>, also known as the
589               "readline()" function, see "readline" in perlfunc.
590
591               NOTE: if you have C programs that still use "gets()", be very
592               afraid.  The "gets()" function is a source of endless grief
593               because it has no buffer overrun checks.  It should never be
594               used.  The "fgets()" function should be preferred instead.
595
596       "getuid"
597               Returns the user's identifier.  Identical to Perl's builtin $<
598               variable, see "$UID" in perlvar.
599
600       "gmtime"
601               This is identical to Perl's builtin "gmtime()" function for
602               converting seconds since the epoch to a date in Greenwich Mean
603               Time, see "gmtime" in perlfunc.
604
605       "hypot" Equivalent to "sqrt(x * x + y * y)" except more stable on very
606               large or very small arguments [C99].
607
608       "ilogb" Integer binary logarithm [C99]
609
610               For example "ilogb(20)" is 4, as an integer.
611
612               See also "logb".
613
614       "Inf"   The infinity as a constant:
615
616                  use POSIX qw(Inf);
617                  my $pos_inf = +Inf;  # Or just Inf.
618                  my $neg_inf = -Inf;
619
620               See also "isinf", and "fpclassify".
621
622       "isalnum"
623               This function has been removed as of v5.24.  It was very
624               similar to matching against "qr/ ^ [[:alnum:]]+ $ /x", which
625               you should convert to use instead.  See "POSIX Character
626               Classes" in perlrecharclass.
627
628       "isalpha"
629               This function has been removed as of v5.24.  It was very
630               similar to matching against "qr/ ^ [[:alpha:]]+ $ /x", which
631               you should convert to use instead.  See "POSIX Character
632               Classes" in perlrecharclass.
633
634       "isatty"
635               Returns a boolean indicating whether the specified filehandle
636               is connected to a tty.  Similar to the "-t" operator, see "-X"
637               in perlfunc.
638
639       "iscntrl"
640               This function has been removed as of v5.24.  It was very
641               similar to matching against "qr/ ^ [[:cntrl:]]+ $ /x", which
642               you should convert to use instead.  See "POSIX Character
643               Classes" in perlrecharclass.
644
645       "isdigit"
646               This function has been removed as of v5.24.  It was very
647               similar to matching against "qr/ ^ [[:digit:]]+ $ /x", which
648               you should convert to use instead.  See "POSIX Character
649               Classes" in perlrecharclass.
650
651       "isfinite"
652               Returns true if the argument is a finite number (that is, not
653               an infinity, or the not-a-number) [C99].
654
655               See also "isinf", "isnan", and "fpclassify".
656
657       "isgraph"
658               This function has been removed as of v5.24.  It was very
659               similar to matching against "qr/ ^ [[:graph:]]+ $ /x", which
660               you should convert to use instead.  See "POSIX Character
661               Classes" in perlrecharclass.
662
663       "isgreater"
664               (Also "isgreaterequal", "isless", "islessequal",
665               "islessgreater", "isunordered")
666
667               Floating point comparisons which handle the "NaN" [C99].
668
669       "isinf" Returns true if the argument is an infinity (positive or
670               negative) [C99].
671
672               See also "Inf", "isnan", "isfinite", and "fpclassify".
673
674       "islower"
675               This function has been removed as of v5.24.  It was very
676               similar to matching against "qr/ ^ [[:lower:]]+ $ /x", which
677               you should convert to use instead.  See "POSIX Character
678               Classes" in perlrecharclass.
679
680       "isnan" Returns true if the argument is "NaN" (not-a-number) [C99].
681
682               Note that you cannot test for ""NaN"-ness" with
683
684                  $x == $x
685
686               since the "NaN" is not equivalent to anything, including
687               itself.
688
689               See also "nan", "NaN", "isinf", and "fpclassify".
690
691       "isnormal"
692               Returns true if the argument is normal (that is, not a
693               subnormal/denormal, and not an infinity, or a not-a-number)
694               [C99].
695
696               See also "isfinite", and "fpclassify".
697
698       "isprint"
699               This function has been removed as of v5.24.  It was very
700               similar to matching against "qr/ ^ [[:print:]]+ $ /x", which
701               you should convert to use instead.  See "POSIX Character
702               Classes" in perlrecharclass.
703
704       "ispunct"
705               This function has been removed as of v5.24.  It was very
706               similar to matching against "qr/ ^ [[:punct:]]+ $ /x", which
707               you should convert to use instead.  See "POSIX Character
708               Classes" in perlrecharclass.
709
710       "issignaling"
711                       use POSIX ':nan_payload';
712                       issignaling($var, $payload)
713
714               Return true if the argument is a signaling NaN.
715
716               Note the API instability warning in "setpayload".
717
718               See "nan" for more discussion about "NaN".
719
720       "isspace"
721               This function has been removed as of v5.24.  It was very
722               similar to matching against "qr/ ^ [[:space:]]+ $ /x", which
723               you should convert to use instead.  See "POSIX Character
724               Classes" in perlrecharclass.
725
726       "isupper"
727               This function has been removed as of v5.24.  It was very
728               similar to matching against "qr/ ^ [[:upper:]]+ $ /x", which
729               you should convert to use instead.  See "POSIX Character
730               Classes" in perlrecharclass.
731
732       "isxdigit"
733               This function has been removed as of v5.24.  It was very
734               similar to matching against "qr/ ^ [[:xdigit:]]+ $ /x", which
735               you should convert to use instead.  See "POSIX Character
736               Classes" in perlrecharclass.
737
738       "j0"
739       "j1"
740       "jn"
741       "y0"
742       "y1"
743       "yn"    The Bessel function of the first kind of the order zero.
744
745       "kill"  This is identical to Perl's builtin "kill()" function for
746               sending signals to processes (often to terminate them), see
747               "kill" in perlfunc.
748
749       "labs"  Not implemented.  (For returning absolute values of long
750               integers.)  "labs()" is C-specific, see "abs" in perlfunc
751               instead.
752
753       "lchown"
754               This is identical to the C function, except the order of
755               arguments is consistent with Perl's builtin "chown()" with the
756               added restriction of only one path, not a list of paths.  Does
757               the same thing as the "chown()" function but changes the owner
758               of a symbolic link instead of the file the symbolic link points
759               to.
760
761                POSIX::lchown($uid, $gid, $file_path);
762
763       "ldexp" This is identical to the C function "ldexp()" for multiplying
764               floating point numbers with powers of two.
765
766                       $x_quadrupled = POSIX::ldexp($x, 2);
767
768       "ldiv"  Not implemented.  (For computing dividends of long integers.)
769               "ldiv()" is C-specific, use "/" and "int()" instead.
770
771       "lgamma"
772               The logarithm of the Gamma function [C99].
773
774               See also "tgamma".
775
776       "log1p" Equivalent to "log(1 + x)", but more stable results for small
777               argument values [C99].
778
779       "log2"  Logarithm base two [C99].
780
781               See also "expm1".
782
783       "logb"  Integer binary logarithm [C99].
784
785               For example "logb(20)" is 4, as a floating point number.
786
787               See also "ilogb".
788
789       "link"  This is identical to Perl's builtin "link()" function for
790               creating hard links into files, see "link" in perlfunc.
791
792       "localeconv"
793               Get numeric formatting information.  Returns a reference to a
794               hash containing the current underlying locale's formatting
795               values.  Users of this function should also read perllocale,
796               which provides a comprehensive discussion of Perl locale
797               handling, including a section devoted to this function.  Prior
798               to Perl 5.28, or when operating in a non thread-safe
799               environment, it should not be used in a threaded application
800               unless it's certain that the underlying locale is C or POSIX.
801               This is because it otherwise changes the locale, which globally
802               affects all threads simultaneously.  Windows platforms starting
803               with Visual Studio 2005 are mostly thread-safe, but use of this
804               function in those prior to Visual Studio 2015 can interefere
805               with a thread that has called "switch_to_global_locale" in
806               perlapi.
807
808               Here is how to query the database for the de (Deutsch or
809               German) locale.
810
811                       my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
812                       print "Locale: \"$loc\"\n";
813                       my $lconv = POSIX::localeconv();
814                       foreach my $property (qw(
815                               decimal_point
816                               thousands_sep
817                               grouping
818                               int_curr_symbol
819                               currency_symbol
820                               mon_decimal_point
821                               mon_thousands_sep
822                               mon_grouping
823                               positive_sign
824                               negative_sign
825                               int_frac_digits
826                               frac_digits
827                               p_cs_precedes
828                               p_sep_by_space
829                               n_cs_precedes
830                               n_sep_by_space
831                               p_sign_posn
832                               n_sign_posn
833                               int_p_cs_precedes
834                               int_p_sep_by_space
835                               int_n_cs_precedes
836                               int_n_sep_by_space
837                               int_p_sign_posn
838                               int_n_sign_posn
839                       ))
840                       {
841                               printf qq(%s: "%s",\n),
842                                       $property, $lconv->{$property};
843                       }
844
845               The members whose names begin with "int_p_" and "int_n_" were
846               added by POSIX.1-2008 and are only available on systems that
847               support them.
848
849       "localtime"
850               This is identical to Perl's builtin "localtime()" function for
851               converting seconds since the epoch to a date see "localtime" in
852               perlfunc except that "POSIX::localtime()" must be provided an
853               explicit value (rather than relying on an implicit $_):
854
855                   @localtime = POSIX::localtime(time);    # good
856
857                   @localtime = localtime();               # good
858
859                   @localtime = POSIX::localtime();        # throws exception
860
861       "log"   This is identical to Perl's builtin "log()" function, returning
862               the natural (e-based) logarithm of the numerical argument, see
863               "log" in perlfunc.
864
865       "log10" This is identical to the C function "log10()", returning the
866               10-base logarithm of the numerical argument.  You can also use
867
868                   sub log10 { log($_[0]) / log(10) }
869
870               or
871
872                   sub log10 { log($_[0]) / 2.30258509299405 }
873
874               or
875
876                   sub log10 { log($_[0]) * 0.434294481903252 }
877
878       "longjmp"
879               Not implemented.  "longjmp()" is C-specific: use "die" in
880               perlfunc instead.
881
882       "lseek" Move the file's read/write position.  This uses file
883               descriptors such as those obtained by calling "POSIX::open".
884
885                       $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
886                       $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
887
888               Returns "undef" on failure.
889
890       "lrint" Depending on the current floating point rounding mode, rounds
891               the argument either toward nearest (like "round"), toward zero
892               (like "trunc"), downward (toward negative infinity), or upward
893               (toward positive infinity) [C99].
894
895               For the rounding mode, see "fegetround".
896
897       "lround"
898               Like "round", but as integer, as opposed to floating point
899               [C99].
900
901               See also "ceil", "floor", "trunc".
902
903               Owing to an oversight, this is not currently exported by
904               default, or as part of the ":math_h_c99" export tag; importing
905               it must therefore be done by explicit name.
906
907       "malloc"
908               Not implemented.  "malloc()" is C-specific.  Perl does memory
909               management transparently.
910
911       "mblen" This is identical to the C function "mblen()".
912
913               Core Perl does not have any support for the wide and multibyte
914               characters of the C standards, except under UTF-8 locales, so
915               this might be a rather useless function.
916
917               However, Perl supports Unicode, see perluniintro.
918
919       "mbstowcs"
920               This is identical to the C function "mbstowcs()".
921
922               See "mblen".
923
924       "mbtowc"
925               This is identical to the C function "mbtowc()".
926
927               See "mblen".
928
929       "memchr"
930               Not implemented.  "memchr()" is C-specific, see "index" in
931               perlfunc instead.
932
933       "memcmp"
934               Not implemented.  "memcmp()" is C-specific, use "eq" instead,
935               see perlop.
936
937       "memcpy"
938               Not implemented.  "memcpy()" is C-specific, use "=", see
939               perlop, or see "substr" in perlfunc.
940
941       "memmove"
942               Not implemented.  "memmove()" is C-specific, use "=", see
943               perlop, or see "substr" in perlfunc.
944
945       "memset"
946               Not implemented.  "memset()" is C-specific, use "x" instead,
947               see perlop.
948
949       "mkdir" This is identical to Perl's builtin "mkdir()" function for
950               creating directories, see "mkdir" in perlfunc.
951
952       "mkfifo"
953               This is similar to the C function "mkfifo()" for creating FIFO
954               special files.
955
956                       if (mkfifo($path, $mode)) { ....
957
958               Returns "undef" on failure.  The $mode is similar to the mode
959               of "mkdir()", see "mkdir" in perlfunc, though for "mkfifo" you
960               must specify the $mode.
961
962       "mktime"
963               Convert date/time info to a calendar time.
964
965               Synopsis:
966
967                       mktime(sec, min, hour, mday, mon, year, wday = 0,
968                              yday = 0, isdst = -1)
969
970               The month ("mon"), weekday ("wday"), and yearday ("yday") begin
971               at zero, i.e., January is 0, not 1; Sunday is 0, not 1; January
972               1st is 0, not 1.  The year ("year") is given in years since
973               1900; i.e., the year 1995 is 95; the year 2001 is 101.  Consult
974               your system's "mktime()" manpage for details about these and
975               the other arguments.
976
977               Calendar time for December 12, 1995, at 10:30 am.
978
979                       $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
980                       print "Date = ", POSIX::ctime($time_t);
981
982               Returns "undef" on failure.
983
984       "modf"  Return the integral and fractional parts of a floating-point
985               number.
986
987                       ($fractional, $integral) = POSIX::modf( 3.14 );
988
989               See also "round".
990
991       "NaN"   The not-a-number as a constant:
992
993                  use POSIX qw(NaN);
994                  my $nan = NaN;
995
996               See also "nan", "/isnan", and "fpclassify".
997
998       "nan"
999                  my $nan = nan();
1000
1001               Returns "NaN", not-a-number [C99].
1002
1003               The returned NaN is always a quiet NaN, as opposed to
1004               signaling.
1005
1006               With an argument, can be used to generate a NaN with payload.
1007               The argument is first interpreted as a floating point number,
1008               but then any fractional parts are truncated (towards zero), and
1009               the value is interpreted as an unsigned integer.  The bits of
1010               this integer are stored in the unused bits of the NaN.
1011
1012               The result has a dual nature: it is a NaN, but it also carries
1013               the integer inside it.  The integer can be retrieved with
1014               "getpayload".  Note, though, that the payload is not
1015               propagated, not even on copies, and definitely not in
1016               arithmetic operations.
1017
1018               How many bits fit in the NaN depends on what kind of floating
1019               points are being used, but on the most common platforms (64-bit
1020               IEEE 754, or the x86 80-bit long doubles) there are 51 and 61
1021               bits available, respectively.  (There would be 52 and 62, but
1022               the quiet/signaling bit of NaNs takes away one.)  However,
1023               because of the floating-point-to- integer-and-back conversions,
1024               please test carefully whether you get back what you put in.  If
1025               your integers are only 32 bits wide, you probably should not
1026               rely on more than 32 bits of payload.
1027
1028               Whether a "signaling" NaN is in any way different from a
1029               "quiet" NaN, depends on the platform.  Also note that the
1030               payload of the default NaN (no argument to nan()) is not
1031               necessarily zero, use "setpayload" to explicitly set the
1032               payload.  On some platforms like the 32-bit x86, (unless using
1033               the 80-bit long doubles) the signaling bit is not supported at
1034               all.
1035
1036               See also "isnan", "NaN", "setpayload" and "issignaling".
1037
1038       "nearbyint"
1039               Returns the nearest integer to the argument, according to the
1040               current rounding mode (see "fegetround") [C99].
1041
1042       "nextafter"
1043               Returns the next representable floating point number after "x"
1044               in the direction of "y" [C99].
1045
1046                my $nextafter = POSIX::nextafter($x, $y);
1047
1048               Like "nexttoward", but potentially less accurate.
1049
1050       "nexttoward"
1051               Returns the next representable floating point number after "x"
1052               in the direction of "y" [C99].
1053
1054                my $nexttoward = POSIX::nexttoward($x, $y);
1055
1056               Like "nextafter", but potentially more accurate.
1057
1058       "nice"  This is similar to the C function "nice()", for changing the
1059               scheduling preference of the current process.  Positive
1060               arguments mean a more polite process, negative values a more
1061               needy process.  Normal (non-root) user processes can only
1062               change towards being more polite.
1063
1064               Returns "undef" on failure.
1065
1066       "offsetof"
1067               Not implemented.  "offsetof()" is C-specific, you probably want
1068               to see "pack" in perlfunc instead.
1069
1070       "open"  Open a file for reading for writing.  This returns file
1071               descriptors, not Perl filehandles.  Use "POSIX::close" to close
1072               the file.
1073
1074               Open a file read-only with mode 0666.
1075
1076                       $fd = POSIX::open( "foo" );
1077
1078               Open a file for read and write.
1079
1080                       $fd = POSIX::open( "foo", &POSIX::O_RDWR );
1081
1082               Open a file for write, with truncation.
1083
1084                       $fd = POSIX::open(
1085                               "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC
1086                       );
1087
1088               Create a new file with mode 0640.  Set up the file for writing.
1089
1090                       $fd = POSIX::open(
1091                               "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640
1092                       );
1093
1094               Returns "undef" on failure.
1095
1096               See also "sysopen" in perlfunc.
1097
1098       "opendir"
1099               Open a directory for reading.
1100
1101                       $dir = POSIX::opendir( "/var" );
1102                       @files = POSIX::readdir( $dir );
1103                       POSIX::closedir( $dir );
1104
1105               Returns "undef" on failure.
1106
1107       "pathconf"
1108               Retrieves the value of a configurable limit on a file or
1109               directory.
1110
1111               The following will determine the maximum length of the longest
1112               allowable pathname on the filesystem which holds "/var".
1113
1114                       $path_max = POSIX::pathconf( "/var",
1115                                                     &POSIX::_PC_PATH_MAX );
1116
1117               Returns "undef" on failure.
1118
1119       "pause" This is similar to the C function "pause()", which suspends the
1120               execution of the current process until a signal is received.
1121
1122               Returns "undef" on failure.
1123
1124       "perror"
1125               This is identical to the C function "perror()", which outputs
1126               to the standard error stream the specified message followed by
1127               ": " and the current error string.  Use the "warn()" function
1128               and the $!  variable instead, see "warn" in perlfunc and
1129               "$ERRNO" in perlvar.
1130
1131       "pipe"  Create an interprocess channel.  This returns file descriptors
1132               like those returned by "POSIX::open".
1133
1134                       my ($read, $write) = POSIX::pipe();
1135                       POSIX::write( $write, "hello", 5 );
1136                       POSIX::read( $read, $buf, 5 );
1137
1138               See also "pipe" in perlfunc.
1139
1140       "pow"   Computes $x raised to the power $exponent.
1141
1142                       $ret = POSIX::pow( $x, $exponent );
1143
1144               You can also use the "**" operator, see perlop.
1145
1146       "printf"
1147               Formats and prints the specified arguments to "STDOUT".  See
1148               also "printf" in perlfunc.
1149
1150       "putc"  Not implemented.  "putc()" is C-specific, see "print" in
1151               perlfunc instead.
1152
1153       "putchar"
1154               Not implemented.  "putchar()" is C-specific, see "print" in
1155               perlfunc instead.
1156
1157       "puts"  Not implemented.  "puts()" is C-specific, see "print" in
1158               perlfunc instead.
1159
1160       "qsort" Not implemented.  "qsort()" is C-specific, see "sort" in
1161               perlfunc instead.
1162
1163       "raise" Sends the specified signal to the current process.  See also
1164               "kill" in perlfunc and the $$ in "$PID" in perlvar.
1165
1166       "rand"  Not implemented.  "rand()" is non-portable, see "rand" in
1167               perlfunc instead.
1168
1169       "read"  Read from a file.  This uses file descriptors such as those
1170               obtained by calling "POSIX::open".  If the buffer $buf is not
1171               large enough for the read then Perl will extend it to make room
1172               for the request.
1173
1174                       $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1175                       $bytes = POSIX::read( $fd, $buf, 3 );
1176
1177               Returns "undef" on failure.
1178
1179               See also "sysread" in perlfunc.
1180
1181       "readdir"
1182               This is identical to Perl's builtin "readdir()" function for
1183               reading directory entries, see "readdir" in perlfunc.
1184
1185       "realloc"
1186               Not implemented.  "realloc()" is C-specific.  Perl does memory
1187               management transparently.
1188
1189       "remainder"
1190               Given "x" and "y", returns the value "x - n*y", where "n" is
1191               the integer closest to "x"/"y". [C99]
1192
1193                my $remainder = POSIX::remainder($x, $y)
1194
1195               See also "remquo".
1196
1197       "remove"
1198               Deletes a name from the filesystem.  Calls "unlink" in perlfunc
1199               for files and "rmdir" in perlfunc for directories.
1200
1201       "remquo"
1202               Like "remainder" but also returns the low-order bits of the
1203               quotient (n) [C99]
1204
1205               (This is quite esoteric interface, mainly used to implement
1206               numerical algorithms.)
1207
1208       "rename"
1209               This is identical to Perl's builtin "rename()" function for
1210               renaming files, see "rename" in perlfunc.
1211
1212       "rewind"
1213               Seeks to the beginning of the file.
1214
1215       "rewinddir"
1216               This is identical to Perl's builtin "rewinddir()" function for
1217               rewinding directory entry streams, see "rewinddir" in perlfunc.
1218
1219       "rint"  Identical to "lrint".
1220
1221       "rmdir" This is identical to Perl's builtin "rmdir()" function for
1222               removing (empty) directories, see "rmdir" in perlfunc.
1223
1224       "round" Returns the integer (but still as floating point) nearest to
1225               the argument [C99].
1226
1227               See also "ceil", "floor", "lround", "modf", and "trunc".
1228
1229       "scalbn"
1230               Returns "x * 2**y" [C99].
1231
1232               See also "frexp" and "ldexp".
1233
1234       "scanf" Not implemented.  "scanf()" is C-specific, use <> and regular
1235               expressions instead, see perlre.
1236
1237       "setgid"
1238               Sets the real group identifier and the effective group
1239               identifier for this process.  Similar to assigning a value to
1240               the Perl's builtin $) variable, see "$EGID" in perlvar, except
1241               that the latter will change only the real user identifier, and
1242               that the setgid() uses only a single numeric argument, as
1243               opposed to a space-separated list of numbers.
1244
1245       "setjmp"
1246               Not implemented.  "setjmp()" is C-specific: use "eval {}"
1247               instead, see "eval" in perlfunc.
1248
1249       "setlocale"
1250               WARNING!  Do NOT use this function in a thread.  The locale
1251               will change in all other threads at the same time, and should
1252               your thread get paused by the operating system, and another
1253               started, that thread will not have the locale it is expecting.
1254               On some platforms, there can be a race leading to segfaults if
1255               two threads call this function nearly simultaneously.
1256
1257               Modifies and queries the program's underlying locale.  Users of
1258               this function should read perllocale, whch provides a
1259               comprehensive discussion of Perl locale handling, knowledge of
1260               which is necessary to properly use this function.  It contains
1261               a section devoted to this function.  The discussion here is
1262               merely a summary reference for "setlocale()".  Note that Perl
1263               itself is almost entirely unaffected by the locale except
1264               within the scope of "use locale".  (Exceptions are listed in
1265               "Not within the scope of "use locale"" in perllocale.)
1266
1267               The following examples assume
1268
1269                       use POSIX qw(setlocale LC_ALL LC_CTYPE);
1270
1271               has been issued.
1272
1273               The following will set the traditional UNIX system locale
1274               behavior (the second argument "C").
1275
1276                       $loc = setlocale( LC_ALL, "C" );
1277
1278               The following will query the current "LC_CTYPE" category.  (No
1279               second argument means 'query'.)
1280
1281                       $loc = setlocale( LC_CTYPE );
1282
1283               The following will set the "LC_CTYPE" behaviour according to
1284               the locale environment variables (the second argument "").
1285               Please see your system's setlocale(3) documentation for the
1286               locale environment variables' meaning or consult perllocale.
1287
1288                       $loc = setlocale( LC_CTYPE, "" );
1289
1290               The following will set the "LC_COLLATE" behaviour to
1291               Argentinian Spanish. NOTE: The naming and availability of
1292               locales depends on your operating system. Please consult
1293               perllocale for how to find out which locales are available in
1294               your system.
1295
1296                       $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
1297
1298       "setpayload"
1299                       use POSIX ':nan_payload';
1300                       setpayload($var, $payload);
1301
1302               Sets the "NaN" payload of var.
1303
1304               NOTE: the NaN payload APIs are based on the latest (as of June
1305               2015) proposed ISO C interfaces, but they are not yet a
1306               standard.  Things may change.
1307
1308               See "nan" for more discussion about "NaN".
1309
1310               See also "setpayloadsig", "isnan", "getpayload", and
1311               "issignaling".
1312
1313       "setpayloadsig"
1314                       use POSIX ':nan_payload';
1315                       setpayloadsig($var, $payload);
1316
1317               Like "setpayload" but also makes the NaN signaling.
1318
1319               Depending on the platform the NaN may or may not behave
1320               differently.
1321
1322               Note the API instability warning in "setpayload".
1323
1324               Note that because how the floating point formats work out, on
1325               the most common platforms signaling payload of zero is best
1326               avoided, since it might end up being identical to "+Inf".
1327
1328               See also "nan", "isnan", "getpayload", and "issignaling".
1329
1330       "setpgid"
1331               This is similar to the C function "setpgid()" for setting the
1332               process group identifier of the current process.
1333
1334               Returns "undef" on failure.
1335
1336       "setsid"
1337               This is identical to the C function "setsid()" for setting the
1338               session identifier of the current process.
1339
1340       "setuid"
1341               Sets the real user identifier and the effective user identifier
1342               for this process.  Similar to assigning a value to the Perl's
1343               builtin $< variable, see "$UID" in perlvar, except that the
1344               latter will change only the real user identifier.
1345
1346       "sigaction"
1347               Detailed signal management.  This uses "POSIX::SigAction"
1348               objects for the "action" and "oldaction" arguments (the
1349               oldaction can also be just a hash reference).  Consult your
1350               system's "sigaction" manpage for details, see also
1351               "POSIX::SigRt".
1352
1353               Synopsis:
1354
1355                       sigaction(signal, action, oldaction = 0)
1356
1357               Returns "undef" on failure.  The "signal" must be a number
1358               (like "SIGHUP"), not a string (like "SIGHUP"), though Perl does
1359               try hard to understand you.
1360
1361               If you use the "SA_SIGINFO" flag, the signal handler will in
1362               addition to the first argument, the signal name, also receive a
1363               second argument, a hash reference, inside which are the
1364               following keys with the following semantics, as defined by
1365               POSIX/SUSv3:
1366
1367                   signo       the signal number
1368                   errno       the error number
1369                   code        if this is zero or less, the signal was sent by
1370                               a user process and the uid and pid make sense,
1371                               otherwise the signal was sent by the kernel
1372
1373               The constants for specific "code" values can be imported
1374               individually or using the ":signal_h_si_code" tag.
1375
1376               The following are also defined by POSIX/SUSv3, but
1377               unfortunately not very widely implemented:
1378
1379                   pid         the process id generating the signal
1380                   uid         the uid of the process id generating the signal
1381                   status      exit value or signal for SIGCHLD
1382                   band        band event for SIGPOLL
1383                   addr        address of faulting instruction or memory
1384                               reference for SIGILL, SIGFPE, SIGSEGV or SIGBUS
1385
1386               A third argument is also passed to the handler, which contains
1387               a copy of the raw binary contents of the "siginfo" structure:
1388               if a system has some non-POSIX fields, this third argument is
1389               where to "unpack()" them from.
1390
1391               Note that not all "siginfo" values make sense simultaneously
1392               (some are valid only for certain signals, for example), and not
1393               all values make sense from Perl perspective, you should to
1394               consult your system's "sigaction" and possibly also "siginfo"
1395               documentation.
1396
1397       "siglongjmp"
1398               Not implemented.  "siglongjmp()" is C-specific: use "die" in
1399               perlfunc instead.
1400
1401       "signbit"
1402               Returns zero for positive arguments, non-zero for negative
1403               arguments [C99].
1404
1405       "sigpending"
1406               Examine signals that are blocked and pending.  This uses
1407               "POSIX::SigSet" objects for the "sigset" argument.  Consult
1408               your system's "sigpending" manpage for details.
1409
1410               Synopsis:
1411
1412                       sigpending(sigset)
1413
1414               Returns "undef" on failure.
1415
1416       "sigprocmask"
1417               Change and/or examine calling process's signal mask.  This uses
1418               "POSIX::SigSet" objects for the "sigset" and "oldsigset"
1419               arguments.  Consult your system's "sigprocmask" manpage for
1420               details.
1421
1422               Synopsis:
1423
1424                       sigprocmask(how, sigset, oldsigset = 0)
1425
1426               Returns "undef" on failure.
1427
1428               Note that you can't reliably block or unblock a signal from its
1429               own signal handler if you're using safe signals. Other signals
1430               can be blocked or unblocked reliably.
1431
1432       "sigsetjmp"
1433               Not implemented.  "sigsetjmp()" is C-specific: use "eval {}"
1434               instead, see "eval" in perlfunc.
1435
1436       "sigsuspend"
1437               Install a signal mask and suspend process until signal arrives.
1438               This uses "POSIX::SigSet" objects for the "signal_mask"
1439               argument.  Consult your system's "sigsuspend" manpage for
1440               details.
1441
1442               Synopsis:
1443
1444                       sigsuspend(signal_mask)
1445
1446               Returns "undef" on failure.
1447
1448       "sin"   This is identical to Perl's builtin "sin()" function for
1449               returning the sine of the numerical argument, see "sin" in
1450               perlfunc.  See also Math::Trig.
1451
1452       "sinh"  This is identical to the C function "sinh()" for returning the
1453               hyperbolic sine of the numerical argument.  See also
1454               Math::Trig.
1455
1456       "sleep" This is functionally identical to Perl's builtin "sleep()"
1457               function for suspending the execution of the current for
1458               process for certain number of seconds, see "sleep" in perlfunc.
1459               There is one significant difference, however: "POSIX::sleep()"
1460               returns the number of unslept seconds, while the
1461               "CORE::sleep()" returns the number of slept seconds.
1462
1463       "sprintf"
1464               This is similar to Perl's builtin "sprintf()" function for
1465               returning a string that has the arguments formatted as
1466               requested, see "sprintf" in perlfunc.
1467
1468       "sqrt"  This is identical to Perl's builtin "sqrt()" function.  for
1469               returning the square root of the numerical argument, see "sqrt"
1470               in perlfunc.
1471
1472       "srand" Give a seed the pseudorandom number generator, see "srand" in
1473               perlfunc.
1474
1475       "sscanf"
1476               Not implemented.  "sscanf()" is C-specific, use regular
1477               expressions instead, see perlre.
1478
1479       "stat"  This is identical to Perl's builtin "stat()" function for
1480               returning information about files and directories.
1481
1482       "strcat"
1483               Not implemented.  "strcat()" is C-specific, use ".=" instead,
1484               see perlop.
1485
1486       "strchr"
1487               Not implemented.  "strchr()" is C-specific, see "index" in
1488               perlfunc instead.
1489
1490       "strcmp"
1491               Not implemented.  "strcmp()" is C-specific, use "eq" or "cmp"
1492               instead, see perlop.
1493
1494       "strcoll"
1495               This is identical to the C function "strcoll()" for collating
1496               (comparing) strings transformed using the "strxfrm()" function.
1497               Not really needed since Perl can do this transparently, see
1498               perllocale.
1499
1500               Beware that in a UTF-8 locale, anything you pass to this
1501               function must be in UTF-8; and when not in a UTF-8 locale,
1502               anything passed must not be UTF-8 encoded.
1503
1504       "strcpy"
1505               Not implemented.  "strcpy()" is C-specific, use "=" instead,
1506               see perlop.
1507
1508       "strcspn"
1509               Not implemented.  "strcspn()" is C-specific, use regular
1510               expressions instead, see perlre.
1511
1512       "strerror"
1513               Returns the error string for the specified errno.  Identical to
1514               the string form of $!, see "$ERRNO" in perlvar.
1515
1516       "strftime"
1517               Convert date and time information to string.  Returns the
1518               string.
1519
1520               Synopsis:
1521
1522                       strftime(fmt, sec, min, hour, mday, mon, year,
1523                                wday = -1, yday = -1, isdst = -1)
1524
1525               The month ("mon"), weekday ("wday"), and yearday ("yday") begin
1526               at zero, i.e., January is 0, not 1; Sunday is 0, not 1; January
1527               1st is 0, not 1.  The year ("year") is given in years since
1528               1900, i.e., the year 1995 is 95; the year 2001 is 101.  Consult
1529               your system's "strftime()" manpage for details about these and
1530               the other arguments.
1531
1532               If you want your code to be portable, your format ("fmt")
1533               argument should use only the conversion specifiers defined by
1534               the ANSI C standard (C89, to play safe).  These are
1535               "aAbBcdHIjmMpSUwWxXyYZ%".  But even then, the results of some
1536               of the conversion specifiers are non-portable.  For example,
1537               the specifiers "aAbBcpZ" change according to the locale
1538               settings of the user, and both how to set locales (the locale
1539               names) and what output to expect are non-standard.  The
1540               specifier "c" changes according to the timezone settings of the
1541               user and the timezone computation rules of the operating
1542               system.  The "Z" specifier is notoriously unportable since the
1543               names of timezones are non-standard. Sticking to the numeric
1544               specifiers is the safest route.
1545
1546               The given arguments are made consistent as though by calling
1547               "mktime()" before calling your system's "strftime()" function,
1548               except that the "isdst" value is not affected.
1549
1550               The string for Tuesday, December 12, 1995.
1551
1552                       $str = POSIX::strftime( "%A, %B %d, %Y",
1553                                                0, 0, 0, 12, 11, 95, 2 );
1554                       print "$str\n";
1555
1556       "strlen"
1557               Not implemented.  "strlen()" is C-specific, use "length()"
1558               instead, see "length" in perlfunc.
1559
1560       "strncat"
1561               Not implemented.  "strncat()" is C-specific, use ".=" instead,
1562               see perlop.
1563
1564       "strncmp"
1565               Not implemented.  "strncmp()" is C-specific, use "eq" instead,
1566               see perlop.
1567
1568       "strncpy"
1569               Not implemented.  "strncpy()" is C-specific, use "=" instead,
1570               see perlop.
1571
1572       "strpbrk"
1573               Not implemented.  "strpbrk()" is C-specific, use regular
1574               expressions instead, see perlre.
1575
1576       "strrchr"
1577               Not implemented.  "strrchr()" is C-specific, see "rindex" in
1578               perlfunc instead.
1579
1580       "strspn"
1581               Not implemented.  "strspn()" is C-specific, use regular
1582               expressions instead, see perlre.
1583
1584       "strstr"
1585               This is identical to Perl's builtin "index()" function, see
1586               "index" in perlfunc.
1587
1588       "strtod"
1589               String to double translation. Returns the parsed number and the
1590               number of characters in the unparsed portion of the string.
1591               Truly POSIX-compliant systems set $! ($ERRNO) to indicate a
1592               translation error, so clear $! before calling "strtod".
1593               However, non-POSIX systems may not check for overflow, and
1594               therefore will never set $!.
1595
1596               "strtod" respects any POSIX "setlocale()" "LC_TIME" settings,
1597               regardless of whether or not it is called from Perl code that
1598               is within the scope of "use locale".  This means it should not
1599               be used in a threaded application unless it's certain that the
1600               underlying locale is C or POSIX.  This is because it otherwise
1601               changes the locale, which globally affects all threads
1602               simultaneously.
1603
1604               To parse a string $str as a floating point number use
1605
1606                   $! = 0;
1607                   ($num, $n_unparsed) = POSIX::strtod($str);
1608
1609               The second returned item and $! can be used to check for valid
1610               input:
1611
1612                   if (($str eq '') || ($n_unparsed != 0) || $!) {
1613                       die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
1614                   }
1615
1616               When called in a scalar context "strtod" returns the parsed
1617               number.
1618
1619       "strtok"
1620               Not implemented.  "strtok()" is C-specific, use regular
1621               expressions instead, see perlre, or "split" in perlfunc.
1622
1623       "strtol"
1624               String to (long) integer translation.  Returns the parsed
1625               number and the number of characters in the unparsed portion of
1626               the string.  Truly POSIX-compliant systems set $! ($ERRNO) to
1627               indicate a translation error, so clear $! before calling
1628               "strtol".  However, non-POSIX systems may not check for
1629               overflow, and therefore will never set $!.
1630
1631               "strtol" should respect any POSIX setlocale() settings.
1632
1633               To parse a string $str as a number in some base $base use
1634
1635                   $! = 0;
1636                   ($num, $n_unparsed) = POSIX::strtol($str, $base);
1637
1638               The base should be zero or between 2 and 36, inclusive.  When
1639               the base is zero or omitted "strtol" will use the string itself
1640               to determine the base: a leading "0x" or "0X" means
1641               hexadecimal; a leading "0" means octal; any other leading
1642               characters mean decimal.  Thus, "1234" is parsed as a decimal
1643               number, "01234" as an octal number, and "0x1234" as a
1644               hexadecimal number.
1645
1646               The second returned item and $! can be used to check for valid
1647               input:
1648
1649                   if (($str eq '') || ($n_unparsed != 0) || !$!) {
1650                       die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1651                   }
1652
1653               When called in a scalar context "strtol" returns the parsed
1654               number.
1655
1656       "strtold"
1657               Like "strtod" but for long doubles.  Defined only if the system
1658               supports long doubles.
1659
1660       "strtoul"
1661               String to unsigned (long) integer translation.  "strtoul()" is
1662               identical to "strtol()" except that "strtoul()" only parses
1663               unsigned integers.  See "strtol" for details.
1664
1665               Note: Some vendors supply "strtod()" and "strtol()" but not
1666               "strtoul()".  Other vendors that do supply "strtoul()" parse
1667               "-1" as a valid value.
1668
1669       "strxfrm"
1670               String transformation.  Returns the transformed string.
1671
1672                       $dst = POSIX::strxfrm( $src );
1673
1674               Used in conjunction with the "strcoll()" function, see
1675               "strcoll".
1676
1677               Not really needed since Perl can do this transparently, see
1678               perllocale.
1679
1680               Beware that in a UTF-8 locale, anything you pass to this
1681               function must be in UTF-8; and when not in a UTF-8 locale,
1682               anything passed must not be UTF-8 encoded.
1683
1684       "sysconf"
1685               Retrieves values of system configurable variables.
1686
1687               The following will get the machine's clock speed.
1688
1689                       $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1690
1691               Returns "undef" on failure.
1692
1693       "system"
1694               This is identical to Perl's builtin "system()" function, see
1695               "system" in perlfunc.
1696
1697       "tan"   This is identical to the C function "tan()", returning the
1698               tangent of the numerical argument.  See also Math::Trig.
1699
1700       "tanh"  This is identical to the C function "tanh()", returning the
1701               hyperbolic tangent of the numerical argument.   See also
1702               Math::Trig.
1703
1704       "tcdrain"
1705               This is similar to the C function "tcdrain()" for draining the
1706               output queue of its argument stream.
1707
1708               Returns "undef" on failure.
1709
1710       "tcflow"
1711               This is similar to the C function "tcflow()" for controlling
1712               the flow of its argument stream.
1713
1714               Returns "undef" on failure.
1715
1716       "tcflush"
1717               This is similar to the C function "tcflush()" for flushing the
1718               I/O buffers of its argument stream.
1719
1720               Returns "undef" on failure.
1721
1722       "tcgetpgrp"
1723               This is identical to the C function "tcgetpgrp()" for returning
1724               the process group identifier of the foreground process group of
1725               the controlling terminal.
1726
1727       "tcsendbreak"
1728               This is similar to the C function "tcsendbreak()" for sending a
1729               break on its argument stream.
1730
1731               Returns "undef" on failure.
1732
1733       "tcsetpgrp"
1734               This is similar to the C function "tcsetpgrp()" for setting the
1735               process group identifier of the foreground process group of the
1736               controlling terminal.
1737
1738               Returns "undef" on failure.
1739
1740       "tgamma"
1741               The Gamma function [C99].
1742
1743               See also "lgamma".
1744
1745       "time"  This is identical to Perl's builtin "time()" function for
1746               returning the number of seconds since the epoch (whatever it is
1747               for the system), see "time" in perlfunc.
1748
1749       "times" The "times()" function returns elapsed realtime since some
1750               point in the past (such as system startup), user and system
1751               times for this process, and user and system times used by child
1752               processes.  All times are returned in clock ticks.
1753
1754                   ($realtime, $user, $system, $cuser, $csystem)
1755                       = POSIX::times();
1756
1757               Note: Perl's builtin "times()" function returns four values,
1758               measured in seconds.
1759
1760       "tmpfile"
1761               Not implemented.  Use method "IO::File::new_tmpfile()" instead,
1762               or see File::Temp.
1763
1764       "tmpnam"
1765               For security reasons, which are probably detailed in your
1766               system's documentation for the C library "tmpnam()" function,
1767               this interface is no longer available; instead use File::Temp.
1768
1769       "tolower"
1770               This is identical to the C function, except that it can apply
1771               to a single character or to a whole string, and currently
1772               operates as if the locale always is "C".  Consider using the
1773               "lc()" function, see "lc" in perlfunc, see "lc" in perlfunc, or
1774               the equivalent "\L" operator inside doublequotish strings.
1775
1776       "toupper"
1777               This is similar to the C function, except that it can apply to
1778               a single character or to a whole string, and currently operates
1779               as if the locale always is "C".  Consider using the "uc()"
1780               function, see "uc" in perlfunc, or the equivalent "\U" operator
1781               inside doublequotish strings.
1782
1783       "trunc" Returns the integer toward zero from the argument [C99].
1784
1785               See also "ceil", "floor", and "round".
1786
1787       "ttyname"
1788               This is identical to the C function "ttyname()" for returning
1789               the name of the current terminal.
1790
1791       "tzname"
1792               Retrieves the time conversion information from the "tzname"
1793               variable.
1794
1795                       POSIX::tzset();
1796                       ($std, $dst) = POSIX::tzname();
1797
1798       "tzset" This is identical to the C function "tzset()" for setting the
1799               current timezone based on the environment variable "TZ", to be
1800               used by "ctime()", "localtime()", "mktime()", and "strftime()"
1801               functions.
1802
1803       "umask" This is identical to Perl's builtin "umask()" function for
1804               setting (and querying) the file creation permission mask, see
1805               "umask" in perlfunc.
1806
1807       "uname" Get name of current operating system.
1808
1809                       ($sysname, $nodename, $release, $version, $machine)
1810                               = POSIX::uname();
1811
1812               Note that the actual meanings of the various fields are not
1813               that well standardized, do not expect any great portability.
1814               The $sysname might be the name of the operating system, the
1815               $nodename might be the name of the host, the $release might be
1816               the (major) release number of the operating system, the
1817               $version might be the (minor) release number of the operating
1818               system, and the $machine might be a hardware identifier.
1819               Maybe.
1820
1821       "ungetc"
1822               Not implemented.  Use method "IO::Handle::ungetc()" instead.
1823
1824       "unlink"
1825               This is identical to Perl's builtin "unlink()" function for
1826               removing files, see "unlink" in perlfunc.
1827
1828       "utime" This is identical to Perl's builtin "utime()" function for
1829               changing the time stamps of files and directories, see "utime"
1830               in perlfunc.
1831
1832       "vfprintf"
1833               Not implemented.  "vfprintf()" is C-specific, see "printf" in
1834               perlfunc instead.
1835
1836       "vprintf"
1837               Not implemented.  "vprintf()" is C-specific, see "printf" in
1838               perlfunc instead.
1839
1840       "vsprintf"
1841               Not implemented.  "vsprintf()" is C-specific, see "sprintf" in
1842               perlfunc instead.
1843
1844       "wait"  This is identical to Perl's builtin "wait()" function, see
1845               "wait" in perlfunc.
1846
1847       "waitpid"
1848               Wait for a child process to change state.  This is identical to
1849               Perl's builtin "waitpid()" function, see "waitpid" in perlfunc.
1850
1851                       $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
1852                       print "status = ", ($? / 256), "\n";
1853
1854       "wcstombs"
1855               This is identical to the C function "wcstombs()".
1856
1857               See "mblen".
1858
1859       "wctomb"
1860               This is identical to the C function "wctomb()".
1861
1862               See "mblen".
1863
1864       "write" Write to a file.  This uses file descriptors such as those
1865               obtained by calling "POSIX::open".
1866
1867                       $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
1868                       $buf = "hello";
1869                       $bytes = POSIX::write( $fd, $buf, 5 );
1870
1871               Returns "undef" on failure.
1872
1873               See also "syswrite" in perlfunc.
1874

CLASSES

1876   "POSIX::SigAction"
1877       "new"   Creates a new "POSIX::SigAction" object which corresponds to
1878               the C "struct sigaction".  This object will be destroyed
1879               automatically when it is no longer needed.  The first parameter
1880               is the handler, a sub reference.  The second parameter is a
1881               "POSIX::SigSet" object, it defaults to the empty set.  The
1882               third parameter contains the "sa_flags", it defaults to 0.
1883
1884                       $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
1885                       $sigaction = POSIX::SigAction->new(
1886                                       \&handler, $sigset, &POSIX::SA_NOCLDSTOP
1887                                    );
1888
1889               This "POSIX::SigAction" object is intended for use with the
1890               "POSIX::sigaction()" function.
1891
1892       "handler"
1893       "mask"
1894       "flags" accessor functions to get/set the values of a SigAction object.
1895
1896                       $sigset = $sigaction->mask;
1897                       $sigaction->flags(&POSIX::SA_RESTART);
1898
1899       "safe"  accessor function for the "safe signals" flag of a SigAction
1900               object; see perlipc for general information on safe (a.k.a.
1901               "deferred") signals.  If you wish to handle a signal safely,
1902               use this accessor to set the "safe" flag in the
1903               "POSIX::SigAction" object:
1904
1905                       $sigaction->safe(1);
1906
1907               You may also examine the "safe" flag on the output action
1908               object which is filled in when given as the third parameter to
1909               "POSIX::sigaction()":
1910
1911                       sigaction(SIGINT, $new_action, $old_action);
1912                       if ($old_action->safe) {
1913                           # previous SIGINT handler used safe signals
1914                       }
1915
1916   "POSIX::SigRt"
1917       %SIGRT  A hash of the POSIX realtime signal handlers.  It is an
1918               extension of the standard %SIG, the $POSIX::SIGRT{SIGRTMIN} is
1919               roughly equivalent to $SIG{SIGRTMIN}, but the right POSIX moves
1920               (see below) are made with the "POSIX::SigSet" and
1921               "POSIX::sigaction" instead of accessing the %SIG.
1922
1923               You can set the %POSIX::SIGRT elements to set the POSIX
1924               realtime signal handlers, use "delete" and "exists" on the
1925               elements, and use "scalar" on the %POSIX::SIGRT to find out how
1926               many POSIX realtime signals there are available
1927               "(SIGRTMAX - SIGRTMIN + 1", the "SIGRTMAX" is a valid POSIX
1928               realtime signal).
1929
1930               Setting the %SIGRT elements is equivalent to calling this:
1931
1932                 sub new {
1933                   my ($rtsig, $handler, $flags) = @_;
1934                   my $sigset = POSIX::SigSet($rtsig);
1935                   my $sigact = POSIX::SigAction->new($handler,$sigset,$flags);
1936                   sigaction($rtsig, $sigact);
1937                 }
1938
1939               The flags default to zero, if you want something different you
1940               can either use "local" on $POSIX::SigRt::SIGACTION_FLAGS, or
1941               you can derive from POSIX::SigRt and define your own "new()"
1942               (the tied hash STORE method of the %SIGRT calls "new($rtsig,
1943               $handler, $SIGACTION_FLAGS)", where the $rtsig ranges from zero
1944               to "SIGRTMAX - SIGRTMIN + 1)".
1945
1946               Just as with any signal, you can use "sigaction($rtsig, undef,
1947               $oa)" to retrieve the installed signal handler (or, rather, the
1948               signal action).
1949
1950               NOTE: whether POSIX realtime signals really work in your
1951               system, or whether Perl has been compiled so that it works with
1952               them, is outside of this discussion.
1953
1954       "SIGRTMIN"
1955               Return the minimum POSIX realtime signal number available, or
1956               "undef" if no POSIX realtime signals are available.
1957
1958       "SIGRTMAX"
1959               Return the maximum POSIX realtime signal number available, or
1960               "undef" if no POSIX realtime signals are available.
1961
1962   "POSIX::SigSet"
1963       "new"   Create a new SigSet object.  This object will be destroyed
1964               automatically when it is no longer needed.  Arguments may be
1965               supplied to initialize the set.
1966
1967               Create an empty set.
1968
1969                       $sigset = POSIX::SigSet->new;
1970
1971               Create a set with "SIGUSR1".
1972
1973                       $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
1974
1975       "addset"
1976               Add a signal to a SigSet object.
1977
1978                       $sigset->addset( &POSIX::SIGUSR2 );
1979
1980               Returns "undef" on failure.
1981
1982       "delset"
1983               Remove a signal from the SigSet object.
1984
1985                       $sigset->delset( &POSIX::SIGUSR2 );
1986
1987               Returns "undef" on failure.
1988
1989       "emptyset"
1990               Initialize the SigSet object to be empty.
1991
1992                       $sigset->emptyset();
1993
1994               Returns "undef" on failure.
1995
1996       "fillset"
1997               Initialize the SigSet object to include all signals.
1998
1999                       $sigset->fillset();
2000
2001               Returns "undef" on failure.
2002
2003       "ismember"
2004               Tests the SigSet object to see if it contains a specific
2005               signal.
2006
2007                       if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
2008                               print "contains SIGUSR1\n";
2009                       }
2010
2011   "POSIX::Termios"
2012       "new"   Create a new Termios object.  This object will be destroyed
2013               automatically when it is no longer needed.  A Termios object
2014               corresponds to the "termios" C struct.  "new()" mallocs a new
2015               one, "getattr()" fills it from a file descriptor, and
2016               "setattr()" sets a file descriptor's parameters to match
2017               Termios' contents.
2018
2019                       $termios = POSIX::Termios->new;
2020
2021       "getattr"
2022               Get terminal control attributes.
2023
2024               Obtain the attributes for "stdin".
2025
2026                       $termios->getattr( 0 ) # Recommended for clarity.
2027                       $termios->getattr()
2028
2029               Obtain the attributes for stdout.
2030
2031                       $termios->getattr( 1 )
2032
2033               Returns "undef" on failure.
2034
2035       "getcc" Retrieve a value from the "c_cc" field of a "termios" object.
2036               The "c_cc" field is an array so an index must be specified.
2037
2038                       $c_cc[1] = $termios->getcc(1);
2039
2040       "getcflag"
2041               Retrieve the "c_cflag" field of a "termios" object.
2042
2043                       $c_cflag = $termios->getcflag;
2044
2045       "getiflag"
2046               Retrieve the "c_iflag" field of a "termios" object.
2047
2048                       $c_iflag = $termios->getiflag;
2049
2050       "getispeed"
2051               Retrieve the input baud rate.
2052
2053                       $ispeed = $termios->getispeed;
2054
2055       "getlflag"
2056               Retrieve the "c_lflag" field of a "termios" object.
2057
2058                       $c_lflag = $termios->getlflag;
2059
2060       "getoflag"
2061               Retrieve the "c_oflag" field of a "termios" object.
2062
2063                       $c_oflag = $termios->getoflag;
2064
2065       "getospeed"
2066               Retrieve the output baud rate.
2067
2068                       $ospeed = $termios->getospeed;
2069
2070       "setattr"
2071               Set terminal control attributes.
2072
2073               Set attributes immediately for stdout.
2074
2075                       $termios->setattr( 1, &POSIX::TCSANOW );
2076
2077               Returns "undef" on failure.
2078
2079       "setcc" Set a value in the "c_cc" field of a "termios" object.  The
2080               "c_cc" field is an array so an index must be specified.
2081
2082                       $termios->setcc( &POSIX::VEOF, 1 );
2083
2084       "setcflag"
2085               Set the "c_cflag" field of a "termios" object.
2086
2087                       $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
2088
2089       "setiflag"
2090               Set the "c_iflag" field of a "termios" object.
2091
2092                       $termios->setiflag( $c_iflag | &POSIX::BRKINT );
2093
2094       "setispeed"
2095               Set the input baud rate.
2096
2097                       $termios->setispeed( &POSIX::B9600 );
2098
2099               Returns "undef" on failure.
2100
2101       "setlflag"
2102               Set the "c_lflag" field of a "termios" object.
2103
2104                       $termios->setlflag( $c_lflag | &POSIX::ECHO );
2105
2106       "setoflag"
2107               Set the "c_oflag" field of a "termios" object.
2108
2109                       $termios->setoflag( $c_oflag | &POSIX::OPOST );
2110
2111       "setospeed"
2112               Set the output baud rate.
2113
2114                       $termios->setospeed( &POSIX::B9600 );
2115
2116               Returns "undef" on failure.
2117
2118       Baud rate values
2119               "B38400" "B75" "B200" "B134" "B300" "B1800" "B150" "B0"
2120               "B19200" "B1200" "B9600" "B600" "B4800" "B50" "B2400" "B110"
2121
2122       Terminal interface values
2123               "TCSADRAIN" "TCSANOW" "TCOON" "TCIOFLUSH" "TCOFLUSH" "TCION"
2124               "TCIFLUSH" "TCSAFLUSH" "TCIOFF" "TCOOFF"
2125
2126       "c_cc" field values
2127               "VEOF" "VEOL" "VERASE" "VINTR" "VKILL" "VQUIT" "VSUSP" "VSTART"
2128               "VSTOP" "VMIN" "VTIME" "NCCS"
2129
2130       "c_cflag" field values
2131               "CLOCAL" "CREAD" "CSIZE" "CS5" "CS6" "CS7" "CS8" "CSTOPB"
2132               "HUPCL" "PARENB" "PARODD"
2133
2134       "c_iflag" field values
2135               "BRKINT" "ICRNL" "IGNBRK" "IGNCR" "IGNPAR" "INLCR" "INPCK"
2136               "ISTRIP" "IXOFF" "IXON" "PARMRK"
2137
2138       "c_lflag" field values
2139               "ECHO" "ECHOE" "ECHOK" "ECHONL" "ICANON" "IEXTEN" "ISIG"
2140               "NOFLSH" "TOSTOP"
2141
2142       "c_oflag" field values
2143               "OPOST"
2144

PATHNAME CONSTANTS

2146       Constants
2147               "_PC_CHOWN_RESTRICTED" "_PC_LINK_MAX" "_PC_MAX_CANON"
2148               "_PC_MAX_INPUT" "_PC_NAME_MAX" "_PC_NO_TRUNC" "_PC_PATH_MAX"
2149               "_PC_PIPE_BUF" "_PC_VDISABLE"
2150

POSIX CONSTANTS

2152       Constants
2153               "_POSIX_ARG_MAX" "_POSIX_CHILD_MAX" "_POSIX_CHOWN_RESTRICTED"
2154               "_POSIX_JOB_CONTROL" "_POSIX_LINK_MAX" "_POSIX_MAX_CANON"
2155               "_POSIX_MAX_INPUT" "_POSIX_NAME_MAX" "_POSIX_NGROUPS_MAX"
2156               "_POSIX_NO_TRUNC" "_POSIX_OPEN_MAX" "_POSIX_PATH_MAX"
2157               "_POSIX_PIPE_BUF" "_POSIX_SAVED_IDS" "_POSIX_SSIZE_MAX"
2158               "_POSIX_STREAM_MAX" "_POSIX_TZNAME_MAX" "_POSIX_VDISABLE"
2159               "_POSIX_VERSION"
2160

RESOURCE CONSTANTS

2162       Imported with the ":sys_resource_h" tag.
2163
2164       Constants
2165               "PRIO_PROCESS" "PRIO_PGRP" "PRIO_USER"
2166

SYSTEM CONFIGURATION

2168       Constants
2169               "_SC_ARG_MAX" "_SC_CHILD_MAX" "_SC_CLK_TCK" "_SC_JOB_CONTROL"
2170               "_SC_NGROUPS_MAX" "_SC_OPEN_MAX" "_SC_PAGESIZE" "_SC_SAVED_IDS"
2171               "_SC_STREAM_MAX" "_SC_TZNAME_MAX" "_SC_VERSION"
2172

ERRNO

2174       Constants
2175               "E2BIG" "EACCES" "EADDRINUSE" "EADDRNOTAVAIL" "EAFNOSUPPORT"
2176               "EAGAIN" "EALREADY" "EBADF" "EBADMSG" "EBUSY" "ECANCELED"
2177               "ECHILD" "ECONNABORTED" "ECONNREFUSED" "ECONNRESET" "EDEADLK"
2178               "EDESTADDRREQ" "EDOM" "EDQUOT" "EEXIST" "EFAULT" "EFBIG"
2179               "EHOSTDOWN" "EHOSTUNREACH" "EIDRM" "EILSEQ" "EINPROGRESS"
2180               "EINTR" "EINVAL" "EIO" "EISCONN" "EISDIR" "ELOOP" "EMFILE"
2181               "EMLINK" "EMSGSIZE" "ENAMETOOLONG" "ENETDOWN" "ENETRESET"
2182               "ENETUNREACH" "ENFILE" "ENOBUFS" "ENODATA" "ENODEV" "ENOENT"
2183               "ENOEXEC" "ENOLCK" "ENOLINK" "ENOMEM" "ENOMSG" "ENOPROTOOPT"
2184               "ENOSPC" "ENOSR" "ENOSTR" "ENOSYS" "ENOTBLK" "ENOTCONN"
2185               "ENOTDIR" "ENOTEMPTY" "ENOTRECOVERABLE" "ENOTSOCK" "ENOTSUP"
2186               "ENOTTY" "ENXIO" "EOPNOTSUPP" "EOTHER" "EOVERFLOW" "EOWNERDEAD"
2187               "EPERM" "EPFNOSUPPORT" "EPIPE" "EPROCLIM" "EPROTO"
2188               "EPROTONOSUPPORT" "EPROTOTYPE" "ERANGE" "EREMOTE" "ERESTART"
2189               "EROFS" "ESHUTDOWN" "ESOCKTNOSUPPORT" "ESPIPE" "ESRCH" "ESTALE"
2190               "ETIME" "ETIMEDOUT" "ETOOMANYREFS" "ETXTBSY" "EUSERS"
2191               "EWOULDBLOCK" "EXDEV"
2192

FCNTL

2194       Constants
2195               "FD_CLOEXEC" "F_DUPFD" "F_GETFD" "F_GETFL" "F_GETLK" "F_OK"
2196               "F_RDLCK" "F_SETFD" "F_SETFL" "F_SETLK" "F_SETLKW" "F_UNLCK"
2197               "F_WRLCK" "O_ACCMODE" "O_APPEND" "O_CREAT" "O_EXCL" "O_NOCTTY"
2198               "O_NONBLOCK" "O_RDONLY" "O_RDWR" "O_TRUNC" "O_WRONLY"
2199

FLOAT

2201       Constants
2202               "DBL_DIG" "DBL_EPSILON" "DBL_MANT_DIG" "DBL_MAX"
2203               "DBL_MAX_10_EXP" "DBL_MAX_EXP" "DBL_MIN" "DBL_MIN_10_EXP"
2204               "DBL_MIN_EXP" "FLT_DIG" "FLT_EPSILON" "FLT_MANT_DIG" "FLT_MAX"
2205               "FLT_MAX_10_EXP" "FLT_MAX_EXP" "FLT_MIN" "FLT_MIN_10_EXP"
2206               "FLT_MIN_EXP" "FLT_RADIX" "FLT_ROUNDS" "LDBL_DIG"
2207               "LDBL_EPSILON" "LDBL_MANT_DIG" "LDBL_MAX" "LDBL_MAX_10_EXP"
2208               "LDBL_MAX_EXP" "LDBL_MIN" "LDBL_MIN_10_EXP" "LDBL_MIN_EXP"
2209

FLOATING-POINT ENVIRONMENT

2211       Constants
2212               "FE_DOWNWARD" "FE_TONEAREST" "FE_TOWARDZERO" "FE_UPWARD" on
2213               systems that support them.
2214

LIMITS

2216       Constants
2217               "ARG_MAX" "CHAR_BIT" "CHAR_MAX" "CHAR_MIN" "CHILD_MAX"
2218               "INT_MAX" "INT_MIN" "LINK_MAX" "LONG_MAX" "LONG_MIN"
2219               "MAX_CANON" "MAX_INPUT" "MB_LEN_MAX" "NAME_MAX" "NGROUPS_MAX"
2220               "OPEN_MAX" "PATH_MAX" "PIPE_BUF" "SCHAR_MAX" "SCHAR_MIN"
2221               "SHRT_MAX" "SHRT_MIN" "SSIZE_MAX" "STREAM_MAX" "TZNAME_MAX"
2222               "UCHAR_MAX" "UINT_MAX" "ULONG_MAX" "USHRT_MAX"
2223

LOCALE

2225       Constants
2226               "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MONETARY" "LC_NUMERIC"
2227               "LC_TIME" "LC_MESSAGES" on systems that support them.
2228

MATH

2230       Constants
2231               "HUGE_VAL"
2232
2233               "FP_ILOGB0" "FP_ILOGBNAN" "FP_INFINITE" "FP_NAN" "FP_NORMAL"
2234               "FP_SUBNORMAL" "FP_ZERO" "INFINITY" "NAN" "Inf" "NaN" "M_1_PI"
2235               "M_2_PI" "M_2_SQRTPI" "M_E" "M_LN10" "M_LN2" "M_LOG10E"
2236               "M_LOG2E" "M_PI" "M_PI_2" "M_PI_4" "M_SQRT1_2" "M_SQRT2" on
2237               systems with C99 support.
2238

SIGNAL

2240       Constants
2241               "SA_NOCLDSTOP" "SA_NOCLDWAIT" "SA_NODEFER" "SA_ONSTACK"
2242               "SA_RESETHAND" "SA_RESTART" "SA_SIGINFO" "SIGABRT" "SIGALRM"
2243               "SIGCHLD" "SIGCONT" "SIGFPE" "SIGHUP" "SIGILL" "SIGINT"
2244               "SIGKILL" "SIGPIPE" "SIGQUIT" "SIGSEGV" "SIGSTOP" "SIGTERM"
2245               "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGUSR1" "SIGUSR2" "SIG_BLOCK"
2246               "SIG_DFL" "SIG_ERR" "SIG_IGN" "SIG_SETMASK" "SIG_UNBLOCK"
2247               "ILL_ILLOPC" "ILL_ILLOPN" "ILL_ILLADR" "ILL_ILLTRP"
2248               "ILL_PRVOPC" "ILL_PRVREG" "ILL_COPROC" "ILL_BADSTK"
2249               "FPE_INTDIV" "FPE_INTOVF" "FPE_FLTDIV" "FPE_FLTOVF"
2250               "FPE_FLTUND" "FPE_FLTRES" "FPE_FLTINV" "FPE_FLTSUB"
2251               "SEGV_MAPERR" "SEGV_ACCERR" "BUS_ADRALN" "BUS_ADRERR"
2252               "BUS_OBJERR" "TRAP_BRKPT" "TRAP_TRACE" "CLD_EXITED"
2253               "CLD_KILLED" "CLD_DUMPED" "CLD_TRAPPED" "CLD_STOPPED"
2254               "CLD_CONTINUED" "POLL_IN" "POLL_OUT" "POLL_MSG" "POLL_ERR"
2255               "POLL_PRI" "POLL_HUP" "SI_USER" "SI_QUEUE" "SI_TIMER"
2256               "SI_ASYNCIO" "SI_MESGQ"
2257

STAT

2259       Constants
2260               "S_IRGRP" "S_IROTH" "S_IRUSR" "S_IRWXG" "S_IRWXO" "S_IRWXU"
2261               "S_ISGID" "S_ISUID" "S_IWGRP" "S_IWOTH" "S_IWUSR" "S_IXGRP"
2262               "S_IXOTH" "S_IXUSR"
2263
2264       Macros  "S_ISBLK" "S_ISCHR" "S_ISDIR" "S_ISFIFO" "S_ISREG"
2265

STDLIB

2267       Constants
2268               "EXIT_FAILURE" "EXIT_SUCCESS" "MB_CUR_MAX" "RAND_MAX"
2269

STDIO

2271       Constants
2272               "BUFSIZ" "EOF" "FILENAME_MAX" "L_ctermid" "L_cuserid" "TMP_MAX"
2273

TIME

2275       Constants
2276               "CLK_TCK" "CLOCKS_PER_SEC"
2277

UNISTD

2279       Constants
2280               "R_OK" "SEEK_CUR" "SEEK_END" "SEEK_SET" "STDIN_FILENO"
2281               "STDOUT_FILENO" "STDERR_FILENO" "W_OK" "X_OK"
2282

WAIT

2284       Constants
2285               "WNOHANG" "WUNTRACED"
2286
2287               "WNOHANG"       Do not suspend the calling process until a
2288                               child process changes state but instead return
2289                               immediately.
2290
2291               "WUNTRACED"     Catch stopped child processes.
2292
2293       Macros  "WIFEXITED" "WEXITSTATUS" "WIFSIGNALED" "WTERMSIG" "WIFSTOPPED"
2294               "WSTOPSIG"
2295
2296               "WIFEXITED"     "WIFEXITED(${^CHILD_ERROR_NATIVE})" returns
2297                               true if the child process exited normally
2298                               ("exit()" or by falling off the end of
2299                               "main()")
2300
2301               "WEXITSTATUS"   "WEXITSTATUS(${^CHILD_ERROR_NATIVE})" returns
2302                               the normal exit status of the child process
2303                               (only meaningful if
2304                               "WIFEXITED(${^CHILD_ERROR_NATIVE})" is true)
2305
2306               "WIFSIGNALED"   "WIFSIGNALED(${^CHILD_ERROR_NATIVE})" returns
2307                               true if the child process terminated because of
2308                               a signal
2309
2310               "WTERMSIG"      "WTERMSIG(${^CHILD_ERROR_NATIVE})" returns the
2311                               signal the child process terminated for (only
2312                               meaningful if
2313                               "WIFSIGNALED(${^CHILD_ERROR_NATIVE})" is true)
2314
2315               "WIFSTOPPED"    "WIFSTOPPED(${^CHILD_ERROR_NATIVE})" returns
2316                               true if the child process is currently stopped
2317                               (can happen only if you specified the WUNTRACED
2318                               flag to "waitpid()")
2319
2320               "WSTOPSIG"      "WSTOPSIG(${^CHILD_ERROR_NATIVE})" returns the
2321                               signal the child process was stopped for (only
2322                               meaningful if
2323                               "WIFSTOPPED(${^CHILD_ERROR_NATIVE})" is true)
2324

WINSOCK

2326       (Windows only.)
2327
2328       Constants
2329               "WSAEINTR" "WSAEBADF" "WSAEACCES" "WSAEFAULT" "WSAEINVAL"
2330               "WSAEMFILE" "WSAEWOULDBLOCK" "WSAEINPROGRESS" "WSAEALREADY"
2331               "WSAENOTSOCK" "WSAEDESTADDRREQ" "WSAEMSGSIZE" "WSAEPROTOTYPE"
2332               "WSAENOPROTOOPT" "WSAEPROTONOSUPPORT" "WSAESOCKTNOSUPPORT"
2333               "WSAEOPNOTSUPP" "WSAEPFNOSUPPORT" "WSAEAFNOSUPPORT"
2334               "WSAEADDRINUSE" "WSAEADDRNOTAVAIL" "WSAENETDOWN"
2335               "WSAENETUNREACH" "WSAENETRESET" "WSAECONNABORTED"
2336               "WSAECONNRESET" "WSAENOBUFS" "WSAEISCONN" "WSAENOTCONN"
2337               "WSAESHUTDOWN" "WSAETOOMANYREFS" "WSAETIMEDOUT"
2338               "WSAECONNREFUSED" "WSAELOOP" "WSAENAMETOOLONG" "WSAEHOSTDOWN"
2339               "WSAEHOSTUNREACH" "WSAENOTEMPTY" "WSAEPROCLIM" "WSAEUSERS"
2340               "WSAEDQUOT" "WSAESTALE" "WSAEREMOTE" "WSAEDISCON" "WSAENOMORE"
2341               "WSAECANCELLED" "WSAEINVALIDPROCTABLE" "WSAEINVALIDPROVIDER"
2342               "WSAEPROVIDERFAILEDINIT" "WSAEREFUSED"
2343
2344
2345
2346perl v5.30.1                      2019-11-29                        POSIX(3pm)
Impressum