This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX.pod: Add cautions about locale use
[perl5.git] / ext / POSIX / lib / POSIX.pod
1 =head1 NAME
2
3 POSIX - Perl interface to IEEE Std 1003.1
4
5 =head1 SYNOPSIS
6
7     use POSIX ();
8     use POSIX qw(setsid);
9     use POSIX qw(:errno_h :fcntl_h);
10
11     printf "EINTR is %d\n", EINTR;
12
13     $sess_id = POSIX::setsid();
14
15     $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
16         # note: that's a filedescriptor, *NOT* a filehandle
17
18 =head1 DESCRIPTION
19
20 The POSIX module permits you to access all (or nearly all) the standard
21 POSIX 1003.1 identifiers.  Many of these identifiers have been given Perl-ish
22 interfaces.
23
24 This document gives a condensed list of the features available in the POSIX
25 module.  Consult your operating system's manpages for general information on
26 most features.  Consult L<perlfunc> for functions which are noted as being
27 identical or almost identical to Perl's builtin functions.
28
29 The first section describes POSIX functions from the 1003.1 specification.
30 The second section describes some classes for signal objects, TTY objects,
31 and other miscellaneous objects.  The remaining sections list various
32 constants and macros in an organization which roughly follows IEEE Std
33 1003.1b-1993.
34
35 =head1 CAVEATS
36
37 I<Everything is exported by default> (with a handful of exceptions).
38 This is an unfortunate backwards compatibility feature and its use is
39 B<strongly L<discouraged|perlpolicy/discouraged>>.
40 You should either prevent the exporting (by saying S<C<use POSIX ();>>,
41 as usual) and then use fully qualified names (e.g. C<POSIX::SEEK_END>),
42 or give an explicit import list.
43 If you do neither and opt for the default (as in S<C<use POSIX;>>), you
44 will import I<hundreds and hundreds> of symbols into your namespace.
45
46 A few functions are not implemented because they are C specific.  If you
47 attempt to call these, they will print a message telling you that they
48 aren't implemented, and suggest using the Perl equivalent, should one
49 exist.  For example, trying to access the C<setjmp()> call will elicit the
50 message "C<setjmp() is C-specific: use eval {} instead>".
51
52 Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
53 are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
54 For example, one vendor may not define C<EDEADLK>, or the semantics of the
55 errno values set by C<open(2)> might not be quite right.  Perl does not
56 attempt to verify POSIX compliance.  That means you can currently
57 successfully say "use POSIX",  and then later in your program you find
58 that your vendor has been lax and there's no usable C<ICANON> macro after
59 all.  This could be construed to be a bug.
60
61 =head1 FUNCTIONS
62
63 =over 8
64
65 =item C<_exit>
66
67 This is identical to the C function C<_exit()>.  It exits the program
68 immediately which means among other things buffered I/O is B<not> flushed.
69
70 Note that when using threads and in Linux this is B<not> a good way to
71 exit a thread because in Linux processes and threads are kind of the
72 same thing (Note: while this is the situation in early 2003 there are
73 projects under way to have threads with more POSIXly semantics in Linux).
74 If you want not to return from a thread, detach the thread.
75
76 =item C<abort>
77
78 This is identical to the C function C<abort()>.  It terminates the
79 process with a C<SIGABRT> signal unless caught by a signal handler or
80 if the handler does not return normally (it e.g.  does a C<longjmp>).
81
82 =item C<abs>
83
84 This is identical to Perl's builtin C<abs()> function, returning the absolute
85 value of its numerical argument (except that C<POSIX::abs()> must be provided
86 an explicit value (rather than relying on an implicit C<$_>):
87
88     $absolute_value = POSIX::abs(42);   # good
89
90     $absolute_value = POSIX::abs();     # throws exception
91
92 =item C<access>
93
94 Determines the accessibility of a file.
95
96         if( POSIX::access( "/", &POSIX::R_OK ) ){
97                 print "have read permission\n";
98         }
99
100 Returns C<undef> on failure.  Note: do not use C<access()> for
101 security purposes.  Between the C<access()> call and the operation
102 you are preparing for the permissions might change: a classic
103 I<race condition>.
104
105 =item C<acos>
106
107 This is identical to the C function C<acos()>, returning
108 the arcus cosine of its numerical argument.  See also L<Math::Trig>.
109
110 =item C<acosh>
111
112 This is identical to the C function C<acosh()>, returning the
113 hyperbolic arcus cosine of its numerical argument [C99].  See also
114 L<Math::Trig>.
115
116 =item C<alarm>
117
118 This is identical to Perl's builtin C<alarm()> function, either for arming or
119 disarming the C<SIGARLM> timer, except that C<POSIX::alarm()> must be provided
120 an explicit value (rather than relying on an implicit C<$_>):
121
122     POSIX::alarm(3)     # good
123
124     POSIX::alarm()      # throws exception
125
126 =item C<asctime>
127
128 This is identical to the C function C<asctime()>.  It returns
129 a string of the form
130
131         "Fri Jun  2 18:22:13 2000\n\0"
132
133 and it is called thusly
134
135         $asctime = asctime($sec, $min, $hour, $mday, $mon,
136                            $year, $wday, $yday, $isdst);
137
138 The C<$mon> is zero-based: January equals C<0>.  The C<$year> is
139 1900-based: 2001 equals C<101>.  C<$wday> and C<$yday> default to zero
140 (and are usually ignored anyway), and C<$isdst> defaults to -1.
141
142 =item C<asin>
143
144 This is identical to the C function C<asin()>, returning
145 the arcus sine of its numerical argument.  See also L<Math::Trig>.
146
147 =item C<asinh>
148
149 This is identical to the C function C<asinh()>, returning the
150 hyperbolic arcus sine of its numerical argument [C99].  See also
151 L<Math::Trig>.
152
153 =item C<assert>
154
155 Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
156 to achieve similar things.
157
158 =item C<atan>
159
160 This is identical to the C function C<atan()>, returning the
161 arcus tangent of its numerical argument.  See also L<Math::Trig>.
162
163 =item C<atanh>
164
165 This is identical to the C function C<atanh()>, returning the
166 hyperbolic arcus tangent of its numerical argument [C99].  See also
167 L<Math::Trig>.
168
169 =item C<atan2>
170
171 This is identical to Perl's builtin C<atan2()> function, returning
172 the arcus tangent defined by its two numerical arguments, the I<y>
173 coordinate and the I<x> coordinate.  See also L<Math::Trig>.
174
175 =item C<atexit>
176
177 Not implemented.  C<atexit()> is C-specific: use C<END {}> instead, see L<perlmod>.
178
179 =item C<atof>
180
181 Not implemented.  C<atof()> is C-specific.  Perl converts strings to numbers transparently.
182 If you need to force a scalar to a number, add a zero to it.
183
184 =item C<atoi>
185
186 Not implemented.  C<atoi()> is C-specific.  Perl converts strings to numbers transparently.
187 If you need to force a scalar to a number, add a zero to it.
188 If you need to have just the integer part, see L<perlfunc/int>.
189
190 =item C<atol>
191
192 Not implemented.  C<atol()> is C-specific.  Perl converts strings to numbers transparently.
193 If you need to force a scalar to a number, add a zero to it.
194 If you need to have just the integer part, see L<perlfunc/int>.
195
196 =item C<bsearch>
197
198 C<bsearch()> not supplied.  For doing binary search on wordlists,
199 see L<Search::Dict>.
200
201 =item C<calloc>
202
203 Not implemented.  C<calloc()> is C-specific.  Perl does memory management transparently.
204
205 =item C<cbrt>
206
207 The cube root [C99].
208
209 =item C<ceil>
210
211 This is identical to the C function C<ceil()>, returning the smallest
212 integer value greater than or equal to the given numerical argument.
213
214 =item C<chdir>
215
216 This is identical to Perl's builtin C<chdir()> function, allowing one to
217 change the working (default) directory -- see L<perlfunc/chdir> -- with the
218 exception that C<POSIX::chdir()> must be provided an explicit value (rather
219 than relying on an implicit C<$_>):
220
221     $rv = POSIX::chdir('path/to/dir');      # good
222
223     $rv = POSIX::chdir();                   # throws exception
224
225 =item C<chmod>
226
227 This is identical to Perl's builtin C<chmod()> function, allowing
228 one to change file and directory permissions -- see L<perlfunc/chmod> -- with
229 the exception that C<POSIX::chmod()> can only change one file at a time
230 (rather than a list of files):
231
232     $c = chmod 0664, $file1, $file2;          # good
233
234     $c = POSIX::chmod 0664, $file1;           # throws exception
235
236     $c = POSIX::chmod 0664, $file1, $file2;   # throws exception
237
238 =item C<chown>
239
240 This is identical to Perl's builtin C<chown()> function, allowing one
241 to change file and directory owners and groups, see L<perlfunc/chown>.
242
243 =item C<clearerr>
244
245 Not implemented.  Use the method C<IO::Handle::clearerr()> instead, to reset the error
246 state (if any) and EOF state (if any) of the given stream.
247
248 =item C<clock>
249
250 This is identical to the C function C<clock()>, returning the
251 amount of spent processor time in microseconds.
252
253 =item C<close>
254
255 Close the file.  This uses file descriptors such as those obtained by calling
256 C<POSIX::open>.
257
258         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
259         POSIX::close( $fd );
260
261 Returns C<undef> on failure.
262
263 See also L<perlfunc/close>.
264
265 =item C<closedir>
266
267 This is identical to Perl's builtin C<closedir()> function for closing
268 a directory handle, see L<perlfunc/closedir>.
269
270 =item C<cos>
271
272 This is identical to Perl's builtin C<cos()> function, for returning
273 the cosine of its numerical argument, see L<perlfunc/cos>.
274 See also L<Math::Trig>.
275
276 =item C<cosh>
277
278 This is identical to the C function C<cosh()>, for returning
279 the hyperbolic cosine of its numeric argument.  See also L<Math::Trig>.
280
281 =item C<copysign>
282
283 Returns C<x> but with the sign of C<y> [C99].
284
285  $x_with_sign_of_y = POSIX::copysign($x, $y);
286
287 See also L</signbit>.
288
289 =item C<creat>
290
291 Create a new file.  This returns a file descriptor like the ones returned by
292 C<POSIX::open>.  Use C<POSIX::close> to close the file.
293
294         $fd = POSIX::creat( "foo", 0611 );
295         POSIX::close( $fd );
296
297 See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
298
299 =item C<ctermid>
300
301 Generates the path name for the controlling terminal.
302
303         $path = POSIX::ctermid();
304
305 =item C<ctime>
306
307 This is identical to the C function C<ctime()> and equivalent
308 to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
309
310 =item C<cuserid>
311
312 Get the login name of the owner of the current process.
313
314         $name = POSIX::cuserid();
315
316 =item C<difftime>
317
318 This is identical to the C function C<difftime()>, for returning
319 the time difference (in seconds) between two times (as returned
320 by C<time()>), see L</time>.
321
322 =item C<div>
323
324 Not implemented.  C<div()> is C-specific, use L<perlfunc/int> on the usual C</> division and
325 the modulus C<%>.
326
327 =item C<dup>
328
329 This is similar to the C function C<dup()>, for duplicating a file
330 descriptor.
331
332 This uses file descriptors such as those obtained by calling
333 C<POSIX::open>.
334
335 Returns C<undef> on failure.
336
337 =item C<dup2>
338
339 This is similar to the C function C<dup2()>, for duplicating a file
340 descriptor to an another known file descriptor.
341
342 This uses file descriptors such as those obtained by calling
343 C<POSIX::open>.
344
345 Returns C<undef> on failure.
346
347 =item C<erf>
348
349 The error function [C99].
350
351 =item C<erfc>
352
353 The complementary error function [C99].
354
355 =item C<errno>
356
357 Returns the value of errno.
358
359         $errno = POSIX::errno();
360
361 This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
362
363 =item C<execl>
364
365 Not implemented.  C<execl()> is C-specific, see L<perlfunc/exec>.
366
367 =item C<execle>
368
369 Not implemented.  C<execle()> is C-specific, see L<perlfunc/exec>.
370
371 =item C<execlp>
372
373 Not implemented.  C<execlp()> is C-specific, see L<perlfunc/exec>.
374
375 =item C<execv>
376
377 Not implemented.  C<execv()> is C-specific, see L<perlfunc/exec>.
378
379 =item C<execve>
380
381 Not implemented.  C<execve()> is C-specific, see L<perlfunc/exec>.
382
383 =item C<execvp>
384
385 Not implemented.  C<execvp()> is C-specific, see L<perlfunc/exec>.
386
387 =item C<exit>
388
389 This is identical to Perl's builtin C<exit()> function for exiting the
390 program, see L<perlfunc/exit>.
391
392 =item C<exp>
393
394 This is identical to Perl's builtin C<exp()> function for
395 returning the exponent (I<e>-based) of the numerical argument,
396 see L<perlfunc/exp>.
397
398 =item C<expm1>
399
400 Equivalent to C<exp(x) - 1>, but more precise for small argument values [C99].
401
402 See also L</log1p>.
403
404 =item C<fabs>
405
406 This is identical to Perl's builtin C<abs()> function for returning
407 the absolute value of the numerical argument, see L<perlfunc/abs>.
408
409 =item C<fclose>
410
411 Not implemented.  Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
412
413 =item C<fcntl>
414
415 This is identical to Perl's builtin C<fcntl()> function,
416 see L<perlfunc/fcntl>.
417
418 =item C<fdopen>
419
420 Not implemented.  Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
421
422 =item C<feof>
423
424 Not implemented.  Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
425
426 =item C<ferror>
427
428 Not implemented.  Use method C<IO::Handle::error()> instead.
429
430 =item C<fflush>
431
432 Not implemented.  Use method C<IO::Handle::flush()> instead.
433 See also C<L<perlvar/$OUTPUT_AUTOFLUSH>>.
434
435 =item C<fgetc>
436
437 Not implemented.  Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
438
439 =item C<fgetpos>
440
441 Not implemented.  Use method C<IO::Seekable::getpos()> instead, or see L<perlfunc/seek>.
442
443 =item C<fgets>
444
445 Not implemented.  Use method C<IO::Handle::gets()> instead.  Similar to E<lt>E<gt>, also known
446 as L<perlfunc/readline>.
447
448 =item C<fileno>
449
450 Not implemented.  Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
451
452 =item C<floor>
453
454 This is identical to the C function C<floor()>, returning the largest
455 integer value less than or equal to the numerical argument.
456
457 =item C<fdim>
458
459 "Positive difference", S<C<x - y>> if S<C<x E<gt> y>>, zero otherwise [C99].
460
461 =item C<fegetround>
462
463 Returns the current floating point rounding mode, one of
464
465   FE_TONEAREST FE_TOWARDZERO FE_UPWARD FE_UPWARD
466
467 C<FE_TONEAREST> is like L</round>, C<FE_TOWARDZERO> is like L</trunc> [C99].
468
469 =item C<fesetround>
470
471 Sets the floating point rounding mode, see L</fegetround> [C99].
472
473 =item C<fma>
474
475 "Fused multiply-add", S<C<x * y + z>>, possibly faster (and less lossy)
476 than the explicit two operations [C99].
477
478  my $fused = POSIX::fma($x, $y, $z);
479
480 =item C<fmax>
481
482 Maximum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
483
484  my $min = POSIX::fmax($x, $y);
485
486 =item C<fmin>
487
488 Minimum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
489
490  my $min = POSIX::fmin($x, $y);
491
492 =item C<fmod>
493
494 This is identical to the C function C<fmod()>.
495
496         $r = fmod($x, $y);
497
498 It returns the remainder S<C<$r = $x - $n*$y>>, where S<C<$n = trunc($x/$y)>>.
499 The C<$r> has the same sign as C<$x> and magnitude (absolute value)
500 less than the magnitude of C<$y>.
501
502 =item C<fopen>
503
504 Not implemented.  Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
505
506 =item C<fork>
507
508 This is identical to Perl's builtin C<fork()> function
509 for duplicating the current process, see L<perlfunc/fork>
510 and L<perlfork> if you are in Windows.
511
512 =item C<fpathconf>
513
514 Retrieves the value of a configurable limit on a file or directory.  This
515 uses file descriptors such as those obtained by calling C<POSIX::open>.
516
517 The following will determine the maximum length of the longest allowable
518 pathname on the filesystem which holds F</var/foo>.
519
520         $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
521         $path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX);
522
523 Returns C<undef> on failure.
524
525 =item C<fpclassify>
526
527 Returns one of
528
529   FP_NORMAL FP_ZERO FP_SUBNORMAL FP_INFINITE FP_NAN
530
531 telling the class of the argument [C99].  C<FP_INFINITE> is positive
532 or negative infinity, C<FP_NAN> is not-a-number.  C<FP_SUBNORMAL>
533 means subnormal numbers (also known as denormals), very small numbers
534 with low precision. C<FP_ZERO> is zero.  C<FP_NORMAL> is all the rest.
535
536 =item C<fprintf>
537
538 Not implemented.  C<fprintf()> is C-specific, see L<perlfunc/printf> instead.
539
540 =item C<fputc>
541
542 Not implemented.  C<fputc()> is C-specific, see L<perlfunc/print> instead.
543
544 =item C<fputs>
545
546 Not implemented.  C<fputs()> is C-specific, see L<perlfunc/print> instead.
547
548 =item C<fread>
549
550 Not implemented.  C<fread()> is C-specific, see L<perlfunc/read> instead.
551
552 =item C<free>
553
554 Not implemented.  C<free()> is C-specific.  Perl does memory management transparently.
555
556 =item C<freopen>
557
558 Not implemented.  C<freopen()> is C-specific, see L<perlfunc/open> instead.
559
560 =item C<frexp>
561
562 Return the mantissa and exponent of a floating-point number.
563
564         ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
565
566 =item C<fscanf>
567
568 Not implemented.  C<fscanf()> is C-specific, use E<lt>E<gt> and regular expressions instead.
569
570 =item C<fseek>
571
572 Not implemented.  Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
573
574 =item C<fsetpos>
575
576 Not implemented.  Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
577
578 =item C<fstat>
579
580 Get file status.  This uses file descriptors such as those obtained by
581 calling C<POSIX::open>.  The data returned is identical to the data from
582 Perl's builtin C<stat> function.
583
584         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
585         @stats = POSIX::fstat( $fd );
586
587 =item C<fsync>
588
589 Not implemented.  Use method C<IO::Handle::sync()> instead.
590
591 =item C<ftell>
592
593 Not implemented.  Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
594
595 =item C<fwrite>
596
597 Not implemented.  C<fwrite()> is C-specific, see L<perlfunc/print> instead.
598
599 =item C<getc>
600
601 This is identical to Perl's builtin C<getc()> function,
602 see L<perlfunc/getc>.
603
604 =item C<getchar>
605
606 Returns one character from STDIN.  Identical to Perl's C<getc()>,
607 see L<perlfunc/getc>.
608
609 =item C<getcwd>
610
611 Returns the name of the current working directory.
612 See also L<Cwd>.
613
614 =item C<getegid>
615
616 Returns the effective group identifier.  Similar to Perl' s builtin
617 variable C<$(>, see L<perlvar/$EGID>.
618
619 =item C<getenv>
620
621 Returns the value of the specified environment variable.
622 The same information is available through the C<%ENV> array.
623
624 =item C<geteuid>
625
626 Returns the effective user identifier.  Identical to Perl's builtin C<$E<gt>>
627 variable, see L<perlvar/$EUID>.
628
629 =item C<getgid>
630
631 Returns the user's real group identifier.  Similar to Perl's builtin
632 variable C<$)>, see L<perlvar/$GID>.
633
634 =item C<getgrgid>
635
636 This is identical to Perl's builtin C<getgrgid()> function for
637 returning group entries by group identifiers, see
638 L<perlfunc/getgrgid>.
639
640 =item C<getgrnam>
641
642 This is identical to Perl's builtin C<getgrnam()> function for
643 returning group entries by group names, see L<perlfunc/getgrnam>.
644
645 =item C<getgroups>
646
647 Returns the ids of the user's supplementary groups.  Similar to Perl's
648 builtin variable C<$)>, see L<perlvar/$GID>.
649
650 =item C<getlogin>
651
652 This is identical to Perl's builtin C<getlogin()> function for
653 returning the user name associated with the current session, see
654 L<perlfunc/getlogin>.
655
656 =item C<getpayload>
657
658         use POSIX ':nan_payload';
659         getpayload($var)
660
661 Returns the C<NaN> payload.
662
663 Note the API instability warning in L</setpayload>.
664
665 See L</nan> for more discussion about C<NaN>.
666
667 =item C<getpgrp>
668
669 This is identical to Perl's builtin C<getpgrp()> function for
670 returning the process group identifier of the current process, see
671 L<perlfunc/getpgrp>.
672
673 =item C<getpid>
674
675 Returns the process identifier.  Identical to Perl's builtin
676 variable C<$$>, see L<perlvar/$PID>.
677
678 =item C<getppid>
679
680 This is identical to Perl's builtin C<getppid()> function for
681 returning the process identifier of the parent process of the current
682 process , see L<perlfunc/getppid>.
683
684 =item C<getpwnam>
685
686 This is identical to Perl's builtin C<getpwnam()> function for
687 returning user entries by user names, see L<perlfunc/getpwnam>.
688
689 =item C<getpwuid>
690
691 This is identical to Perl's builtin C<getpwuid()> function for
692 returning user entries by user identifiers, see L<perlfunc/getpwuid>.
693
694 =item C<gets>
695
696 Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
697 as the C<readline()> function, see L<perlfunc/readline>.
698
699 B<NOTE>: if you have C programs that still use C<gets()>, be very
700 afraid.  The C<gets()> function is a source of endless grief because
701 it has no buffer overrun checks.  It should B<never> be used.  The
702 C<fgets()> function should be preferred instead.
703
704 =item C<getuid>
705
706 Returns the user's identifier.  Identical to Perl's builtin C<$E<lt>> variable,
707 see L<perlvar/$UID>.
708
709 =item C<gmtime>
710
711 This is identical to Perl's builtin C<gmtime()> function for
712 converting seconds since the epoch to a date in Greenwich Mean Time,
713 see L<perlfunc/gmtime>.
714
715 =item C<hypot>
716
717 Equivalent to C<S<sqrt(x * x + y * y)>> except more stable on very large
718 or very small arguments [C99].
719
720 =item C<ilogb>
721
722 Integer binary logarithm [C99]
723
724 For example C<ilogb(20)> is 4, as an integer.
725
726 See also L</logb>.
727
728 =item C<Inf>
729
730 The infinity as a constant:
731
732    use POSIX qw(Inf);
733    my $pos_inf = +Inf;  # Or just Inf.
734    my $neg_inf = -Inf;
735
736 See also L</isinf>, and L</fpclassify>.
737
738 =item C<isalnum>
739
740 This function has been removed as of v5.24.  It was very similar to
741 matching against S<C<qr/ ^ [[:alnum:]]+ $ /x>>, which you should convert
742 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
743
744 =item C<isalpha>
745
746 This function has been removed as of v5.24.  It was very similar to
747 matching against S<C<qr/ ^ [[:alpha:]]+ $ /x>>, which you should convert
748 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
749
750 =item C<isatty>
751
752 Returns a boolean indicating whether the specified filehandle is connected
753 to a tty.  Similar to the C<-t> operator, see L<perlfunc/-X>.
754
755 =item C<iscntrl>
756
757 This function has been removed as of v5.24.  It was very similar to
758 matching against S<C<qr/ ^ [[:cntrl:]]+ $ /x>>, which you should convert
759 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
760
761 =item C<isdigit>
762
763 This function has been removed as of v5.24.  It was very similar to
764 matching against S<C<qr/ ^ [[:digit:]]+ $ /x>>, which you should convert
765 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
766
767 =item C<isfinite>
768
769 Returns true if the argument is a finite number (that is, not an
770 infinity, or the not-a-number) [C99].
771
772 See also L</isinf>, L</isnan>, and L</fpclassify>.
773
774 =item C<isgraph>
775
776 This function has been removed as of v5.24.  It was very similar to
777 matching against S<C<qr/ ^ [[:graph:]]+ $ /x>>, which you should convert
778 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
779
780 =item C<isgreater>
781
782 (Also C<isgreaterequal>, C<isless>, C<islessequal>, C<islessgreater>,
783 C<isunordered>)
784
785 Floating point comparisons which handle the C<NaN> [C99].
786
787 =item C<isinf>
788
789 Returns true if the argument is an infinity (positive or negative) [C99].
790
791 See also L</Inf>, L</isnan>, L</isfinite>, and L</fpclassify>.
792
793 =item C<islower>
794
795 This function has been removed as of v5.24.  It was very similar to
796 matching against S<C<qr/ ^ [[:lower:]]+ $ /x>>, which you should convert
797 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
798
799 =item C<isnan>
800
801 Returns true if the argument is C<NaN> (not-a-number) [C99].
802
803 Note that you cannot test for "C<NaN>-ness" with
804
805    $x == $x
806
807 since the C<NaN> is not equivalent to anything, B<including itself>.
808
809 See also L</nan>, L</NaN>, L</isinf>, and L</fpclassify>.
810
811 =item C<isnormal>
812
813 Returns true if the argument is normal (that is, not a subnormal/denormal,
814 and not an infinity, or a not-a-number) [C99].
815
816 See also L</isfinite>, and L</fpclassify>.
817
818 =item C<isprint>
819
820 This function has been removed as of v5.24.  It was very similar to
821 matching against S<C<qr/ ^ [[:print:]]+ $ /x>>, which you should convert
822 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
823
824 =item C<ispunct>
825
826 This function has been removed as of v5.24.  It was very similar to
827 matching against S<C<qr/ ^ [[:punct:]]+ $ /x>>, which you should convert
828 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
829
830 =item C<issignaling>
831
832         use POSIX ':nan_payload';
833         issignaling($var, $payload)
834
835 Return true if the argument is a I<signaling> NaN.
836
837 Note the API instability warning in L</setpayload>.
838
839 See L</nan> for more discussion about C<NaN>.
840
841 =item C<isspace>
842
843 This function has been removed as of v5.24.  It was very similar to
844 matching against S<C<qr/ ^ [[:space:]]+ $ /x>>, which you should convert
845 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
846
847 =item C<isupper>
848
849 This function has been removed as of v5.24.  It was very similar to
850 matching against S<C<qr/ ^ [[:upper:]]+ $ /x>>, which you should convert
851 to use instead.  See L<perlrecharclass/POSIX Character Classes>.
852
853 =item C<isxdigit>
854
855 This function has been removed as of v5.24.  It was very similar to
856 matching against S<C<qr/ ^ [[:xdigit:]]+ $ /x>>, which you should
857 convert to use instead.  See L<perlrecharclass/POSIX Character Classes>.
858
859 =item C<j0>
860
861 =item C<j1>
862
863 =item C<jn>
864
865 =item C<y0>
866
867 =item C<y1>
868
869 =item C<yn>
870
871 The Bessel function of the first kind of the order zero.
872
873 =item C<kill>
874
875 This is identical to Perl's builtin C<kill()> function for sending
876 signals to processes (often to terminate them), see L<perlfunc/kill>.
877
878 =item C<labs>
879
880 Not implemented.  (For returning absolute values of long integers.)
881 C<labs()> is C-specific, see L<perlfunc/abs> instead.
882
883 =item C<lchown>
884
885 This is identical to the C function, except the order of arguments is
886 consistent with Perl's builtin C<chown()> with the added restriction
887 of only one path, not a list of paths.  Does the same thing as the
888 C<chown()> function but changes the owner of a symbolic link instead
889 of the file the symbolic link points to.
890
891  POSIX::lchown($uid, $gid, $file_path);
892
893 =item C<ldexp>
894
895 This is identical to the C function C<ldexp()>
896 for multiplying floating point numbers with powers of two.
897
898         $x_quadrupled = POSIX::ldexp($x, 2);
899
900 =item C<ldiv>
901
902 Not implemented.  (For computing dividends of long integers.)
903 C<ldiv()> is C-specific, use C</> and C<int()> instead.
904
905 =item C<lgamma>
906
907 The logarithm of the Gamma function [C99].
908
909 See also L</tgamma>.
910
911 =item C<log1p>
912
913 Equivalent to S<C<log(1 + x)>>, but more stable results for small argument
914 values [C99].
915
916 =item C<log2>
917
918 Logarithm base two [C99].
919
920 See also L</expm1>.
921
922 =item C<logb>
923
924 Integer binary logarithm [C99].
925
926 For example C<logb(20)> is 4, as a floating point number.
927
928 See also L</ilogb>.
929
930 =item C<link>
931
932 This is identical to Perl's builtin C<link()> function
933 for creating hard links into files, see L<perlfunc/link>.
934
935 =item C<localeconv>
936
937 Get numeric formatting information.  Returns a reference to a hash
938 containing the current underlying locale's formatting values.  Users of this function
939 should also read L<perllocale>, which provides a comprehensive
940 discussion of Perl locale handling, including
941 L<a section devoted to this function|perllocale/The localeconv function>.
942 It should not be used in a threaded application unless it's certain that
943 the underlying locale is C or POSIX.  This is because it otherwise
944 changes the locale, which globally affects all threads simultaneously.
945
946 Here is how to query the database for the B<de> (Deutsch or German) locale.
947
948         my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
949         print "Locale: \"$loc\"\n";
950         my $lconv = POSIX::localeconv();
951         foreach my $property (qw(
952                 decimal_point
953                 thousands_sep
954                 grouping
955                 int_curr_symbol
956                 currency_symbol
957                 mon_decimal_point
958                 mon_thousands_sep
959                 mon_grouping
960                 positive_sign
961                 negative_sign
962                 int_frac_digits
963                 frac_digits
964                 p_cs_precedes
965                 p_sep_by_space
966                 n_cs_precedes
967                 n_sep_by_space
968                 p_sign_posn
969                 n_sign_posn
970                 int_p_cs_precedes
971                 int_p_sep_by_space
972                 int_n_cs_precedes
973                 int_n_sep_by_space
974                 int_p_sign_posn
975                 int_n_sign_posn
976         ))
977         {
978                 printf qq(%s: "%s",\n),
979                         $property, $lconv->{$property};
980         }
981
982 The members whose names begin with C<int_p_> and C<int_n_> were added by
983 POSIX.1-2008 and are only available on systems that support them.
984
985 =item C<localtime>
986
987 This is identical to Perl's builtin C<localtime()> function for
988 converting seconds since the epoch to a date see L<perlfunc/localtime> except
989 that C<POSIX::localtime()> must be provided an explicit value (rather than
990 relying on an implicit C<$_>):
991
992     @localtime = POSIX::localtime(time);    # good
993
994     @localtime = localtime();               # good
995
996     @localtime = POSIX::localtime();        # throws exception
997
998 =item C<log>
999
1000 This is identical to Perl's builtin C<log()> function,
1001 returning the natural (I<e>-based) logarithm of the numerical argument,
1002 see L<perlfunc/log>.
1003
1004 =item C<log10>
1005
1006 This is identical to the C function C<log10()>,
1007 returning the 10-base logarithm of the numerical argument.
1008 You can also use
1009
1010     sub log10 { log($_[0]) / log(10) }
1011
1012 or
1013
1014     sub log10 { log($_[0]) / 2.30258509299405 }
1015
1016 or
1017
1018     sub log10 { log($_[0]) * 0.434294481903252 }
1019
1020 =item C<longjmp>
1021
1022 Not implemented.  C<longjmp()> is C-specific: use L<perlfunc/die> instead.
1023
1024 =item C<lseek>
1025
1026 Move the file's read/write position.  This uses file descriptors such as
1027 those obtained by calling C<POSIX::open>.
1028
1029         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1030         $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
1031
1032 Returns C<undef> on failure.
1033
1034 =item C<lrint>
1035
1036 Depending on the current floating point rounding mode, rounds the
1037 argument either toward nearest (like L</round>), toward zero (like
1038 L</trunc>), downward (toward negative infinity), or upward (toward
1039 positive infinity) [C99].
1040
1041 For the rounding mode, see L</fegetround>.
1042
1043 =item C<lround>
1044
1045 Like L</round>, but as integer, as opposed to floating point [C99].
1046
1047 See also L</ceil>, L</floor>, L</trunc>.
1048
1049 Owing to an oversight, this is not currently exported by default, or as part of
1050 the C<:math_h_c99> export tag; importing it must therefore be done by explicit
1051 name.
1052
1053 =item C<malloc>
1054
1055 Not implemented.  C<malloc()> is C-specific.  Perl does memory management transparently.
1056
1057 =item C<mblen>
1058
1059 This is identical to the C function C<mblen()>.
1060
1061 Core Perl does not have any support for the wide and multibyte
1062 characters of the C standards, except under UTF-8 locales, so this might
1063 be a rather useless function.
1064
1065 However, Perl supports Unicode, see L<perluniintro>.
1066
1067 =item C<mbstowcs>
1068
1069 This is identical to the C function C<mbstowcs()>.
1070
1071 See L</mblen>.
1072
1073 =item C<mbtowc>
1074
1075 This is identical to the C function C<mbtowc()>.
1076
1077 See L</mblen>.
1078
1079 =item C<memchr>
1080
1081 Not implemented.  C<memchr()> is C-specific, see L<perlfunc/index> instead.
1082
1083 =item C<memcmp>
1084
1085 Not implemented.  C<memcmp()> is C-specific, use C<eq> instead, see L<perlop>.
1086
1087 =item C<memcpy>
1088
1089 Not implemented.  C<memcpy()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1090
1091 =item C<memmove>
1092
1093 Not implemented.  C<memmove()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1094
1095 =item C<memset>
1096
1097 Not implemented.  C<memset()> is C-specific, use C<x> instead, see L<perlop>.
1098
1099 =item C<mkdir>
1100
1101 This is identical to Perl's builtin C<mkdir()> function
1102 for creating directories, see L<perlfunc/mkdir>.
1103
1104 =item C<mkfifo>
1105
1106 This is similar to the C function C<mkfifo()> for creating
1107 FIFO special files.
1108
1109         if (mkfifo($path, $mode)) { ....
1110
1111 Returns C<undef> on failure.  The C<$mode> is similar to the
1112 mode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
1113 you B<must> specify the C<$mode>.
1114
1115 =item C<mktime>
1116
1117 Convert date/time info to a calendar time.
1118
1119 Synopsis:
1120
1121         mktime(sec, min, hour, mday, mon, year, wday = 0,
1122                yday = 0, isdst = -1)
1123
1124 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1125 I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
1126 year (C<year>) is given in years since 1900; I<i.e.>, the year 1995 is 95; the
1127 year 2001 is 101.  Consult your system's C<mktime()> manpage for details
1128 about these and the other arguments.
1129
1130 Calendar time for December 12, 1995, at 10:30 am.
1131
1132         $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
1133         print "Date = ", POSIX::ctime($time_t);
1134
1135 Returns C<undef> on failure.
1136
1137 =item C<modf>
1138
1139 Return the integral and fractional parts of a floating-point number.
1140
1141         ($fractional, $integral) = POSIX::modf( 3.14 );
1142
1143 See also L</round>.
1144
1145 =item C<NaN>
1146
1147 The not-a-number as a constant:
1148
1149    use POSIX qw(NaN);
1150    my $nan = NaN;
1151
1152 See also L</nan>, C</isnan>, and L</fpclassify>.
1153
1154 =item C<nan>
1155
1156    my $nan = nan();
1157
1158 Returns C<NaN>, not-a-number [C99].
1159
1160 The returned NaN is always a I<quiet> NaN, as opposed to I<signaling>.
1161
1162 With an argument, can be used to generate a NaN with I<payload>.
1163 The argument is first interpreted as a floating point number,
1164 but then any fractional parts are truncated (towards zero),
1165 and the value is interpreted as an unsigned integer.
1166 The bits of this integer are stored in the unused bits of the NaN.
1167
1168 The result has a dual nature: it is a NaN, but it also carries
1169 the integer inside it.  The integer can be retrieved with L</getpayload>.
1170 Note, though, that the payload is not propagated, not even on copies,
1171 and definitely not in arithmetic operations.
1172
1173 How many bits fit in the NaN depends on what kind of floating points
1174 are being used, but on the most common platforms (64-bit IEEE 754,
1175 or the x86 80-bit long doubles) there are 51 and 61 bits available,
1176 respectively.  (There would be 52 and 62, but the quiet/signaling
1177 bit of NaNs takes away one.)  However, because of the floating-point-to-
1178 integer-and-back conversions, please test carefully whether you get back
1179 what you put in.  If your integers are only 32 bits wide, you probably
1180 should not rely on more than 32 bits of payload.
1181
1182 Whether a "signaling" NaN is in any way different from a "quiet" NaN,
1183 depends on the platform.  Also note that the payload of the default
1184 NaN (no argument to nan()) is not necessarily zero, use C<setpayload>
1185 to explicitly set the payload.  On some platforms like the 32-bit x86,
1186 (unless using the 80-bit long doubles) the signaling bit is not supported
1187 at all.
1188
1189 See also L</isnan>, L</NaN>, L</setpayload> and L</issignaling>.
1190
1191 =item C<nearbyint>
1192
1193 Returns the nearest integer to the argument, according to the current
1194 rounding mode (see L</fegetround>) [C99].
1195
1196 =item C<nextafter>
1197
1198 Returns the next representable floating point number after C<x> in the
1199 direction of C<y> [C99].
1200
1201  my $nextafter = POSIX::nextafter($x, $y);
1202
1203 Like L</nexttoward>, but potentially less accurate.
1204
1205 =item C<nexttoward>
1206
1207 Returns the next representable floating point number after C<x> in the
1208 direction of C<y> [C99].
1209
1210  my $nexttoward = POSIX::nexttoward($x, $y);
1211
1212 Like L</nextafter>, but potentially more accurate.
1213
1214 =item C<nice>
1215
1216 This is similar to the C function C<nice()>, for changing
1217 the scheduling preference of the current process.  Positive
1218 arguments mean a more polite process, negative values a more
1219 needy process.  Normal (non-root) user processes can only change towards
1220 being more polite.
1221
1222 Returns C<undef> on failure.
1223
1224 =item C<offsetof>
1225
1226 Not implemented.  C<offsetof()> is C-specific, you probably want to see L<perlfunc/pack> instead.
1227
1228 =item C<open>
1229
1230 Open a file for reading for writing.  This returns file descriptors, not
1231 Perl filehandles.  Use C<POSIX::close> to close the file.
1232
1233 Open a file read-only with mode 0666.
1234
1235         $fd = POSIX::open( "foo" );
1236
1237 Open a file for read and write.
1238
1239         $fd = POSIX::open( "foo", &POSIX::O_RDWR );
1240
1241 Open a file for write, with truncation.
1242
1243         $fd = POSIX::open(
1244                 "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC
1245         );
1246
1247 Create a new file with mode 0640.  Set up the file for writing.
1248
1249         $fd = POSIX::open(
1250                 "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640
1251         );
1252
1253 Returns C<undef> on failure.
1254
1255 See also L<perlfunc/sysopen>.
1256
1257 =item C<opendir>
1258
1259 Open a directory for reading.
1260
1261         $dir = POSIX::opendir( "/var" );
1262         @files = POSIX::readdir( $dir );
1263         POSIX::closedir( $dir );
1264
1265 Returns C<undef> on failure.
1266
1267 =item C<pathconf>
1268
1269 Retrieves the value of a configurable limit on a file or directory.
1270
1271 The following will determine the maximum length of the longest allowable
1272 pathname on the filesystem which holds C</var>.
1273
1274         $path_max = POSIX::pathconf( "/var",
1275                                       &POSIX::_PC_PATH_MAX );
1276
1277 Returns C<undef> on failure.
1278
1279 =item C<pause>
1280
1281 This is similar to the C function C<pause()>, which suspends
1282 the execution of the current process until a signal is received.
1283
1284 Returns C<undef> on failure.
1285
1286 =item C<perror>
1287
1288 This is identical to the C function C<perror()>, which outputs to the
1289 standard error stream the specified message followed by C<": "> and the
1290 current error string.  Use the C<warn()> function and the C<$!>
1291 variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
1292
1293 =item C<pipe>
1294
1295 Create an interprocess channel.  This returns file descriptors like those
1296 returned by C<POSIX::open>.
1297
1298         my ($read, $write) = POSIX::pipe();
1299         POSIX::write( $write, "hello", 5 );
1300         POSIX::read( $read, $buf, 5 );
1301
1302 See also L<perlfunc/pipe>.
1303
1304 =item C<pow>
1305
1306 Computes C<$x> raised to the power C<$exponent>.
1307
1308         $ret = POSIX::pow( $x, $exponent );
1309
1310 You can also use the C<**> operator, see L<perlop>.
1311
1312 =item C<printf>
1313
1314 Formats and prints the specified arguments to C<STDOUT>.
1315 See also L<perlfunc/printf>.
1316
1317 =item C<putc>
1318
1319 Not implemented.  C<putc()> is C-specific, see L<perlfunc/print> instead.
1320
1321 =item C<putchar>
1322
1323 Not implemented.  C<putchar()> is C-specific, see L<perlfunc/print> instead.
1324
1325 =item C<puts>
1326
1327 Not implemented.  C<puts()> is C-specific, see L<perlfunc/print> instead.
1328
1329 =item C<qsort>
1330
1331 Not implemented.  C<qsort()> is C-specific, see L<perlfunc/sort> instead.
1332
1333 =item C<raise>
1334
1335 Sends the specified signal to the current process.
1336 See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
1337
1338 =item C<rand>
1339
1340 Not implemented.  C<rand()> is non-portable, see L<perlfunc/rand> instead.
1341
1342 =item C<read>
1343
1344 Read from a file.  This uses file descriptors such as those obtained by
1345 calling C<POSIX::open>.  If the buffer C<$buf> is not large enough for the
1346 read then Perl will extend it to make room for the request.
1347
1348         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1349         $bytes = POSIX::read( $fd, $buf, 3 );
1350
1351 Returns C<undef> on failure.
1352
1353 See also L<perlfunc/sysread>.
1354
1355 =item C<readdir>
1356
1357 This is identical to Perl's builtin C<readdir()> function
1358 for reading directory entries, see L<perlfunc/readdir>.
1359
1360 =item C<realloc>
1361
1362 Not implemented.  C<realloc()> is C-specific.  Perl does memory management transparently.
1363
1364 =item C<remainder>
1365
1366 Given C<x> and C<y>, returns the value S<C<x - n*y>>, where C<n> is the integer
1367 closest to C<x>/C<y>. [C99]
1368
1369  my $remainder = POSIX::remainder($x, $y)
1370
1371 See also L</remquo>.
1372
1373 =item C<remove>
1374
1375 This is identical to Perl's builtin C<unlink()> function
1376 for removing files, see L<perlfunc/unlink>.
1377
1378 =item C<remquo>
1379
1380 Like L</remainder> but also returns the low-order bits of the quotient (n)
1381 [C99]
1382
1383 (This is quite esoteric interface, mainly used to implement numerical
1384 algorithms.)
1385
1386 =item C<rename>
1387
1388 This is identical to Perl's builtin C<rename()> function
1389 for renaming files, see L<perlfunc/rename>.
1390
1391 =item C<rewind>
1392
1393 Seeks to the beginning of the file.
1394
1395 =item C<rewinddir>
1396
1397 This is identical to Perl's builtin C<rewinddir()> function for
1398 rewinding directory entry streams, see L<perlfunc/rewinddir>.
1399
1400 =item C<rint>
1401
1402 Identical to L</lrint>.
1403
1404 =item C<rmdir>
1405
1406 This is identical to Perl's builtin C<rmdir()> function
1407 for removing (empty) directories, see L<perlfunc/rmdir>.
1408
1409 =item C<round>
1410
1411 Returns the integer (but still as floating point) nearest to the
1412 argument [C99].
1413
1414 See also L</ceil>, L</floor>, L</lround>, L</modf>, and L</trunc>.
1415
1416 =item C<scalbn>
1417
1418 Returns S<C<x * 2**y>> [C99].
1419
1420 See also L</frexp> and L</ldexp>.
1421
1422 =item C<scanf>
1423
1424 Not implemented.  C<scanf()> is C-specific, use E<lt>E<gt> and regular expressions instead,
1425 see L<perlre>.
1426
1427 =item C<setgid>
1428
1429 Sets the real group identifier and the effective group identifier for
1430 this process.  Similar to assigning a value to the Perl's builtin
1431 C<$)> variable, see L<perlvar/$EGID>, except that the latter
1432 will change only the real user identifier, and that the setgid()
1433 uses only a single numeric argument, as opposed to a space-separated
1434 list of numbers.
1435
1436 =item C<setjmp>
1437
1438 Not implemented.  C<setjmp()> is C-specific: use C<eval {}> instead,
1439 see L<perlfunc/eval>.
1440
1441 =item C<setlocale>
1442
1443 WARNING!  Do NOT use this function in a L<thread|threads>.  The locale
1444 will change in all other threads at the same time, and should your
1445 thread get paused by the operating system, and another started, that
1446 thread will not have the locale it is expecting.  On some platforms,
1447 there can be a race leading to segfaults if two threads call this
1448 function nearly simultaneously.
1449
1450 Modifies and queries the program's underlying locale.  Users of this
1451 function should read L<perllocale>, whch provides a comprehensive
1452 discussion of Perl locale handling, knowledge of which is necessary to
1453 properly use this function.  It contains
1454 L<a section devoted to this function|perllocale/The setlocale function>.
1455 The discussion here is merely a summary reference for C<setlocale()>.
1456 Note that Perl itself is almost entirely unaffected by the locale
1457 except within the scope of S<C<"use locale">>.  (Exceptions are listed
1458 in L<perllocale/Not within the scope of "use locale">.)
1459
1460 The following examples assume
1461
1462         use POSIX qw(setlocale LC_ALL LC_CTYPE);
1463
1464 has been issued.
1465
1466 The following will set the traditional UNIX system locale behavior
1467 (the second argument C<"C">).
1468
1469         $loc = setlocale( LC_ALL, "C" );
1470
1471 The following will query the current C<LC_CTYPE> category.  (No second
1472 argument means 'query'.)
1473
1474         $loc = setlocale( LC_CTYPE );
1475
1476 The following will set the C<LC_CTYPE> behaviour according to the locale
1477 environment variables (the second argument C<"">).
1478 Please see your system's C<setlocale(3)> documentation for the locale
1479 environment variables' meaning or consult L<perllocale>.
1480
1481         $loc = setlocale( LC_CTYPE, "" );
1482
1483 The following will set the C<LC_COLLATE> behaviour to Argentinian
1484 Spanish. B<NOTE>: The naming and availability of locales depends on
1485 your operating system. Please consult L<perllocale> for how to find
1486 out which locales are available in your system.
1487
1488         $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
1489
1490 =item C<setpayload>
1491
1492         use POSIX ':nan_payload';
1493         setpayload($var, $payload);
1494
1495 Sets the C<NaN> payload of var.
1496
1497 NOTE: the NaN payload APIs are based on the latest (as of June 2015)
1498 proposed ISO C interfaces, but they are not yet a standard.  Things
1499 may change.
1500
1501 See L</nan> for more discussion about C<NaN>.
1502
1503 See also L</setpayloadsig>, L</isnan>, L</getpayload>, and L</issignaling>.
1504
1505 =item C<setpayloadsig>
1506
1507         use POSIX ':nan_payload';
1508         setpayloadsig($var, $payload);
1509
1510 Like L</setpayload> but also makes the NaN I<signaling>.
1511
1512 Depending on the platform the NaN may or may not behave differently.
1513
1514 Note the API instability warning in L</setpayload>.
1515
1516 Note that because how the floating point formats work out, on the most
1517 common platforms signaling payload of zero is best avoided,
1518 since it might end up being identical to C<+Inf>.
1519
1520 See also L</nan>, L</isnan>, L</getpayload>, and L</issignaling>.
1521
1522 =item C<setpgid>
1523
1524 This is similar to the C function C<setpgid()> for
1525 setting the process group identifier of the current process.
1526
1527 Returns C<undef> on failure.
1528
1529 =item C<setsid>
1530
1531 This is identical to the C function C<setsid()> for
1532 setting the session identifier of the current process.
1533
1534 =item C<setuid>
1535
1536 Sets the real user identifier and the effective user identifier for
1537 this process.  Similar to assigning a value to the Perl's builtin
1538 C<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
1539 will change only the real user identifier.
1540
1541 =item C<sigaction>
1542
1543 Detailed signal management.  This uses C<POSIX::SigAction> objects for
1544 the C<action> and C<oldaction> arguments (the oldaction can also be
1545 just a hash reference).  Consult your system's C<sigaction> manpage
1546 for details, see also C<POSIX::SigRt>.
1547
1548 Synopsis:
1549
1550         sigaction(signal, action, oldaction = 0)
1551
1552 Returns C<undef> on failure.  The C<signal> must be a number (like
1553 C<SIGHUP>), not a string (like C<"SIGHUP">), though Perl does try hard
1554 to understand you.
1555
1556 If you use the C<SA_SIGINFO> flag, the signal handler will in addition to
1557 the first argument, the signal name, also receive a second argument, a
1558 hash reference, inside which are the following keys with the following
1559 semantics, as defined by POSIX/SUSv3:
1560
1561     signo       the signal number
1562     errno       the error number
1563     code        if this is zero or less, the signal was sent by
1564                 a user process and the uid and pid make sense,
1565                 otherwise the signal was sent by the kernel
1566
1567 The constants for specific C<code> values can be imported individually
1568 or using the C<:signal_h_si_code> tag.
1569
1570 The following are also defined by POSIX/SUSv3, but unfortunately
1571 not very widely implemented:
1572
1573     pid         the process id generating the signal
1574     uid         the uid of the process id generating the signal
1575     status      exit value or signal for SIGCHLD
1576     band        band event for SIGPOLL
1577     addr        address of faulting instruction or memory
1578                 reference for SIGILL, SIGFPE, SIGSEGV or SIGBUS
1579
1580 A third argument is also passed to the handler, which contains a copy
1581 of the raw binary contents of the C<siginfo> structure: if a system has
1582 some non-POSIX fields, this third argument is where to C<unpack()> them
1583 from.
1584
1585 Note that not all C<siginfo> values make sense simultaneously (some are
1586 valid only for certain signals, for example), and not all values make
1587 sense from Perl perspective, you should to consult your system's
1588 C<sigaction> and possibly also C<siginfo> documentation.
1589
1590 =item C<siglongjmp>
1591
1592 Not implemented.  C<siglongjmp()> is C-specific: use L<perlfunc/die> instead.
1593
1594 =item C<signbit>
1595
1596 Returns zero for positive arguments, non-zero for negative arguments [C99].
1597
1598 =item C<sigpending>
1599
1600 Examine signals that are blocked and pending.  This uses C<POSIX::SigSet>
1601 objects for the C<sigset> argument.  Consult your system's C<sigpending>
1602 manpage for details.
1603
1604 Synopsis:
1605
1606         sigpending(sigset)
1607
1608 Returns C<undef> on failure.
1609
1610 =item C<sigprocmask>
1611
1612 Change and/or examine calling process's signal mask.  This uses
1613 C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
1614 Consult your system's C<sigprocmask> manpage for details.
1615
1616 Synopsis:
1617
1618         sigprocmask(how, sigset, oldsigset = 0)
1619
1620 Returns C<undef> on failure.
1621
1622 Note that you can't reliably block or unblock a signal from its own signal
1623 handler if you're using safe signals. Other signals can be blocked or unblocked
1624 reliably.
1625
1626 =item C<sigsetjmp>
1627
1628 Not implemented.  C<sigsetjmp()> is C-specific: use C<eval {}> instead,
1629 see L<perlfunc/eval>.
1630
1631 =item C<sigsuspend>
1632
1633 Install a signal mask and suspend process until signal arrives.  This uses
1634 C<POSIX::SigSet> objects for the C<signal_mask> argument.  Consult your
1635 system's C<sigsuspend> manpage for details.
1636
1637 Synopsis:
1638
1639         sigsuspend(signal_mask)
1640
1641 Returns C<undef> on failure.
1642
1643 =item C<sin>
1644
1645 This is identical to Perl's builtin C<sin()> function
1646 for returning the sine of the numerical argument,
1647 see L<perlfunc/sin>.  See also L<Math::Trig>.
1648
1649 =item C<sinh>
1650
1651 This is identical to the C function C<sinh()>
1652 for returning the hyperbolic sine of the numerical argument.
1653 See also L<Math::Trig>.
1654
1655 =item C<sleep>
1656
1657 This is functionally identical to Perl's builtin C<sleep()> function
1658 for suspending the execution of the current for process for certain
1659 number of seconds, see L<perlfunc/sleep>.  There is one significant
1660 difference, however: C<POSIX::sleep()> returns the number of
1661 B<unslept> seconds, while the C<CORE::sleep()> returns the
1662 number of slept seconds.
1663
1664 =item C<sprintf>
1665
1666 This is similar to Perl's builtin C<sprintf()> function
1667 for returning a string that has the arguments formatted as requested,
1668 see L<perlfunc/sprintf>.
1669
1670 =item C<sqrt>
1671
1672 This is identical to Perl's builtin C<sqrt()> function.
1673 for returning the square root of the numerical argument,
1674 see L<perlfunc/sqrt>.
1675
1676 =item C<srand>
1677
1678 Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
1679
1680 =item C<sscanf>
1681
1682 Not implemented.  C<sscanf()> is C-specific, use regular expressions instead,
1683 see L<perlre>.
1684
1685 =item C<stat>
1686
1687 This is identical to Perl's builtin C<stat()> function
1688 for returning information about files and directories.
1689
1690 =item C<strcat>
1691
1692 Not implemented.  C<strcat()> is C-specific, use C<.=> instead, see L<perlop>.
1693
1694 =item C<strchr>
1695
1696 Not implemented.  C<strchr()> is C-specific, see L<perlfunc/index> instead.
1697
1698 =item C<strcmp>
1699
1700 Not implemented.  C<strcmp()> is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
1701
1702 =item C<strcoll>
1703
1704 This is identical to the C function C<strcoll()>
1705 for collating (comparing) strings transformed using
1706 the C<strxfrm()> function.  Not really needed since
1707 Perl can do this transparently, see L<perllocale>.
1708
1709 Beware that in a UTF-8 locale, anything you pass to this function must
1710 be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
1711 UTF-8 encoded.
1712
1713 =item C<strcpy>
1714
1715 Not implemented.  C<strcpy()> is C-specific, use C<=> instead, see L<perlop>.
1716
1717 =item C<strcspn>
1718
1719 Not implemented.  C<strcspn()> is C-specific, use regular expressions instead,
1720 see L<perlre>.
1721
1722 =item C<strerror>
1723
1724 Returns the error string for the specified errno.
1725 Identical to the string form of C<$!>, see L<perlvar/$ERRNO>.
1726
1727 =item C<strftime>
1728
1729 Convert date and time information to string.  Returns the string.
1730
1731 Synopsis:
1732
1733         strftime(fmt, sec, min, hour, mday, mon, year,
1734                  wday = -1, yday = -1, isdst = -1)
1735
1736 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1737 I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
1738 year (C<year>) is given in years since 1900, I<i.e.>, the year 1995 is 95; the
1739 year 2001 is 101.  Consult your system's C<strftime()> manpage for details
1740 about these and the other arguments.
1741
1742 If you want your code to be portable, your format (C<fmt>) argument
1743 should use only the conversion specifiers defined by the ANSI C
1744 standard (C89, to play safe).  These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
1745 But even then, the B<results> of some of the conversion specifiers are
1746 non-portable.  For example, the specifiers C<aAbBcpZ> change according
1747 to the locale settings of the user, and both how to set locales (the
1748 locale names) and what output to expect are non-standard.
1749 The specifier C<c> changes according to the timezone settings of the
1750 user and the timezone computation rules of the operating system.
1751 The C<Z> specifier is notoriously unportable since the names of
1752 timezones are non-standard. Sticking to the numeric specifiers is the
1753 safest route.
1754
1755 The given arguments are made consistent as though by calling
1756 C<mktime()> before calling your system's C<strftime()> function,
1757 except that the C<isdst> value is not affected.
1758
1759 The string for Tuesday, December 12, 1995.
1760
1761         $str = POSIX::strftime( "%A, %B %d, %Y",
1762                                  0, 0, 0, 12, 11, 95, 2 );
1763         print "$str\n";
1764
1765 =item C<strlen>
1766
1767 Not implemented.  C<strlen()> is C-specific, use C<length()> instead, see L<perlfunc/length>.
1768
1769 =item C<strncat>
1770
1771 Not implemented.  C<strncat()> is C-specific, use C<.=> instead, see L<perlop>.
1772
1773 =item C<strncmp>
1774
1775 Not implemented.  C<strncmp()> is C-specific, use C<eq> instead, see L<perlop>.
1776
1777 =item C<strncpy>
1778
1779 Not implemented.  C<strncpy()> is C-specific, use C<=> instead, see L<perlop>.
1780
1781 =item C<strpbrk>
1782
1783 Not implemented.  C<strpbrk()> is C-specific, use regular expressions instead,
1784 see L<perlre>.
1785
1786 =item C<strrchr>
1787
1788 Not implemented.  C<strrchr()> is C-specific, see L<perlfunc/rindex> instead.
1789
1790 =item C<strspn>
1791
1792 Not implemented.  C<strspn()> is C-specific, use regular expressions instead,
1793 see L<perlre>.
1794
1795 =item C<strstr>
1796
1797 This is identical to Perl's builtin C<index()> function,
1798 see L<perlfunc/index>.
1799
1800 =item C<strtod>
1801
1802 String to double translation. Returns the parsed number and the number
1803 of characters in the unparsed portion of the string.  Truly
1804 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1805 error, so clear C<$!> before calling C<strtod>.  However, non-POSIX systems
1806 may not check for overflow, and therefore will never set C<$!>.
1807
1808 C<strtod> respects any POSIX C<setlocale()> C<LC_TIME> settings,
1809 regardless of whether or not it is called from Perl code that is within
1810 the scope of S<C<use locale>>.  This means it should not be used in a
1811 threaded application unless it's certain that the underlying locale is C
1812 or POSIX.  This is because it otherwise changes the locale, which
1813 globally affects all threads simultaneously.
1814
1815 To parse a string C<$str> as a floating point number use
1816
1817     $! = 0;
1818     ($num, $n_unparsed) = POSIX::strtod($str);
1819
1820 The second returned item and C<$!> can be used to check for valid input:
1821
1822     if (($str eq '') || ($n_unparsed != 0) || $!) {
1823         die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
1824     }
1825
1826 When called in a scalar context C<strtod> returns the parsed number.
1827
1828 =item C<strtok>
1829
1830 Not implemented.  C<strtok()> is C-specific, use regular expressions instead, see
1831 L<perlre>, or L<perlfunc/split>.
1832
1833 =item C<strtol>
1834
1835 String to (long) integer translation.  Returns the parsed number and
1836 the number of characters in the unparsed portion of the string.  Truly
1837 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1838 error, so clear C<$!> before calling C<strtol>.  However, non-POSIX systems
1839 may not check for overflow, and therefore will never set C<$!>.
1840
1841 C<strtol> should respect any POSIX I<setlocale()> settings.
1842
1843 To parse a string C<$str> as a number in some base C<$base> use
1844
1845     $! = 0;
1846     ($num, $n_unparsed) = POSIX::strtol($str, $base);
1847
1848 The base should be zero or between 2 and 36, inclusive.  When the base
1849 is zero or omitted C<strtol> will use the string itself to determine the
1850 base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
1851 octal; any other leading characters mean decimal.  Thus, "1234" is
1852 parsed as a decimal number, "01234" as an octal number, and "0x1234"
1853 as a hexadecimal number.
1854
1855 The second returned item and C<$!> can be used to check for valid input:
1856
1857     if (($str eq '') || ($n_unparsed != 0) || !$!) {
1858         die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1859     }
1860
1861 When called in a scalar context C<strtol> returns the parsed number.
1862
1863 =item C<strtold>
1864
1865 Like L</strtod> but for long doubles.  Defined only if the
1866 system supports long doubles.
1867
1868 =item C<strtoul>
1869
1870 String to unsigned (long) integer translation.  C<strtoul()> is identical
1871 to C<strtol()> except that C<strtoul()> only parses unsigned integers.  See
1872 L</strtol> for details.
1873
1874 Note: Some vendors supply C<strtod()> and C<strtol()> but not C<strtoul()>.
1875 Other vendors that do supply C<strtoul()> parse "-1" as a valid value.
1876
1877 =item C<strxfrm>
1878
1879 String transformation.  Returns the transformed string.
1880
1881         $dst = POSIX::strxfrm( $src );
1882
1883 Used in conjunction with the C<strcoll()> function, see L</strcoll>.
1884
1885 Not really needed since Perl can do this transparently, see
1886 L<perllocale>.
1887
1888 Beware that in a UTF-8 locale, anything you pass to this function must
1889 be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
1890 UTF-8 encoded.
1891
1892 =item C<sysconf>
1893
1894 Retrieves values of system configurable variables.
1895
1896 The following will get the machine's clock speed.
1897
1898         $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1899
1900 Returns C<undef> on failure.
1901
1902 =item C<system>
1903
1904 This is identical to Perl's builtin C<system()> function, see
1905 L<perlfunc/system>.
1906
1907 =item C<tan>
1908
1909 This is identical to the C function C<tan()>, returning the
1910 tangent of the numerical argument.  See also L<Math::Trig>.
1911
1912 =item C<tanh>
1913
1914 This is identical to the C function C<tanh()>, returning the
1915 hyperbolic tangent of the numerical argument.   See also L<Math::Trig>.
1916
1917 =item C<tcdrain>
1918
1919 This is similar to the C function C<tcdrain()> for draining
1920 the output queue of its argument stream.
1921
1922 Returns C<undef> on failure.
1923
1924 =item C<tcflow>
1925
1926 This is similar to the C function C<tcflow()> for controlling
1927 the flow of its argument stream.
1928
1929 Returns C<undef> on failure.
1930
1931 =item C<tcflush>
1932
1933 This is similar to the C function C<tcflush()> for flushing
1934 the I/O buffers of its argument stream.
1935
1936 Returns C<undef> on failure.
1937
1938 =item C<tcgetpgrp>
1939
1940 This is identical to the C function C<tcgetpgrp()> for returning the
1941 process group identifier of the foreground process group of the controlling
1942 terminal.
1943
1944 =item C<tcsendbreak>
1945
1946 This is similar to the C function C<tcsendbreak()> for sending
1947 a break on its argument stream.
1948
1949 Returns C<undef> on failure.
1950
1951 =item C<tcsetpgrp>
1952
1953 This is similar to the C function C<tcsetpgrp()> for setting the
1954 process group identifier of the foreground process group of the controlling
1955 terminal.
1956
1957 Returns C<undef> on failure.
1958
1959 =item C<tgamma>
1960
1961 The Gamma function [C99].
1962
1963 See also L</lgamma>.
1964
1965 =item C<time>
1966
1967 This is identical to Perl's builtin C<time()> function
1968 for returning the number of seconds since the epoch
1969 (whatever it is for the system), see L<perlfunc/time>.
1970
1971 =item C<times>
1972
1973 The C<times()> function returns elapsed realtime since some point in the past
1974 (such as system startup), user and system times for this process, and user
1975 and system times used by child processes.  All times are returned in clock
1976 ticks.
1977
1978     ($realtime, $user, $system, $cuser, $csystem)
1979         = POSIX::times();
1980
1981 Note: Perl's builtin C<times()> function returns four values, measured in
1982 seconds.
1983
1984 =item C<tmpfile>
1985
1986 Not implemented.  Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
1987
1988 =item C<tmpnam>
1989
1990 For security reasons, which are probably detailed in your system's
1991 documentation for the C library C<tmpnam()> function, this interface
1992 is no longer available; instead use L<File::Temp>.
1993
1994 =item C<tolower>
1995
1996 This is identical to the C function, except that it can apply to a single
1997 character or to a whole string, and currently operates as if the locale
1998 always is "C".  Consider using the C<lc()> function, see L<perlfunc/lc>,
1999 see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
2000 strings.
2001
2002 =item C<toupper>
2003
2004 This is similar to the C function, except that it can apply to a single
2005 character or to a whole string, and currently operates as if the locale
2006 always is "C".  Consider using the C<uc()> function, see L<perlfunc/uc>,
2007 or the equivalent C<\U> operator inside doublequotish strings.
2008
2009 =item C<trunc>
2010
2011 Returns the integer toward zero from the argument [C99].
2012
2013 See also L</ceil>, L</floor>, and L</round>.
2014
2015 =item C<ttyname>
2016
2017 This is identical to the C function C<ttyname()> for returning the
2018 name of the current terminal.
2019
2020 =item C<tzname>
2021
2022 Retrieves the time conversion information from the C<tzname> variable.
2023
2024         POSIX::tzset();
2025         ($std, $dst) = POSIX::tzname();
2026
2027 =item C<tzset>
2028
2029 This is identical to the C function C<tzset()> for setting
2030 the current timezone based on the environment variable C<TZ>,
2031 to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
2032 functions.
2033
2034 =item C<umask>
2035
2036 This is identical to Perl's builtin C<umask()> function
2037 for setting (and querying) the file creation permission mask,
2038 see L<perlfunc/umask>.
2039
2040 =item C<uname>
2041
2042 Get name of current operating system.
2043
2044         ($sysname, $nodename, $release, $version, $machine)
2045                 = POSIX::uname();
2046
2047 Note that the actual meanings of the various fields are not
2048 that well standardized, do not expect any great portability.
2049 The C<$sysname> might be the name of the operating system,
2050 the C<$nodename> might be the name of the host, the C<$release>
2051 might be the (major) release number of the operating system,
2052 the C<$version> might be the (minor) release number of the
2053 operating system, and the C<$machine> might be a hardware identifier.
2054 Maybe.
2055
2056 =item C<ungetc>
2057
2058 Not implemented.  Use method C<IO::Handle::ungetc()> instead.
2059
2060 =item C<unlink>
2061
2062 This is identical to Perl's builtin C<unlink()> function
2063 for removing files, see L<perlfunc/unlink>.
2064
2065 =item C<utime>
2066
2067 This is identical to Perl's builtin C<utime()> function
2068 for changing the time stamps of files and directories,
2069 see L<perlfunc/utime>.
2070
2071 =item C<vfprintf>
2072
2073 Not implemented.  C<vfprintf()> is C-specific, see L<perlfunc/printf> instead.
2074
2075 =item C<vprintf>
2076
2077 Not implemented.  C<vprintf()> is C-specific, see L<perlfunc/printf> instead.
2078
2079 =item C<vsprintf>
2080
2081 Not implemented.  C<vsprintf()> is C-specific, see L<perlfunc/sprintf> instead.
2082
2083 =item C<wait>
2084
2085 This is identical to Perl's builtin C<wait()> function,
2086 see L<perlfunc/wait>.
2087
2088 =item C<waitpid>
2089
2090 Wait for a child process to change state.  This is identical to Perl's
2091 builtin C<waitpid()> function, see L<perlfunc/waitpid>.
2092
2093         $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
2094         print "status = ", ($? / 256), "\n";
2095
2096 =item C<wcstombs>
2097
2098 This is identical to the C function C<wcstombs()>.
2099
2100 See L</mblen>.
2101
2102 =item C<wctomb>
2103
2104 This is identical to the C function C<wctomb()>.
2105
2106 See L</mblen>.
2107
2108 =item C<write>
2109
2110 Write to a file.  This uses file descriptors such as those obtained by
2111 calling C<POSIX::open>.
2112
2113         $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
2114         $buf = "hello";
2115         $bytes = POSIX::write( $fd, $buf, 5 );
2116
2117 Returns C<undef> on failure.
2118
2119 See also L<perlfunc/syswrite>.
2120
2121 =back
2122
2123 =head1 CLASSES
2124
2125 =head2 C<POSIX::SigAction>
2126
2127 =over 8
2128
2129 =item C<new>
2130
2131 Creates a new C<POSIX::SigAction> object which corresponds to the C
2132 C<struct sigaction>.  This object will be destroyed automatically when
2133 it is no longer needed.  The first parameter is the handler, a sub
2134 reference.  The second parameter is a C<POSIX::SigSet> object, it
2135 defaults to the empty set.  The third parameter contains the
2136 C<sa_flags>, it defaults to 0.
2137
2138         $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
2139         $sigaction = POSIX::SigAction->new(
2140                         \&handler, $sigset, &POSIX::SA_NOCLDSTOP
2141                      );
2142
2143 This C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
2144 function.
2145
2146 =back
2147
2148 =over 8
2149
2150 =item C<handler>
2151
2152 =item C<mask>
2153
2154 =item C<flags>
2155
2156 accessor functions to get/set the values of a SigAction object.
2157
2158         $sigset = $sigaction->mask;
2159         $sigaction->flags(&POSIX::SA_RESTART);
2160
2161 =item C<safe>
2162
2163 accessor function for the "safe signals" flag of a SigAction object; see
2164 L<perlipc> for general information on safe (a.k.a. "deferred") signals.  If
2165 you wish to handle a signal safely, use this accessor to set the "safe" flag
2166 in the C<POSIX::SigAction> object:
2167
2168         $sigaction->safe(1);
2169
2170 You may also examine the "safe" flag on the output action object which is
2171 filled in when given as the third parameter to C<POSIX::sigaction()>:
2172
2173         sigaction(SIGINT, $new_action, $old_action);
2174         if ($old_action->safe) {
2175             # previous SIGINT handler used safe signals
2176         }
2177
2178 =back
2179
2180 =head2 C<POSIX::SigRt>
2181
2182 =over 8
2183
2184 =item C<%SIGRT>
2185
2186 A hash of the POSIX realtime signal handlers.  It is an extension of
2187 the standard C<%SIG>, the C<$POSIX::SIGRT{SIGRTMIN}> is roughly equivalent
2188 to C<$SIG{SIGRTMIN}>, but the right POSIX moves (see below) are made with
2189 the C<POSIX::SigSet> and C<POSIX::sigaction> instead of accessing the C<%SIG>.
2190
2191 You can set the C<%POSIX::SIGRT> elements to set the POSIX realtime
2192 signal handlers, use C<delete> and C<exists> on the elements, and use
2193 C<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
2194 signals there are available S<C<(SIGRTMAX - SIGRTMIN + 1>>, the C<SIGRTMAX> is
2195 a valid POSIX realtime signal).
2196
2197 Setting the C<%SIGRT> elements is equivalent to calling this:
2198
2199   sub new {
2200     my ($rtsig, $handler, $flags) = @_;
2201     my $sigset = POSIX::SigSet($rtsig);
2202     my $sigact = POSIX::SigAction->new($handler,$sigset,$flags);
2203     sigaction($rtsig, $sigact);
2204   }
2205
2206 The flags default to zero, if you want something different you can
2207 either use C<local> on C<$POSIX::SigRt::SIGACTION_FLAGS>, or you can
2208 derive from POSIX::SigRt and define your own C<new()> (the tied hash
2209 STORE method of the C<%SIGRT> calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
2210 where the C<$rtsig> ranges from zero to S<C<SIGRTMAX - SIGRTMIN + 1)>>.
2211
2212 Just as with any signal, you can use C<sigaction($rtsig, undef, $oa)> to
2213 retrieve the installed signal handler (or, rather, the signal action).
2214
2215 B<NOTE:> whether POSIX realtime signals really work in your system, or
2216 whether Perl has been compiled so that it works with them, is outside
2217 of this discussion.
2218
2219 =item C<SIGRTMIN>
2220
2221 Return the minimum POSIX realtime signal number available, or C<undef>
2222 if no POSIX realtime signals are available.
2223
2224 =item C<SIGRTMAX>
2225
2226 Return the maximum POSIX realtime signal number available, or C<undef>
2227 if no POSIX realtime signals are available.
2228
2229 =back
2230
2231 =head2 C<POSIX::SigSet>
2232
2233 =over 8
2234
2235 =item C<new>
2236
2237 Create a new SigSet object.  This object will be destroyed automatically
2238 when it is no longer needed.  Arguments may be supplied to initialize the
2239 set.
2240
2241 Create an empty set.
2242
2243         $sigset = POSIX::SigSet->new;
2244
2245 Create a set with C<SIGUSR1>.
2246
2247         $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
2248
2249 =item C<addset>
2250
2251 Add a signal to a SigSet object.
2252
2253         $sigset->addset( &POSIX::SIGUSR2 );
2254
2255 Returns C<undef> on failure.
2256
2257 =item C<delset>
2258
2259 Remove a signal from the SigSet object.
2260
2261         $sigset->delset( &POSIX::SIGUSR2 );
2262
2263 Returns C<undef> on failure.
2264
2265 =item C<emptyset>
2266
2267 Initialize the SigSet object to be empty.
2268
2269         $sigset->emptyset();
2270
2271 Returns C<undef> on failure.
2272
2273 =item C<fillset>
2274
2275 Initialize the SigSet object to include all signals.
2276
2277         $sigset->fillset();
2278
2279 Returns C<undef> on failure.
2280
2281 =item C<ismember>
2282
2283 Tests the SigSet object to see if it contains a specific signal.
2284
2285         if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
2286                 print "contains SIGUSR1\n";
2287         }
2288
2289 =back
2290
2291 =head2 C<POSIX::Termios>
2292
2293 =over 8
2294
2295 =item C<new>
2296
2297 Create a new Termios object.  This object will be destroyed automatically
2298 when it is no longer needed.  A Termios object corresponds to the C<termios>
2299 C struct.  C<new()> mallocs a new one, C<getattr()> fills it from a file descriptor,
2300 and C<setattr()> sets a file descriptor's parameters to match Termios' contents.
2301
2302         $termios = POSIX::Termios->new;
2303
2304 =item C<getattr>
2305
2306 Get terminal control attributes.
2307
2308 Obtain the attributes for C<stdin>.
2309
2310         $termios->getattr( 0 ) # Recommended for clarity.
2311         $termios->getattr()
2312
2313 Obtain the attributes for stdout.
2314
2315         $termios->getattr( 1 )
2316
2317 Returns C<undef> on failure.
2318
2319 =item C<getcc>
2320
2321 Retrieve a value from the C<c_cc> field of a C<termios> object.  The C<c_cc> field is
2322 an array so an index must be specified.
2323
2324         $c_cc[1] = $termios->getcc(1);
2325
2326 =item C<getcflag>
2327
2328 Retrieve the C<c_cflag> field of a C<termios> object.
2329
2330         $c_cflag = $termios->getcflag;
2331
2332 =item C<getiflag>
2333
2334 Retrieve the C<c_iflag> field of a C<termios> object.
2335
2336         $c_iflag = $termios->getiflag;
2337
2338 =item C<getispeed>
2339
2340 Retrieve the input baud rate.
2341
2342         $ispeed = $termios->getispeed;
2343
2344 =item C<getlflag>
2345
2346 Retrieve the C<c_lflag> field of a C<termios> object.
2347
2348         $c_lflag = $termios->getlflag;
2349
2350 =item C<getoflag>
2351
2352 Retrieve the C<c_oflag> field of a C<termios> object.
2353
2354         $c_oflag = $termios->getoflag;
2355
2356 =item C<getospeed>
2357
2358 Retrieve the output baud rate.
2359
2360         $ospeed = $termios->getospeed;
2361
2362 =item C<setattr>
2363
2364 Set terminal control attributes.
2365
2366 Set attributes immediately for stdout.
2367
2368         $termios->setattr( 1, &POSIX::TCSANOW );
2369
2370 Returns C<undef> on failure.
2371
2372 =item C<setcc>
2373
2374 Set a value in the C<c_cc> field of a C<termios> object.  The C<c_cc> field is an
2375 array so an index must be specified.
2376
2377         $termios->setcc( &POSIX::VEOF, 1 );
2378
2379 =item C<setcflag>
2380
2381 Set the C<c_cflag> field of a C<termios> object.
2382
2383         $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
2384
2385 =item C<setiflag>
2386
2387 Set the C<c_iflag> field of a C<termios> object.
2388
2389         $termios->setiflag( $c_iflag | &POSIX::BRKINT );
2390
2391 =item C<setispeed>
2392
2393 Set the input baud rate.
2394
2395         $termios->setispeed( &POSIX::B9600 );
2396
2397 Returns C<undef> on failure.
2398
2399 =item C<setlflag>
2400
2401 Set the C<c_lflag> field of a C<termios> object.
2402
2403         $termios->setlflag( $c_lflag | &POSIX::ECHO );
2404
2405 =item C<setoflag>
2406
2407 Set the C<c_oflag> field of a C<termios> object.
2408
2409         $termios->setoflag( $c_oflag | &POSIX::OPOST );
2410
2411 =item C<setospeed>
2412
2413 Set the output baud rate.
2414
2415         $termios->setospeed( &POSIX::B9600 );
2416
2417 Returns C<undef> on failure.
2418
2419 =item Baud rate values
2420
2421 C<B38400> C<B75> C<B200> C<B134> C<B300> C<B1800> C<B150> C<B0> C<B19200> C<B1200> C<B9600> C<B600> C<B4800> C<B50> C<B2400> C<B110>
2422
2423 =item Terminal interface values
2424
2425 C<TCSADRAIN> C<TCSANOW> C<TCOON> C<TCIOFLUSH> C<TCOFLUSH> C<TCION> C<TCIFLUSH> C<TCSAFLUSH> C<TCIOFF> C<TCOOFF>
2426
2427 =item C<c_cc> field values
2428
2429 C<VEOF> C<VEOL> C<VERASE> C<VINTR> C<VKILL> C<VQUIT> C<VSUSP> C<VSTART> C<VSTOP> C<VMIN> C<VTIME> C<NCCS>
2430
2431 =item C<c_cflag> field values
2432
2433 C<CLOCAL> C<CREAD> C<CSIZE> C<CS5> C<CS6> C<CS7> C<CS8> C<CSTOPB> C<HUPCL> C<PARENB> C<PARODD>
2434
2435 =item C<c_iflag> field values
2436
2437 C<BRKINT> C<ICRNL> C<IGNBRK> C<IGNCR> C<IGNPAR> C<INLCR> C<INPCK> C<ISTRIP> C<IXOFF> C<IXON> C<PARMRK>
2438
2439 =item C<c_lflag> field values
2440
2441 C<ECHO> C<ECHOE> C<ECHOK> C<ECHONL> C<ICANON> C<IEXTEN> C<ISIG> C<NOFLSH> C<TOSTOP>
2442
2443 =item C<c_oflag> field values
2444
2445 C<OPOST>
2446
2447 =back
2448
2449 =head1 PATHNAME CONSTANTS
2450
2451 =over 8
2452
2453 =item Constants
2454
2455 C<_PC_CHOWN_RESTRICTED> C<_PC_LINK_MAX> C<_PC_MAX_CANON> C<_PC_MAX_INPUT> C<_PC_NAME_MAX>
2456 C<_PC_NO_TRUNC> C<_PC_PATH_MAX> C<_PC_PIPE_BUF> C<_PC_VDISABLE>
2457
2458 =back
2459
2460 =head1 POSIX CONSTANTS
2461
2462 =over 8
2463
2464 =item Constants
2465
2466 C<_POSIX_ARG_MAX> C<_POSIX_CHILD_MAX> C<_POSIX_CHOWN_RESTRICTED> C<_POSIX_JOB_CONTROL>
2467 C<_POSIX_LINK_MAX> C<_POSIX_MAX_CANON> C<_POSIX_MAX_INPUT> C<_POSIX_NAME_MAX>
2468 C<_POSIX_NGROUPS_MAX> C<_POSIX_NO_TRUNC> C<_POSIX_OPEN_MAX> C<_POSIX_PATH_MAX>
2469 C<_POSIX_PIPE_BUF> C<_POSIX_SAVED_IDS> C<_POSIX_SSIZE_MAX> C<_POSIX_STREAM_MAX>
2470 C<_POSIX_TZNAME_MAX> C<_POSIX_VDISABLE> C<_POSIX_VERSION>
2471
2472 =back
2473
2474 =head1 RESOURCE CONSTANTS
2475
2476 Imported with the C<:sys_resource_h> tag.
2477
2478 =over 8
2479
2480 =item Constants
2481
2482 C<PRIO_PROCESS> C<PRIO_PGRP> C<PRIO_USER>
2483
2484 =back
2485
2486 =head1 SYSTEM CONFIGURATION
2487
2488 =over 8
2489
2490 =item Constants
2491
2492 C<_SC_ARG_MAX> C<_SC_CHILD_MAX> C<_SC_CLK_TCK> C<_SC_JOB_CONTROL> C<_SC_NGROUPS_MAX>
2493 C<_SC_OPEN_MAX> C<_SC_PAGESIZE> C<_SC_SAVED_IDS> C<_SC_STREAM_MAX> C<_SC_TZNAME_MAX>
2494 C<_SC_VERSION>
2495
2496 =back
2497
2498 =head1 ERRNO
2499
2500 =over 8
2501
2502 =item Constants
2503
2504 C<E2BIG> C<EACCES> C<EADDRINUSE> C<EADDRNOTAVAIL> C<EAFNOSUPPORT> C<EAGAIN> C<EALREADY> C<EBADF> C<EBADMSG>
2505 C<EBUSY> C<ECANCELED> C<ECHILD> C<ECONNABORTED> C<ECONNREFUSED> C<ECONNRESET> C<EDEADLK> C<EDESTADDRREQ>
2506 C<EDOM> C<EDQUOT> C<EEXIST> C<EFAULT> C<EFBIG> C<EHOSTDOWN> C<EHOSTUNREACH> C<EIDRM> C<EILSEQ> C<EINPROGRESS>
2507 C<EINTR> C<EINVAL> C<EIO> C<EISCONN> C<EISDIR> C<ELOOP> C<EMFILE> C<EMLINK> C<EMSGSIZE> C<ENAMETOOLONG>
2508 C<ENETDOWN> C<ENETRESET> C<ENETUNREACH> C<ENFILE> C<ENOBUFS> C<ENODATA> C<ENODEV> C<ENOENT> C<ENOEXEC>
2509 C<ENOLCK> C<ENOLINK> C<ENOMEM> C<ENOMSG> C<ENOPROTOOPT> C<ENOSPC> C<ENOSR> C<ENOSTR> C<ENOSYS> C<ENOTBLK>
2510 C<ENOTCONN> C<ENOTDIR> C<ENOTEMPTY> C<ENOTRECOVERABLE> C<ENOTSOCK> C<ENOTSUP> C<ENOTTY> C<ENXIO>
2511 C<EOPNOTSUPP> C<EOTHER> C<EOVERFLOW> C<EOWNERDEAD> C<EPERM> C<EPFNOSUPPORT> C<EPIPE> C<EPROCLIM> C<EPROTO>
2512 C<EPROTONOSUPPORT> C<EPROTOTYPE> C<ERANGE> C<EREMOTE> C<ERESTART> C<EROFS> C<ESHUTDOWN>
2513 C<ESOCKTNOSUPPORT> C<ESPIPE> C<ESRCH> C<ESTALE> C<ETIME> C<ETIMEDOUT> C<ETOOMANYREFS> C<ETXTBSY> C<EUSERS>
2514 C<EWOULDBLOCK> C<EXDEV>
2515
2516 =back
2517
2518 =head1 FCNTL
2519
2520 =over 8
2521
2522 =item Constants
2523
2524 C<FD_CLOEXEC> C<F_DUPFD> C<F_GETFD> C<F_GETFL> C<F_GETLK> C<F_OK> C<F_RDLCK> C<F_SETFD> C<F_SETFL> C<F_SETLK>
2525 C<F_SETLKW> C<F_UNLCK> C<F_WRLCK> C<O_ACCMODE> C<O_APPEND> C<O_CREAT> C<O_EXCL> C<O_NOCTTY> C<O_NONBLOCK>
2526 C<O_RDONLY> C<O_RDWR> C<O_TRUNC> C<O_WRONLY>
2527
2528 =back
2529
2530 =head1 FLOAT
2531
2532 =over 8
2533
2534 =item Constants
2535
2536 C<DBL_DIG> C<DBL_EPSILON> C<DBL_MANT_DIG> C<DBL_MAX> C<DBL_MAX_10_EXP> C<DBL_MAX_EXP> C<DBL_MIN>
2537 C<DBL_MIN_10_EXP> C<DBL_MIN_EXP> C<FLT_DIG> C<FLT_EPSILON> C<FLT_MANT_DIG> C<FLT_MAX>
2538 C<FLT_MAX_10_EXP> C<FLT_MAX_EXP> C<FLT_MIN> C<FLT_MIN_10_EXP> C<FLT_MIN_EXP> C<FLT_RADIX>
2539 C<FLT_ROUNDS> C<LDBL_DIG> C<LDBL_EPSILON> C<LDBL_MANT_DIG> C<LDBL_MAX> C<LDBL_MAX_10_EXP>
2540 C<LDBL_MAX_EXP> C<LDBL_MIN> C<LDBL_MIN_10_EXP> C<LDBL_MIN_EXP>
2541
2542 =back
2543
2544 =head1 FLOATING-POINT ENVIRONMENT
2545
2546 =over 8
2547
2548 =item Constants
2549
2550 C<FE_DOWNWARD> C<FE_TONEAREST> C<FE_TOWARDZERO> C<FE_UPWARD>
2551 on systems that support them.
2552
2553 =back
2554
2555 =head1 LIMITS
2556
2557 =over 8
2558
2559 =item Constants
2560
2561 C<ARG_MAX> C<CHAR_BIT> C<CHAR_MAX> C<CHAR_MIN> C<CHILD_MAX> C<INT_MAX> C<INT_MIN> C<LINK_MAX> C<LONG_MAX>
2562 C<LONG_MIN> C<MAX_CANON> C<MAX_INPUT> C<MB_LEN_MAX> C<NAME_MAX> C<NGROUPS_MAX> C<OPEN_MAX> C<PATH_MAX>
2563 C<PIPE_BUF> C<SCHAR_MAX> C<SCHAR_MIN> C<SHRT_MAX> C<SHRT_MIN> C<SSIZE_MAX> C<STREAM_MAX> C<TZNAME_MAX>
2564 C<UCHAR_MAX> C<UINT_MAX> C<ULONG_MAX> C<USHRT_MAX>
2565
2566 =back
2567
2568 =head1 LOCALE
2569
2570 =over 8
2571
2572 =item Constants
2573
2574 C<LC_ALL> C<LC_COLLATE> C<LC_CTYPE> C<LC_MONETARY> C<LC_NUMERIC> C<LC_TIME> C<LC_MESSAGES>
2575 on systems that support them.
2576
2577 =back
2578
2579 =head1 MATH
2580
2581 =over 8
2582
2583 =item Constants
2584
2585 C<HUGE_VAL>
2586
2587 C<FP_ILOGB0> C<FP_ILOGBNAN> C<FP_INFINITE> C<FP_NAN> C<FP_NORMAL> C<FP_SUBNORMAL> C<FP_ZERO>
2588 C<INFINITY> C<NAN> C<Inf> C<NaN>
2589 C<M_1_PI> C<M_2_PI> C<M_2_SQRTPI> C<M_E> C<M_LN10> C<M_LN2> C<M_LOG10E> C<M_LOG2E> C<M_PI>
2590 C<M_PI_2> C<M_PI_4> C<M_SQRT1_2> C<M_SQRT2>
2591 on systems with C99 support.
2592
2593 =back
2594
2595 =head1 SIGNAL
2596
2597 =over 8
2598
2599 =item Constants
2600
2601 C<SA_NOCLDSTOP> C<SA_NOCLDWAIT> C<SA_NODEFER> C<SA_ONSTACK> C<SA_RESETHAND> C<SA_RESTART>
2602 C<SA_SIGINFO> C<SIGABRT> C<SIGALRM> C<SIGCHLD> C<SIGCONT> C<SIGFPE> C<SIGHUP> C<SIGILL> C<SIGINT>
2603 C<SIGKILL> C<SIGPIPE> C<SIGQUIT> C<SIGSEGV> C<SIGSTOP> C<SIGTERM> C<SIGTSTP> C<SIGTTIN> C<SIGTTOU>
2604 C<SIGUSR1> C<SIGUSR2> C<SIG_BLOCK> C<SIG_DFL> C<SIG_ERR> C<SIG_IGN> C<SIG_SETMASK>
2605 C<SIG_UNBLOCK>
2606 C<ILL_ILLOPC> C<ILL_ILLOPN> C<ILL_ILLADR> C<ILL_ILLTRP> C<ILL_PRVOPC> C<ILL_PRVREG> C<ILL_COPROC>
2607 C<ILL_BADSTK> C<FPE_INTDIV> C<FPE_INTOVF> C<FPE_FLTDIV> C<FPE_FLTOVF> C<FPE_FLTUND> C<FPE_FLTRES>
2608 C<FPE_FLTINV> C<FPE_FLTSUB> C<SEGV_MAPERR> C<SEGV_ACCERR> C<BUS_ADRALN> C<BUS_ADRERR>
2609 C<BUS_OBJERR> C<TRAP_BRKPT> C<TRAP_TRACE> C<CLD_EXITED> C<CLD_KILLED> C<CLD_DUMPED> C<CLD_TRAPPED>
2610 C<CLD_STOPPED> C<CLD_CONTINUED> C<POLL_IN> C<POLL_OUT> C<POLL_MSG> C<POLL_ERR> C<POLL_PRI>
2611 C<POLL_HUP> C<SI_USER> C<SI_QUEUE> C<SI_TIMER> C<SI_ASYNCIO> C<SI_MESGQ>
2612
2613 =back
2614
2615 =head1 STAT
2616
2617 =over 8
2618
2619 =item Constants
2620
2621 C<S_IRGRP> C<S_IROTH> C<S_IRUSR> C<S_IRWXG> C<S_IRWXO> C<S_IRWXU> C<S_ISGID> C<S_ISUID> C<S_IWGRP> C<S_IWOTH>
2622 C<S_IWUSR> C<S_IXGRP> C<S_IXOTH> C<S_IXUSR>
2623
2624 =item Macros
2625
2626 C<S_ISBLK> C<S_ISCHR> C<S_ISDIR> C<S_ISFIFO> C<S_ISREG>
2627
2628 =back
2629
2630 =head1 STDLIB
2631
2632 =over 8
2633
2634 =item Constants
2635
2636 C<EXIT_FAILURE> C<EXIT_SUCCESS> C<MB_CUR_MAX> C<RAND_MAX>
2637
2638 =back
2639
2640 =head1 STDIO
2641
2642 =over 8
2643
2644 =item Constants
2645
2646 C<BUFSIZ> C<EOF> C<FILENAME_MAX> C<L_ctermid> C<L_cuserid> C<TMP_MAX>
2647
2648 =back
2649
2650 =head1 TIME
2651
2652 =over 8
2653
2654 =item Constants
2655
2656 C<CLK_TCK> C<CLOCKS_PER_SEC>
2657
2658 =back
2659
2660 =head1 UNISTD
2661
2662 =over 8
2663
2664 =item Constants
2665
2666 C<R_OK> C<SEEK_CUR> C<SEEK_END> C<SEEK_SET> C<STDIN_FILENO> C<STDOUT_FILENO> C<STDERR_FILENO> C<W_OK> C<X_OK>
2667
2668 =back
2669
2670 =head1 WAIT
2671
2672 =over 8
2673
2674 =item Constants
2675
2676 C<WNOHANG> C<WUNTRACED>
2677
2678 =over 16
2679
2680 =item C<WNOHANG>
2681
2682 Do not suspend the calling process until a child process
2683 changes state but instead return immediately.
2684
2685 =item C<WUNTRACED>
2686
2687 Catch stopped child processes.
2688
2689 =back
2690
2691 =item Macros
2692
2693 C<WIFEXITED> C<WEXITSTATUS> C<WIFSIGNALED> C<WTERMSIG> C<WIFSTOPPED> C<WSTOPSIG>
2694
2695 =over 16
2696
2697 =item C<WIFEXITED>
2698
2699 C<WIFEXITED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2700 exited normally (C<exit()> or by falling off the end of C<main()>)
2701
2702 =item C<WEXITSTATUS>
2703
2704 C<WEXITSTATUS(${^CHILD_ERROR_NATIVE})> returns the normal exit status of
2705 the child process (only meaningful if C<WIFEXITED(${^CHILD_ERROR_NATIVE})>
2706 is true)
2707
2708 =item C<WIFSIGNALED>
2709
2710 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2711 terminated because of a signal
2712
2713 =item C<WTERMSIG>
2714
2715 C<WTERMSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2716 terminated for (only meaningful if
2717 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})>
2718 is true)
2719
2720 =item C<WIFSTOPPED>
2721
2722 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})> returns true if the child process is
2723 currently stopped (can happen only if you specified the WUNTRACED flag
2724 to C<waitpid()>)
2725
2726 =item C<WSTOPSIG>
2727
2728 C<WSTOPSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2729 was stopped for (only meaningful if
2730 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})>
2731 is true)
2732
2733 =back
2734
2735 =back
2736
2737 =head1 WINSOCK
2738
2739 (Windows only.)
2740
2741 =over 8
2742
2743 =item Constants
2744
2745 C<WSAEINTR> C<WSAEBADF> C<WSAEACCES> C<WSAEFAULT> C<WSAEINVAL> C<WSAEMFILE> C<WSAEWOULDBLOCK>
2746 C<WSAEINPROGRESS> C<WSAEALREADY> C<WSAENOTSOCK> C<WSAEDESTADDRREQ> C<WSAEMSGSIZE>
2747 C<WSAEPROTOTYPE> C<WSAENOPROTOOPT> C<WSAEPROTONOSUPPORT> C<WSAESOCKTNOSUPPORT>
2748 C<WSAEOPNOTSUPP> C<WSAEPFNOSUPPORT> C<WSAEAFNOSUPPORT> C<WSAEADDRINUSE>
2749 C<WSAEADDRNOTAVAIL> C<WSAENETDOWN> C<WSAENETUNREACH> C<WSAENETRESET> C<WSAECONNABORTED>
2750 C<WSAECONNRESET> C<WSAENOBUFS> C<WSAEISCONN> C<WSAENOTCONN> C<WSAESHUTDOWN>
2751 C<WSAETOOMANYREFS> C<WSAETIMEDOUT> C<WSAECONNREFUSED> C<WSAELOOP> C<WSAENAMETOOLONG>
2752 C<WSAEHOSTDOWN> C<WSAEHOSTUNREACH> C<WSAENOTEMPTY> C<WSAEPROCLIM> C<WSAEUSERS>
2753 C<WSAEDQUOT> C<WSAESTALE> C<WSAEREMOTE> C<WSAEDISCON> C<WSAENOMORE> C<WSAECANCELLED>
2754 C<WSAEINVALIDPROCTABLE> C<WSAEINVALIDPROVIDER> C<WSAEPROVIDERFAILEDINIT>
2755 C<WSAEREFUSED>
2756
2757 =back
2758