This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Localeconv() should be independent of 'use locale'
[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 I<Everything is exported by default> with the exception of any POSIX
25 functions with the same name as a built-in Perl function, such as
26 C<abs>, C<alarm>, C<rmdir>, C<write>, etc.., which will be exported
27 only if you ask for them explicitly.  This is an unfortunate backwards
28 compatibility feature.  You can stop the exporting by saying S<C<use
29 POSIX ()>> and then use the fully qualified names (I<e.g.>, C<POSIX::SEEK_END>),
30 or by giving an explicit import list.  If you do neither, and opt for the
31 default, S<C<use POSIX;>> has to import I<553 symbols>.
32
33 This document gives a condensed list of the features available in the POSIX
34 module.  Consult your operating system's manpages for general information on
35 most features.  Consult L<perlfunc> for functions which are noted as being
36 identical to Perl's builtin functions.
37
38 The first section describes POSIX functions from the 1003.1 specification.
39 The second section describes some classes for signal objects, TTY objects,
40 and other miscellaneous objects.  The remaining sections list various
41 constants and macros in an organization which roughly follows IEEE Std
42 1003.1b-1993.
43
44 =head1 CAVEATS
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
85 the absolute value of its numerical argument.
86
87 =item C<access>
88
89 Determines the accessibility of a file.
90
91         if( POSIX::access( "/", &POSIX::R_OK ) ){
92                 print "have read permission\n";
93         }
94
95 Returns C<undef> on failure.  Note: do not use C<access()> for
96 security purposes.  Between the C<access()> call and the operation
97 you are preparing for the permissions might change: a classic
98 I<race condition>.
99
100 =item C<acos>
101
102 This is identical to the C function C<acos()>, returning
103 the arcus cosine of its numerical argument.  See also L<Math::Trig>.
104
105 =item C<alarm>
106
107 This is identical to Perl's builtin C<alarm()> function,
108 either for arming or disarming the C<SIGARLM> timer.
109
110 =item C<asctime>
111
112 This is identical to the C function C<asctime()>.  It returns
113 a string of the form
114
115         "Fri Jun  2 18:22:13 2000\n\0"
116
117 and it is called thusly
118
119         $asctime = asctime($sec, $min, $hour, $mday, $mon,
120                            $year, $wday, $yday, $isdst);
121
122 The C<$mon> is zero-based: January equals C<0>.  The C<$year> is
123 1900-based: 2001 equals C<101>.  C<$wday> and C<$yday> default to zero
124 (and are usually ignored anyway), and C<$isdst> defaults to -1.
125
126 =item C<asin>
127
128 This is identical to the C function C<asin()>, returning
129 the arcus sine of its numerical argument.  See also L<Math::Trig>.
130
131 =item C<assert>
132
133 Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
134 to achieve similar things.
135
136 =item C<atan>
137
138 This is identical to the C function C<atan()>, returning the
139 arcus tangent of its numerical argument.  See also L<Math::Trig>.
140
141 =item C<atan2>
142
143 This is identical to Perl's builtin C<atan2()> function, returning
144 the arcus tangent defined by its two numerical arguments, the I<y>
145 coordinate and the I<x> coordinate.  See also L<Math::Trig>.
146
147 =item C<atexit>
148
149 C<atexit()> is C-specific: use C<END {}> instead, see L<perlsub>.
150
151 =item C<atof>
152
153 C<atof()> is C-specific.  Perl converts strings to numbers transparently.
154 If you need to force a scalar to a number, add a zero to it.
155
156 =item C<atoi>
157
158 C<atoi()> is C-specific.  Perl converts strings to numbers transparently.
159 If you need to force a scalar to a number, add a zero to it.
160 If you need to have just the integer part, see L<perlfunc/int>.
161
162 =item C<atol>
163
164 C<atol()> is C-specific.  Perl converts strings to numbers transparently.
165 If you need to force a scalar to a number, add a zero to it.
166 If you need to have just the integer part, see L<perlfunc/int>.
167
168 =item C<bsearch>
169
170 C<bsearch()> not supplied.  For doing binary search on wordlists,
171 see L<Search::Dict>.
172
173 =item C<calloc>
174
175 C<calloc()> is C-specific.  Perl does memory management transparently.
176
177 =item C<ceil>
178
179 This is identical to the C function C<ceil()>, returning the smallest
180 integer value greater than or equal to the given numerical argument.
181
182 =item C<chdir>
183
184 This is identical to Perl's builtin C<chdir()> function, allowing
185 one to change the working (default) directory, see L<perlfunc/chdir>.
186
187 =item C<chmod>
188
189 This is identical to Perl's builtin C<chmod()> function, allowing
190 one to change file and directory permissions, see L<perlfunc/chmod>.
191
192 =item C<chown>
193
194 This is identical to Perl's builtin C<chown()> function, allowing one
195 to change file and directory owners and groups, see L<perlfunc/chown>.
196
197 =item C<clearerr>
198
199 Use the method C<IO::Handle::clearerr()> instead, to reset the error
200 state (if any) and EOF state (if any) of the given stream.
201
202 =item C<clock>
203
204 This is identical to the C function C<clock()>, returning the
205 amount of spent processor time in microseconds.
206
207 =item C<close>
208
209 Close the file.  This uses file descriptors such as those obtained by calling
210 C<POSIX::open>.
211
212         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
213         POSIX::close( $fd );
214
215 Returns C<undef> on failure.
216
217 See also L<perlfunc/close>.
218
219 =item C<closedir>
220
221 This is identical to Perl's builtin C<closedir()> function for closing
222 a directory handle, see L<perlfunc/closedir>.
223
224 =item C<cos>
225
226 This is identical to Perl's builtin C<cos()> function, for returning
227 the cosine of its numerical argument, see L<perlfunc/cos>.
228 See also L<Math::Trig>.
229
230 =item C<cosh>
231
232 This is identical to the C function C<cosh()>, for returning
233 the hyperbolic cosine of its numeric argument.  See also L<Math::Trig>.
234
235 =item C<creat>
236
237 Create a new file.  This returns a file descriptor like the ones returned by
238 C<POSIX::open>.  Use C<POSIX::close> to close the file.
239
240         $fd = POSIX::creat( "foo", 0611 );
241         POSIX::close( $fd );
242
243 See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
244
245 =item C<ctermid>
246
247 Generates the path name for the controlling terminal.
248
249         $path = POSIX::ctermid();
250
251 =item C<ctime>
252
253 This is identical to the C function C<ctime()> and equivalent
254 to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
255
256 =item C<cuserid>
257
258 Get the login name of the owner of the current process.
259
260         $name = POSIX::cuserid();
261
262 =item C<difftime>
263
264 This is identical to the C function C<difftime()>, for returning
265 the time difference (in seconds) between two times (as returned
266 by C<time()>), see L</time>.
267
268 =item C<div>
269
270 C<div()> is C-specific, use L<perlfunc/int> on the usual C</> division and
271 the modulus C<%>.
272
273 =item C<dup>
274
275 This is similar to the C function C<dup()>, for duplicating a file
276 descriptor.
277
278 This uses file descriptors such as those obtained by calling
279 C<POSIX::open>.
280
281 Returns C<undef> on failure.
282
283 =item C<dup2>
284
285 This is similar to the C function C<dup2()>, for duplicating a file
286 descriptor to an another known file descriptor.
287
288 This uses file descriptors such as those obtained by calling
289 C<POSIX::open>.
290
291 Returns C<undef> on failure.
292
293 =item C<errno>
294
295 Returns the value of errno.
296
297         $errno = POSIX::errno();
298
299 This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
300
301 =item C<execl>
302
303 C<execl()> is C-specific, see L<perlfunc/exec>.
304
305 =item C<execle>
306
307 C<execle()> is C-specific, see L<perlfunc/exec>.
308
309 =item C<execlp>
310
311 C<execlp()> is C-specific, see L<perlfunc/exec>.
312
313 =item C<execv>
314
315 C<execv()> is C-specific, see L<perlfunc/exec>.
316
317 =item C<execve>
318
319 C<execve()> is C-specific, see L<perlfunc/exec>.
320
321 =item C<execvp>
322
323 C<execvp()> is C-specific, see L<perlfunc/exec>.
324
325 =item C<exit>
326
327 This is identical to Perl's builtin C<exit()> function for exiting the
328 program, see L<perlfunc/exit>.
329
330 =item C<exp>
331
332 This is identical to Perl's builtin C<exp()> function for
333 returning the exponent (I<e>-based) of the numerical argument,
334 see L<perlfunc/exp>.
335
336 =item C<fabs>
337
338 This is identical to Perl's builtin C<abs()> function for returning
339 the absolute value of the numerical argument, see L<perlfunc/abs>.
340
341 =item C<fclose>
342
343 Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
344
345 =item C<fcntl>
346
347 This is identical to Perl's builtin C<fcntl()> function,
348 see L<perlfunc/fcntl>.
349
350 =item C<fdopen>
351
352 Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
353
354 =item C<feof>
355
356 Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
357
358 =item C<ferror>
359
360 Use method C<IO::Handle::error()> instead.
361
362 =item C<fflush>
363
364 Use method C<IO::Handle::flush()> instead.
365 See also C<L<perlvar/$OUTPUT_AUTOFLUSH>>.
366
367 =item C<fgetc>
368
369 Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
370
371 =item C<fgetpos>
372
373 Use method C<IO::Seekable::getpos()> instead, or see L<perlfunc/seek>.
374
375 =item C<fgets>
376
377 Use method C<IO::Handle::gets()> instead.  Similar to E<lt>E<gt>, also known
378 as L<perlfunc/readline>.
379
380 =item C<fileno>
381
382 Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
383
384 =item C<floor>
385
386 This is identical to the C function C<floor()>, returning the largest
387 integer value less than or equal to the numerical argument.
388
389 =item C<fmod>
390
391 This is identical to the C function C<fmod()>.
392
393         $r = fmod($x, $y);
394
395 It returns the remainder C<$r = $x - $n*$y>, where C<$n = trunc($x/$y)>.
396 The C<$r> has the same sign as C<$x> and magnitude (absolute value)
397 less than the magnitude of C<$y>.
398
399 =item C<fopen>
400
401 Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
402
403 =item C<fork>
404
405 This is identical to Perl's builtin C<fork()> function
406 for duplicating the current process, see L<perlfunc/fork>
407 and L<perlfork> if you are in Windows.
408
409 =item C<fpathconf>
410
411 Retrieves the value of a configurable limit on a file or directory.  This
412 uses file descriptors such as those obtained by calling C<POSIX::open>.
413
414 The following will determine the maximum length of the longest allowable
415 pathname on the filesystem which holds F</var/foo>.
416
417         $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
418         $path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX);
419
420 Returns C<undef> on failure.
421
422 =item C<fprintf>
423
424 C<fprintf()> is C-specific, see L<perlfunc/printf> instead.
425
426 =item C<fputc>
427
428 C<fputc()> is C-specific, see L<perlfunc/print> instead.
429
430 =item C<fputs>
431
432 C<fputs()> is C-specific, see L<perlfunc/print> instead.
433
434 =item C<fread>
435
436 C<fread()> is C-specific, see L<perlfunc/read> instead.
437
438 =item C<free>
439
440 C<free()> is C-specific.  Perl does memory management transparently.
441
442 =item C<freopen>
443
444 C<freopen()> is C-specific, see L<perlfunc/open> instead.
445
446 =item C<frexp>
447
448 Return the mantissa and exponent of a floating-point number.
449
450         ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
451
452 =item C<fscanf>
453
454 C<fscanf()> is C-specific, use E<lt>E<gt> and regular expressions instead.
455
456 =item C<fseek>
457
458 Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
459
460 =item C<fsetpos>
461
462 Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
463
464 =item C<fstat>
465
466 Get file status.  This uses file descriptors such as those obtained by
467 calling C<POSIX::open>.  The data returned is identical to the data from
468 Perl's builtin C<stat> function.
469
470         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
471         @stats = POSIX::fstat( $fd );
472
473 =item C<fsync>
474
475 Use method C<IO::Handle::sync()> instead.
476
477 =item C<ftell>
478
479 Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
480
481 =item C<fwrite>
482
483 C<fwrite()> is C-specific, see L<perlfunc/print> instead.
484
485 =item C<getc>
486
487 This is identical to Perl's builtin C<getc()> function,
488 see L<perlfunc/getc>.
489
490 =item C<getchar>
491
492 Returns one character from STDIN.  Identical to Perl's C<getc()>,
493 see L<perlfunc/getc>.
494
495 =item C<getcwd>
496
497 Returns the name of the current working directory.
498 See also L<Cwd>.
499
500 =item C<getegid>
501
502 Returns the effective group identifier.  Similar to Perl' s builtin
503 variable C<$(>, see L<perlvar/$EGID>.
504
505 =item C<getenv>
506
507 Returns the value of the specified environment variable.
508 The same information is available through the C<%ENV> array.
509
510 =item C<geteuid>
511
512 Returns the effective user identifier.  Identical to Perl's builtin C<$E<gt>>
513 variable, see L<perlvar/$EUID>.
514
515 =item C<getgid>
516
517 Returns the user's real group identifier.  Similar to Perl's builtin
518 variable C<$)>, see L<perlvar/$GID>.
519
520 =item C<getgrgid>
521
522 This is identical to Perl's builtin C<getgrgid()> function for
523 returning group entries by group identifiers, see
524 L<perlfunc/getgrgid>.
525
526 =item C<getgrnam>
527
528 This is identical to Perl's builtin C<getgrnam()> function for
529 returning group entries by group names, see L<perlfunc/getgrnam>.
530
531 =item C<getgroups>
532
533 Returns the ids of the user's supplementary groups.  Similar to Perl's
534 builtin variable C<$)>, see L<perlvar/$GID>.
535
536 =item C<getlogin>
537
538 This is identical to Perl's builtin C<getlogin()> function for
539 returning the user name associated with the current session, see
540 L<perlfunc/getlogin>.
541
542 =item C<getpgrp>
543
544 This is identical to Perl's builtin C<getpgrp()> function for
545 returning the process group identifier of the current process, see
546 L<perlfunc/getpgrp>.
547
548 =item C<getpid>
549
550 Returns the process identifier.  Identical to Perl's builtin
551 variable C<$$>, see L<perlvar/$PID>.
552
553 =item C<getppid>
554
555 This is identical to Perl's builtin C<getppid()> function for
556 returning the process identifier of the parent process of the current
557 process , see L<perlfunc/getppid>.
558
559 =item C<getpwnam>
560
561 This is identical to Perl's builtin C<getpwnam()> function for
562 returning user entries by user names, see L<perlfunc/getpwnam>.
563
564 =item C<getpwuid>
565
566 This is identical to Perl's builtin C<getpwuid()> function for
567 returning user entries by user identifiers, see L<perlfunc/getpwuid>.
568
569 =item C<gets>
570
571 Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
572 as the C<readline()> function, see L<perlfunc/readline>.
573
574 B<NOTE>: if you have C programs that still use C<gets()>, be very
575 afraid.  The C<gets()> function is a source of endless grief because
576 it has no buffer overrun checks.  It should B<never> be used.  The
577 C<fgets()> function should be preferred instead.
578
579 =item C<getuid>
580
581 Returns the user's identifier.  Identical to Perl's builtin C<$E<lt>> variable,
582 see L<perlvar/$UID>.
583
584 =item C<gmtime>
585
586 This is identical to Perl's builtin C<gmtime()> function for
587 converting seconds since the epoch to a date in Greenwich Mean Time,
588 see L<perlfunc/gmtime>.
589
590 =item C<isalnum>
591
592 Deprecated function whose use raises a warning, and which is slated to
593 be removed in a future Perl version.  It is very similar to matching
594 against S<C<qr/ ^ [[:alnum:]]+ $ /x>>, which you should convert to use
595 instead.  The function is deprecated because 1) it doesn't handle UTF-8
596 encoded strings properly; and 2) it returns C<TRUE> even if the input is
597 the empty string.  The function return is always based on the current
598 locale, whereas using locale rules is optional with the regular
599 expression, based on pragmas in effect and pattern modifiers (see
600 L<perlre/Character set modifiers> and L<perlre/Which character set
601 modifier is in effect?>).
602
603 The function returns C<TRUE> if the input string is empty, or if the
604 corresponding C function returns C<TRUE> for every byte in the string.
605
606 You may want to use the C<L<E<sol>\wE<sol>|perlrecharclass/Word
607 characters>> construct instead.
608
609 =item C<isalpha>
610
611 Deprecated function whose use raises a warning, and which is slated to
612 be removed in a future Perl version.  It is very similar to matching
613 against S<C<qr/ ^ [[:alpha:]]+ $ /x>>, which you should convert to use
614 instead.  The function is deprecated because 1) it doesn't handle UTF-8
615 encoded strings properly; and 2) it returns C<TRUE> even if the input is
616 the empty string.  The function return is always based on the current
617 locale, whereas using locale rules is optional with the regular
618 expression, based on pragmas in effect and pattern modifiers (see
619 L<perlre/Character set modifiers> and L<perlre/Which character set
620 modifier is in effect?>).
621
622 The function returns C<TRUE> if the input string is empty, or if the
623 corresponding C function returns C<TRUE> for every byte in the string.
624
625 =item C<isatty>
626
627 Returns a boolean indicating whether the specified filehandle is connected
628 to a tty.  Similar to the C<-t> operator, see L<perlfunc/-X>.
629
630 =item C<iscntrl>
631
632 Deprecated function whose use raises a warning, and which is slated to
633 be removed in a future Perl version.  It is very similar to matching
634 against S<C<qr/ ^ [[:cntrl:]]+ $ /x>>, which you should convert to use
635 instead.  The function is deprecated because 1) it doesn't handle UTF-8
636 encoded strings properly; and 2) it returns C<TRUE> even if the input is
637 the empty string.  The function return is always based on the current
638 locale, whereas using locale rules is optional with the regular
639 expression, based on pragmas in effect and pattern modifiers (see
640 L<perlre/Character set modifiers> and L<perlre/Which character set
641 modifier is in effect?>).
642
643 The function returns C<TRUE> if the input string is empty, or if the
644 corresponding C function returns C<TRUE> for every byte in the string.
645
646 =item C<isdigit>
647
648 Deprecated function whose use raises a warning, and which is slated to
649 be removed in a future Perl version.  It is very similar to matching
650 against S<C<qr/ ^ [[:digit:]]+ $ /x>>, which you should convert to use
651 instead.  The function is deprecated because 1) it doesn't handle UTF-8
652 encoded strings properly; and 2) it returns C<TRUE> even if the input is
653 the empty string.  The function return is always based on the current
654 locale, whereas using locale rules is optional with the regular
655 expression, based on pragmas in effect and pattern modifiers (see
656 L<perlre/Character set modifiers> and L<perlre/Which character set
657 modifier is in effect?>).
658
659 The function returns C<TRUE> if the input string is empty, or if the
660 corresponding C function returns C<TRUE> for every byte in the string.
661
662 You may want to use the C<L<E<sol>\dE<sol>|perlrecharclass/Digits>>
663 construct instead.
664
665 =item C<isgraph>
666
667 Deprecated function whose use raises a warning, and which is slated to
668 be removed in a future Perl version.  It is very similar to matching
669 against S<C<qr/ ^ [[:graph:]]+ $ /x>>, which you should convert to use
670 instead.  The function is deprecated because 1) it doesn't handle UTF-8
671 encoded strings properly; and 2) it returns C<TRUE> even if the input is
672 the empty string.  The function return is always based on the current
673 locale, whereas using locale rules is optional with the regular
674 expression, based on pragmas in effect and pattern modifiers (see
675 L<perlre/Character set modifiers> and L<perlre/Which character set
676 modifier is in effect?>).
677
678 The function returns C<TRUE> if the input string is empty, or if the
679 corresponding C function returns C<TRUE> for every byte in the string.
680
681 =item C<islower>
682
683 Deprecated function whose use raises a warning, and which is slated to
684 be removed in a future Perl version.  It is very similar to matching
685 against S<C<qr/ ^ [[:lower:]]+ $ /x>>, which you should convert to use
686 instead.  The function is deprecated because 1) it doesn't handle UTF-8
687 encoded strings properly; and 2) it returns C<TRUE> even if the input is
688 the empty string.  The function return is always based on the current
689 locale, whereas using locale rules is optional with the regular
690 expression, based on pragmas in effect and pattern modifiers (see
691 L<perlre/Character set modifiers> and L<perlre/Which character set
692 modifier is in effect?>).
693
694 The function returns C<TRUE> if the input string is empty, or if the
695 corresponding C function returns C<TRUE> for every byte in the string.
696
697 Do B<not> use C</[a-z]/> unless you don't care about the current locale.
698
699 =item C<isprint>
700
701 Deprecated function whose use raises a warning, and which is slated to
702 be removed in a future Perl version.  It is very similar to matching
703 against S<C<qr/ ^ [[:print:]]+ $ /x>>, which you should convert to use
704 instead.  The function is deprecated because 1) it doesn't handle UTF-8
705 encoded strings properly; and 2) it returns C<TRUE> even if the input is
706 the empty string.  The function return is always based on the current
707 locale, whereas using locale rules is optional with the regular
708 expression, based on pragmas in effect and pattern modifiers (see
709 L<perlre/Character set modifiers> and L<perlre/Which character set
710 modifier is in effect?>).
711
712 The function returns C<TRUE> if the input string is empty, or if the
713 corresponding C function returns C<TRUE> for every byte in the string.
714
715 =item C<ispunct>
716
717 Deprecated function whose use raises a warning, and which is slated to
718 be removed in a future Perl version.  It is very similar to matching
719 against S<C<qr/ ^ [[:punct:]]+ $ /x>>, which you should convert to use
720 instead.  The function is deprecated because 1) it doesn't handle UTF-8
721 encoded strings properly; and 2) it returns C<TRUE> even if the input is
722 the empty string.  The function return is always based on the current
723 locale, whereas using locale rules is optional with the regular
724 expression, based on pragmas in effect and pattern modifiers (see
725 L<perlre/Character set modifiers> and L<perlre/Which character set
726 modifier is in effect?>).
727
728 The function returns C<TRUE> if the input string is empty, or if the
729 corresponding C function returns C<TRUE> for every byte in the string.
730
731 =item C<isspace>
732
733 Deprecated function whose use raises a warning, and which is slated to
734 be removed in a future Perl version.  It is very similar to matching
735 against S<C<qr/ ^ [[:space:]]+ $ /x>>, which you should convert to use
736 instead.  The function is deprecated because 1) it doesn't handle UTF-8
737 encoded strings properly; and 2) it returns C<TRUE> even if the input is
738 the empty string.  The function return is always based on the current
739 locale, whereas using locale rules is optional with the regular
740 expression, based on pragmas in effect and pattern modifiers (see
741 L<perlre/Character set modifiers> and L<perlre/Which character set
742 modifier is in effect?>).
743
744 The function returns C<TRUE> if the input string is empty, or if the
745 corresponding C function returns C<TRUE> for every byte in the string.
746
747 You may want to use the C<L<E<sol>\sE<sol>|perlrecharclass/Whitespace>>
748 construct instead.
749
750 =item C<isupper>
751
752 Deprecated function whose use raises a warning, and which is slated to
753 be removed in a future Perl version.  It is very similar to matching
754 against S<C<qr/ ^ [[:upper:]]+ $ /x>>, which you should convert to use
755 instead.  The function is deprecated because 1) it doesn't handle UTF-8
756 encoded strings properly; and 2) it returns C<TRUE> even if the input is
757 the empty string.  The function return is always based on the current
758 locale, whereas using locale rules is optional with the regular
759 expression, based on pragmas in effect and pattern modifiers (see
760 L<perlre/Character set modifiers> and L<perlre/Which character set
761 modifier is in effect?>).
762
763 The function returns C<TRUE> if the input string is empty, or if the
764 corresponding C function returns C<TRUE> for every byte in the string.
765
766 Do B<not> use C</[A-Z]/> unless you don't care about the current locale.
767
768 =item C<isxdigit>
769
770 Deprecated function whose use raises a warning, and which is slated to
771 be removed in a future Perl version.  It is very similar to matching
772 against S<C<qr/ ^ [[:xdigit:]]+ $ /x>>, which you should convert to use
773 instead.  The function is deprecated because 1) it doesn't handle UTF-8
774 encoded strings properly; and 2) it returns C<TRUE> even if the input is
775 the empty string.  The function return is always based on the current
776 locale, whereas using locale rules is optional with the regular
777 expression, based on pragmas in effect and pattern modifiers (see
778 L<perlre/Character set modifiers> and L<perlre/Which character set
779 modifier is in effect?>).
780
781 The function returns C<TRUE> if the input string is empty, or if the
782 corresponding C function returns C<TRUE> for every byte in the string.
783
784 =item C<kill>
785
786 This is identical to Perl's builtin C<kill()> function for sending
787 signals to processes (often to terminate them), see L<perlfunc/kill>.
788
789 =item C<labs>
790
791 (For returning absolute values of long integers.)
792 C<labs()> is C-specific, see L<perlfunc/abs> instead.
793
794 =item C<lchown>
795
796 This is identical to the C function, except the order of arguments is
797 consistent with Perl's builtin C<chown()> with the added restriction
798 of only one path, not an list of paths.  Does the same thing as the 
799 C<chown()> function but changes the owner of a symbolic link instead 
800 of the file the symbolic link points to.
801
802 =item C<ldexp>
803
804 This is identical to the C function C<ldexp()>
805 for multiplying floating point numbers with powers of two.
806
807         $x_quadrupled = POSIX::ldexp($x, 2);
808
809 =item C<ldiv>
810
811 (For computing dividends of long integers.)
812 C<ldiv()> is C-specific, use C</> and C<int()> instead.
813
814 =item C<link>
815
816 This is identical to Perl's builtin C<link()> function
817 for creating hard links into files, see L<perlfunc/link>.
818
819 =item C<localeconv>
820
821 Get numeric formatting information.  Returns a reference to a hash
822 containing the current underlying locale's formatting values.  Users of this function
823 should also read L<perllocale>, which provides a comprehensive
824 discussion of Perl locale handling, including
825 L<a section devoted to this function|perllocale/The localeconv function>.
826
827 Here is how to query the database for the B<de> (Deutsch or German) locale.
828
829         my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
830         print "Locale: \"$loc\"\n";
831         my $lconv = POSIX::localeconv();
832         foreach my $property (qw(
833                 decimal_point
834                 thousands_sep
835                 grouping
836                 int_curr_symbol
837                 currency_symbol
838                 mon_decimal_point
839                 mon_thousands_sep
840                 mon_grouping
841                 positive_sign
842                 negative_sign
843                 int_frac_digits
844                 frac_digits
845                 p_cs_precedes
846                 p_sep_by_space
847                 n_cs_precedes
848                 n_sep_by_space
849                 p_sign_posn
850                 n_sign_posn
851         ))
852         {
853                 printf qq(%s: "%s",\n),
854                         $property, $lconv->{$property};
855         }
856
857 =item C<localtime>
858
859 This is identical to Perl's builtin C<localtime()> function for
860 converting seconds since the epoch to a date see L<perlfunc/localtime>.
861
862 =item C<log>
863
864 This is identical to Perl's builtin C<log()> function,
865 returning the natural (I<e>-based) logarithm of the numerical argument,
866 see L<perlfunc/log>.
867
868 =item C<log10>
869
870 This is identical to the C function C<log10()>,
871 returning the 10-base logarithm of the numerical argument.
872 You can also use
873
874     sub log10 { log($_[0]) / log(10) }
875
876 or
877
878     sub log10 { log($_[0]) / 2.30258509299405 }
879
880 or
881
882     sub log10 { log($_[0]) * 0.434294481903252 }
883
884 =item C<longjmp>
885
886 C<longjmp()> is C-specific: use L<perlfunc/die> instead.
887
888 =item C<lseek>
889
890 Move the file's read/write position.  This uses file descriptors such as
891 those obtained by calling C<POSIX::open>.
892
893         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
894         $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
895
896 Returns C<undef> on failure.
897
898 =item C<malloc>
899
900 C<malloc()> is C-specific.  Perl does memory management transparently.
901
902 =item C<mblen>
903
904 This is identical to the C function C<mblen()>.
905 Perl does not have any support for the wide and multibyte
906 characters of the C standards, so this might be a rather
907 useless function.
908
909 =item C<mbstowcs>
910
911 This is identical to the C function C<mbstowcs()>.
912 Perl does not have any support for the wide and multibyte
913 characters of the C standards, so this might be a rather
914 useless function.
915
916 =item C<mbtowc>
917
918 This is identical to the C function C<mbtowc()>.
919 Perl does not have any support for the wide and multibyte
920 characters of the C standards, so this might be a rather
921 useless function.
922
923 =item C<memchr>
924
925 C<memchr()> is C-specific, see L<perlfunc/index> instead.
926
927 =item C<memcmp>
928
929 C<memcmp()> is C-specific, use C<eq> instead, see L<perlop>.
930
931 =item C<memcpy>
932
933 C<memcpy()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
934
935 =item C<memmove>
936
937 C<memmove()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
938
939 =item C<memset>
940
941 C<memset()> is C-specific, use C<x> instead, see L<perlop>.
942
943 =item C<mkdir>
944
945 This is identical to Perl's builtin C<mkdir()> function
946 for creating directories, see L<perlfunc/mkdir>.
947
948 =item C<mkfifo>
949
950 This is similar to the C function C<mkfifo()> for creating
951 FIFO special files.
952
953         if (mkfifo($path, $mode)) { ....
954
955 Returns C<undef> on failure.  The C<$mode> is similar to the
956 mode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
957 you B<must> specify the C<$mode>.
958
959 =item C<mktime>
960
961 Convert date/time info to a calendar time.
962
963 Synopsis:
964
965         mktime(sec, min, hour, mday, mon, year, wday = 0,
966                yday = 0, isdst = -1)
967
968 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
969 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
970 year (C<year>) is given in years since 1900.  I.e. The year 1995 is 95; the
971 year 2001 is 101.  Consult your system's C<mktime()> manpage for details
972 about these and the other arguments.
973
974 Calendar time for December 12, 1995, at 10:30 am.
975
976         $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
977         print "Date = ", POSIX::ctime($time_t);
978
979 Returns C<undef> on failure.
980
981 =item C<modf>
982
983 Return the integral and fractional parts of a floating-point number.
984
985         ($fractional, $integral) = POSIX::modf( 3.14 );
986
987 =item C<nice>
988
989 This is similar to the C function C<nice()>, for changing
990 the scheduling preference of the current process.  Positive
991 arguments mean more polite process, negative values more
992 needy process.  Normal user processes can only be more polite.
993
994 Returns C<undef> on failure.
995
996 =item C<offsetof>
997
998 C<offsetof()> is C-specific, you probably want to see L<perlfunc/pack> instead.
999
1000 =item C<open>
1001
1002 Open a file for reading for writing.  This returns file descriptors, not
1003 Perl filehandles.  Use C<POSIX::close> to close the file.
1004
1005 Open a file read-only with mode 0666.
1006
1007         $fd = POSIX::open( "foo" );
1008
1009 Open a file for read and write.
1010
1011         $fd = POSIX::open( "foo", &POSIX::O_RDWR );
1012
1013 Open a file for write, with truncation.
1014
1015         $fd = POSIX::open(
1016                 "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC
1017         );
1018
1019 Create a new file with mode 0640.  Set up the file for writing.
1020
1021         $fd = POSIX::open(
1022                 "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640
1023         );
1024
1025 Returns C<undef> on failure.
1026
1027 See also L<perlfunc/sysopen>.
1028
1029 =item C<opendir>
1030
1031 Open a directory for reading.
1032
1033         $dir = POSIX::opendir( "/var" );
1034         @files = POSIX::readdir( $dir );
1035         POSIX::closedir( $dir );
1036
1037 Returns C<undef> on failure.
1038
1039 =item C<pathconf>
1040
1041 Retrieves the value of a configurable limit on a file or directory.
1042
1043 The following will determine the maximum length of the longest allowable
1044 pathname on the filesystem which holds C</var>.
1045
1046         $path_max = POSIX::pathconf( "/var",
1047                                       &POSIX::_PC_PATH_MAX );
1048
1049 Returns C<undef> on failure.
1050
1051 =item C<pause>
1052
1053 This is similar to the C function C<pause()>, which suspends
1054 the execution of the current process until a signal is received.
1055
1056 Returns C<undef> on failure.
1057
1058 =item C<perror>
1059
1060 This is identical to the C function C<perror()>, which outputs to the
1061 standard error stream the specified message followed by C<": "> and the
1062 current error string.  Use the C<warn()> function and the C<$!>
1063 variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
1064
1065 =item C<pipe>
1066
1067 Create an interprocess channel.  This returns file descriptors like those
1068 returned by C<POSIX::open>.
1069
1070         my ($read, $write) = POSIX::pipe();
1071         POSIX::write( $write, "hello", 5 );
1072         POSIX::read( $read, $buf, 5 );
1073
1074 See also L<perlfunc/pipe>.
1075
1076 =item C<pow>
1077
1078 Computes C<$x> raised to the power C<$exponent>.
1079
1080         $ret = POSIX::pow( $x, $exponent );
1081
1082 You can also use the C<**> operator, see L<perlop>.
1083
1084 =item C<printf>
1085
1086 Formats and prints the specified arguments to STDOUT.
1087 See also L<perlfunc/printf>.
1088
1089 =item C<putc>
1090
1091 C<putc()> is C-specific, see L<perlfunc/print> instead.
1092
1093 =item C<putchar>
1094
1095 C<putchar()> is C-specific, see L<perlfunc/print> instead.
1096
1097 =item C<puts>
1098
1099 C<puts()> is C-specific, see L<perlfunc/print> instead.
1100
1101 =item C<qsort>
1102
1103 C<qsort()> is C-specific, see L<perlfunc/sort> instead.
1104
1105 =item C<raise>
1106
1107 Sends the specified signal to the current process.
1108 See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
1109
1110 =item C<rand>
1111
1112 C<rand()> is non-portable, see L<perlfunc/rand> instead.
1113
1114 =item C<read>
1115
1116 Read from a file.  This uses file descriptors such as those obtained by
1117 calling C<POSIX::open>.  If the buffer C<$buf> is not large enough for the
1118 read then Perl will extend it to make room for the request.
1119
1120         $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1121         $bytes = POSIX::read( $fd, $buf, 3 );
1122
1123 Returns C<undef> on failure.
1124
1125 See also L<perlfunc/sysread>.
1126
1127 =item C<readdir>
1128
1129 This is identical to Perl's builtin C<readdir()> function
1130 for reading directory entries, see L<perlfunc/readdir>.
1131
1132 =item C<realloc>
1133
1134 C<realloc()> is C-specific.  Perl does memory management transparently.
1135
1136 =item C<remove>
1137
1138 This is identical to Perl's builtin C<unlink()> function
1139 for removing files, see L<perlfunc/unlink>.
1140
1141 =item C<rename>
1142
1143 This is identical to Perl's builtin C<rename()> function
1144 for renaming files, see L<perlfunc/rename>.
1145
1146 =item C<rewind>
1147
1148 Seeks to the beginning of the file.
1149
1150 =item C<rewinddir>
1151
1152 This is identical to Perl's builtin C<rewinddir()> function for
1153 rewinding directory entry streams, see L<perlfunc/rewinddir>.
1154
1155 =item C<rmdir>
1156
1157 This is identical to Perl's builtin C<rmdir()> function
1158 for removing (empty) directories, see L<perlfunc/rmdir>.
1159
1160 =item C<scanf>
1161
1162 C<scanf()> is C-specific, use E<lt>E<gt> and regular expressions instead,
1163 see L<perlre>.
1164
1165 =item C<setgid>
1166
1167 Sets the real group identifier and the effective group identifier for
1168 this process.  Similar to assigning a value to the Perl's builtin
1169 C<$)> variable, see L<perlvar/$EGID>, except that the latter
1170 will change only the real user identifier, and that the setgid()
1171 uses only a single numeric argument, as opposed to a space-separated
1172 list of numbers.
1173
1174 =item C<setjmp>
1175
1176 C<setjmp()> is C-specific: use C<eval {}> instead,
1177 see L<perlfunc/eval>.
1178
1179 =item C<setlocale>
1180
1181 Modifies and queries the program's underlying locale.  Users of this
1182 function should read L<perllocale>, whch provides a comprehensive
1183 discussion of Perl locale handling, knowledge of which is necessary to
1184 properly use this function.  It contains
1185 L<a section devoted to this function|perllocale/The setlocale function>.
1186 The discussion here is merely a summary reference for C<setlocale()>.
1187 Note that Perl itself is almost entirely unaffected by the locale
1188 except within the scope of S<C<"use locale">>.  (Exceptions are listed
1189 in L<perllocale/Not within the scope of any "use locale" variant>.)
1190
1191 The following examples assume
1192
1193         use POSIX qw(setlocale LC_ALL LC_CTYPE);
1194
1195 has been issued.
1196
1197 The following will set the traditional UNIX system locale behavior
1198 (the second argument C<"C">).
1199
1200         $loc = setlocale( LC_ALL, "C" );
1201
1202 The following will query the current C<LC_CTYPE> category.  (No second
1203 argument means 'query'.)
1204
1205         $loc = setlocale( LC_CTYPE );
1206
1207 The following will set the C<LC_CTYPE> behaviour according to the locale
1208 environment variables (the second argument C<"">).
1209 Please see your system's C<setlocale(3)> documentation for the locale
1210 environment variables' meaning or consult L<perllocale>.
1211
1212         $loc = setlocale( LC_CTYPE, "" );
1213
1214 The following will set the C<LC_COLLATE> behaviour to Argentinian
1215 Spanish. B<NOTE>: The naming and availability of locales depends on
1216 your operating system. Please consult L<perllocale> for how to find
1217 out which locales are available in your system.
1218
1219         $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
1220
1221 =item C<setpgid>
1222
1223 This is similar to the C function C<setpgid()> for
1224 setting the process group identifier of the current process.
1225
1226 Returns C<undef> on failure.
1227
1228 =item C<setsid>
1229
1230 This is identical to the C function C<setsid()> for
1231 setting the session identifier of the current process.
1232
1233 =item C<setuid>
1234
1235 Sets the real user identifier and the effective user identifier for
1236 this process.  Similar to assigning a value to the Perl's builtin
1237 C<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
1238 will change only the real user identifier.
1239
1240 =item C<sigaction>
1241
1242 Detailed signal management.  This uses C<POSIX::SigAction> objects for
1243 the C<action> and C<oldaction> arguments (the oldaction can also be
1244 just a hash reference).  Consult your system's C<sigaction> manpage
1245 for details, see also C<POSIX::SigRt>.
1246
1247 Synopsis:
1248
1249         sigaction(signal, action, oldaction = 0)
1250
1251 Returns C<undef> on failure.  The C<signal> must be a number (like
1252 C<SIGHUP>), not a string (like C<"SIGHUP">), though Perl does try hard
1253 to understand you.
1254
1255 If you use the C<SA_SIGINFO> flag, the signal handler will in addition to
1256 the first argument, the signal name, also receive a second argument, a
1257 hash reference, inside which are the following keys with the following
1258 semantics, as defined by POSIX/SUSv3:
1259
1260     signo       the signal number
1261     errno       the error number
1262     code        if this is zero or less, the signal was sent by
1263                 a user process and the uid and pid make sense,
1264                 otherwise the signal was sent by the kernel
1265
1266 The following are also defined by POSIX/SUSv3, but unfortunately
1267 not very widely implemented:
1268
1269     pid         the process id generating the signal
1270     uid         the uid of the process id generating the signal
1271     status      exit value or signal for SIGCHLD
1272     band        band event for SIGPOLL
1273
1274 A third argument is also passed to the handler, which contains a copy
1275 of the raw binary contents of the C<siginfo> structure: if a system has
1276 some non-POSIX fields, this third argument is where to C<unpack()> them
1277 from.
1278
1279 Note that not all C<siginfo> values make sense simultaneously (some are
1280 valid only for certain signals, for example), and not all values make
1281 sense from Perl perspective, you should to consult your system's
1282 C<sigaction> and possibly also C<siginfo> documentation.
1283
1284 =item C<siglongjmp>
1285
1286 C<siglongjmp()> is C-specific: use L<perlfunc/die> instead.
1287
1288 =item C<sigpending>
1289
1290 Examine signals that are blocked and pending.  This uses C<POSIX::SigSet>
1291 objects for the C<sigset> argument.  Consult your system's C<sigpending>
1292 manpage for details.
1293
1294 Synopsis:
1295
1296         sigpending(sigset)
1297
1298 Returns C<undef> on failure.
1299
1300 =item C<sigprocmask>
1301
1302 Change and/or examine calling process's signal mask.  This uses
1303 C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
1304 Consult your system's C<sigprocmask> manpage for details.
1305
1306 Synopsis:
1307
1308         sigprocmask(how, sigset, oldsigset = 0)
1309
1310 Returns C<undef> on failure.
1311
1312 Note that you can't reliably block or unblock a signal from its own signal
1313 handler if you're using safe signals. Other signals can be blocked or unblocked
1314 reliably.
1315
1316 =item C<sigsetjmp>
1317
1318 C<sigsetjmp()> is C-specific: use C<eval {}> instead,
1319 see L<perlfunc/eval>.
1320
1321 =item C<sigsuspend>
1322
1323 Install a signal mask and suspend process until signal arrives.  This uses
1324 C<POSIX::SigSet> objects for the C<signal_mask> argument.  Consult your
1325 system's C<sigsuspend> manpage for details.
1326
1327 Synopsis:
1328
1329         sigsuspend(signal_mask)
1330
1331 Returns C<undef> on failure.
1332
1333 =item C<sin>
1334
1335 This is identical to Perl's builtin C<sin()> function
1336 for returning the sine of the numerical argument,
1337 see L<perlfunc/sin>.  See also L<Math::Trig>.
1338
1339 =item C<sinh>
1340
1341 This is identical to the C function C<sinh()>
1342 for returning the hyperbolic sine of the numerical argument.
1343 See also L<Math::Trig>.
1344
1345 =item C<sleep>
1346
1347 This is functionally identical to Perl's builtin C<sleep()> function
1348 for suspending the execution of the current for process for certain
1349 number of seconds, see L<perlfunc/sleep>.  There is one significant
1350 difference, however: C<POSIX::sleep()> returns the number of
1351 B<unslept> seconds, while the C<CORE::sleep()> returns the
1352 number of slept seconds.
1353
1354 =item C<sprintf>
1355
1356 This is similar to Perl's builtin C<sprintf()> function
1357 for returning a string that has the arguments formatted as requested,
1358 see L<perlfunc/sprintf>.
1359
1360 =item C<sqrt>
1361
1362 This is identical to Perl's builtin C<sqrt()> function.
1363 for returning the square root of the numerical argument,
1364 see L<perlfunc/sqrt>.
1365
1366 =item C<srand>
1367
1368 Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
1369
1370 =item C<sscanf>
1371
1372 C<sscanf()> is C-specific, use regular expressions instead,
1373 see L<perlre>.
1374
1375 =item C<stat>
1376
1377 This is identical to Perl's builtin C<stat()> function
1378 for returning information about files and directories.
1379
1380 =item C<strcat>
1381
1382 C<strcat()> is C-specific, use C<.=> instead, see L<perlop>.
1383
1384 =item C<strchr>
1385
1386 C<strchr()> is C-specific, see L<perlfunc/index> instead.
1387
1388 =item C<strcmp>
1389
1390 C<strcmp()> is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
1391
1392 =item C<strcoll>
1393
1394 This is identical to the C function C<strcoll()>
1395 for collating (comparing) strings transformed using
1396 the C<strxfrm()> function.  Not really needed since
1397 Perl can do this transparently, see L<perllocale>.
1398
1399 =item C<strcpy>
1400
1401 C<strcpy()> is C-specific, use C<=> instead, see L<perlop>.
1402
1403 =item C<strcspn>
1404
1405 C<strcspn()> is C-specific, use regular expressions instead,
1406 see L<perlre>.
1407
1408 =item C<strerror>
1409
1410 Returns the error string for the specified errno.
1411 Identical to the string form of the C<$!>, see L<perlvar/$ERRNO>.
1412
1413 =item C<strftime>
1414
1415 Convert date and time information to string.  Returns the string.
1416
1417 Synopsis:
1418
1419         strftime(fmt, sec, min, hour, mday, mon, year,
1420                  wday = -1, yday = -1, isdst = -1)
1421
1422 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
1423 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
1424 year (C<year>) is given in years since 1900.  I.e., the year 1995 is 95; the
1425 year 2001 is 101.  Consult your system's C<strftime()> manpage for details
1426 about these and the other arguments.
1427
1428 If you want your code to be portable, your format (C<fmt>) argument
1429 should use only the conversion specifiers defined by the ANSI C
1430 standard (C89, to play safe).  These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
1431 But even then, the B<results> of some of the conversion specifiers are
1432 non-portable.  For example, the specifiers C<aAbBcpZ> change according
1433 to the locale settings of the user, and both how to set locales (the
1434 locale names) and what output to expect are non-standard.
1435 The specifier C<c> changes according to the timezone settings of the
1436 user and the timezone computation rules of the operating system.
1437 The C<Z> specifier is notoriously unportable since the names of
1438 timezones are non-standard. Sticking to the numeric specifiers is the
1439 safest route.
1440
1441 The given arguments are made consistent as though by calling
1442 C<mktime()> before calling your system's C<strftime()> function,
1443 except that the C<isdst> value is not affected.
1444
1445 The string for Tuesday, December 12, 1995.
1446
1447         $str = POSIX::strftime( "%A, %B %d, %Y",
1448                                  0, 0, 0, 12, 11, 95, 2 );
1449         print "$str\n";
1450
1451 =item C<strlen>
1452
1453 C<strlen()> is C-specific, use C<length()> instead, see L<perlfunc/length>.
1454
1455 =item C<strncat>
1456
1457 C<strncat()> is C-specific, use C<.=> instead, see L<perlop>.
1458
1459 =item C<strncmp>
1460
1461 C<strncmp()> is C-specific, use C<eq> instead, see L<perlop>.
1462
1463 =item C<strncpy>
1464
1465 C<strncpy()> is C-specific, use C<=> instead, see L<perlop>.
1466
1467 =item C<strpbrk>
1468
1469 C<strpbrk()> is C-specific, use regular expressions instead,
1470 see L<perlre>.
1471
1472 =item C<strrchr>
1473
1474 C<strrchr()> is C-specific, see L<perlfunc/rindex> instead.
1475
1476 =item C<strspn>
1477
1478 C<strspn()> is C-specific, use regular expressions instead,
1479 see L<perlre>.
1480
1481 =item C<strstr>
1482
1483 This is identical to Perl's builtin C<index()> function,
1484 see L<perlfunc/index>.
1485
1486 =item C<strtod>
1487
1488 String to double translation. Returns the parsed number and the number
1489 of characters in the unparsed portion of the string.  Truly
1490 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1491 error, so clear C<$!> before calling strtod.  However, non-POSIX systems
1492 may not check for overflow, and therefore will never set C<$!>.
1493
1494 strtod respects any POSIX I<setlocale()> C<LC_TIME> settings,
1495 regardless of whether or not it is called from Perl code that is within
1496 the scope of S<C<use locale>>.
1497
1498 To parse a string C<$str> as a floating point number use
1499
1500     $! = 0;
1501     ($num, $n_unparsed) = POSIX::strtod($str);
1502
1503 The second returned item and C<$!> can be used to check for valid input:
1504
1505     if (($str eq '') || ($n_unparsed != 0) || $!) {
1506         die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
1507     }
1508
1509 When called in a scalar context strtod returns the parsed number.
1510
1511 =item C<strtok>
1512
1513 C<strtok()> is C-specific, use regular expressions instead, see
1514 L<perlre>, or L<perlfunc/split>.
1515
1516 =item C<strtol>
1517
1518 String to (long) integer translation.  Returns the parsed number and
1519 the number of characters in the unparsed portion of the string.  Truly
1520 POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1521 error, so clear C<$!> before calling C<strtol>.  However, non-POSIX systems
1522 may not check for overflow, and therefore will never set C<$!>.
1523
1524 C<strtol> should respect any POSIX I<setlocale()> settings.
1525
1526 To parse a string C<$str> as a number in some base C<$base> use
1527
1528     $! = 0;
1529     ($num, $n_unparsed) = POSIX::strtol($str, $base);
1530
1531 The base should be zero or between 2 and 36, inclusive.  When the base
1532 is zero or omitted strtol will use the string itself to determine the
1533 base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
1534 octal; any other leading characters mean decimal.  Thus, "1234" is
1535 parsed as a decimal number, "01234" as an octal number, and "0x1234"
1536 as a hexadecimal number.
1537
1538 The second returned item and C<$!> can be used to check for valid input:
1539
1540     if (($str eq '') || ($n_unparsed != 0) || !$!) {
1541         die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1542     }
1543
1544 When called in a scalar context strtol returns the parsed number.
1545
1546 =item C<strtoul>
1547
1548 String to unsigned (long) integer translation.  C<strtoul()> is identical
1549 to C<strtol()> except that C<strtoul()> only parses unsigned integers.  See
1550 L</strtol> for details.
1551
1552 Note: Some vendors supply C<strtod()> and C<strtol()> but not C<strtoul()>.
1553 Other vendors that do supply C<strtoul()> parse "-1" as a valid value.
1554
1555 =item C<strxfrm>
1556
1557 String transformation.  Returns the transformed string.
1558
1559         $dst = POSIX::strxfrm( $src );
1560
1561 Used in conjunction with the C<strcoll()> function, see L</strcoll>.
1562
1563 Not really needed since Perl can do this transparently, see
1564 L<perllocale>.
1565
1566 =item C<sysconf>
1567
1568 Retrieves values of system configurable variables.
1569
1570 The following will get the machine's clock speed.
1571
1572         $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1573
1574 Returns C<undef> on failure.
1575
1576 =item C<system>
1577
1578 This is identical to Perl's builtin C<system()> function, see
1579 L<perlfunc/system>.
1580
1581 =item C<tan>
1582
1583 This is identical to the C function C<tan()>, returning the
1584 tangent of the numerical argument.  See also L<Math::Trig>.
1585
1586 =item C<tanh>
1587
1588 This is identical to the C function C<tanh()>, returning the
1589 hyperbolic tangent of the numerical argument.   See also L<Math::Trig>.
1590
1591 =item C<tcdrain>
1592
1593 This is similar to the C function C<tcdrain()> for draining
1594 the output queue of its argument stream.
1595
1596 Returns C<undef> on failure.
1597
1598 =item C<tcflow>
1599
1600 This is similar to the C function C<tcflow()> for controlling
1601 the flow of its argument stream.
1602
1603 Returns C<undef> on failure.
1604
1605 =item C<tcflush>
1606
1607 This is similar to the C function C<tcflush()> for flushing
1608 the I/O buffers of its argument stream.
1609
1610 Returns C<undef> on failure.
1611
1612 =item C<tcgetpgrp>
1613
1614 This is identical to the C function C<tcgetpgrp()> for returning the
1615 process group identifier of the foreground process group of the controlling
1616 terminal.
1617
1618 =item C<tcsendbreak>
1619
1620 This is similar to the C function C<tcsendbreak()> for sending
1621 a break on its argument stream.
1622
1623 Returns C<undef> on failure.
1624
1625 =item C<tcsetpgrp>
1626
1627 This is similar to the C function C<tcsetpgrp()> for setting the
1628 process group identifier of the foreground process group of the controlling
1629 terminal.
1630
1631 Returns C<undef> on failure.
1632
1633 =item C<time>
1634
1635 This is identical to Perl's builtin C<time()> function
1636 for returning the number of seconds since the epoch
1637 (whatever it is for the system), see L<perlfunc/time>.
1638
1639 =item C<times>
1640
1641 The C<times()> function returns elapsed realtime since some point in the past
1642 (such as system startup), user and system times for this process, and user
1643 and system times used by child processes.  All times are returned in clock
1644 ticks.
1645
1646     ($realtime, $user, $system, $cuser, $csystem) 
1647         = POSIX::times();
1648
1649 Note: Perl's builtin C<times()> function returns four values, measured in
1650 seconds.
1651
1652 =item C<tmpfile>
1653
1654 Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
1655
1656 =item C<tmpnam>
1657
1658 Returns a name for a temporary file.
1659
1660         $tmpfile = POSIX::tmpnam();
1661
1662 For security reasons, which are probably detailed in your system's
1663 documentation for the C library C<tmpnam()> function, this interface
1664 should not be used; instead see L<File::Temp>.
1665
1666 =item C<tolower>
1667
1668 This is identical to the C function, except that it can apply to a single
1669 character or to a whole string.  Consider using the C<lc()> function,
1670 see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
1671 strings.
1672
1673 =item C<toupper>
1674
1675 This is identical to the C function, except that it can apply to a single
1676 character or to a whole string.  Consider using the C<uc()> function,
1677 see L<perlfunc/uc>, or the equivalent C<\U> operator inside doublequotish
1678 strings.
1679
1680 =item C<ttyname>
1681
1682 This is identical to the C function C<ttyname()> for returning the
1683 name of the current terminal.
1684
1685 =item C<tzname>
1686
1687 Retrieves the time conversion information from the C<tzname> variable.
1688
1689         POSIX::tzset();
1690         ($std, $dst) = POSIX::tzname();
1691
1692 =item C<tzset>
1693
1694 This is identical to the C function C<tzset()> for setting
1695 the current timezone based on the environment variable C<TZ>,
1696 to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
1697 functions.
1698
1699 =item C<umask>
1700
1701 This is identical to Perl's builtin C<umask()> function
1702 for setting (and querying) the file creation permission mask,
1703 see L<perlfunc/umask>.
1704
1705 =item C<uname>
1706
1707 Get name of current operating system.
1708
1709         ($sysname, $nodename, $release, $version, $machine)
1710                 = POSIX::uname();
1711
1712 Note that the actual meanings of the various fields are not
1713 that well standardized, do not expect any great portability.
1714 The C<$sysname> might be the name of the operating system,
1715 the C<$nodename> might be the name of the host, the C<$release>
1716 might be the (major) release number of the operating system,
1717 the C<$version> might be the (minor) release number of the
1718 operating system, and the C<$machine> might be a hardware identifier.
1719 Maybe.
1720
1721 =item C<ungetc>
1722
1723 Use method C<IO::Handle::ungetc()> instead.
1724
1725 =item C<unlink>
1726
1727 This is identical to Perl's builtin C<unlink()> function
1728 for removing files, see L<perlfunc/unlink>.
1729
1730 =item C<utime>
1731
1732 This is identical to Perl's builtin C<utime()> function
1733 for changing the time stamps of files and directories,
1734 see L<perlfunc/utime>.
1735
1736 =item C<vfprintf>
1737
1738 C<vfprintf()> is C-specific, see L<perlfunc/printf> instead.
1739
1740 =item C<vprintf>
1741
1742 C<vprintf()> is C-specific, see L<perlfunc/printf> instead.
1743
1744 =item C<vsprintf>
1745
1746 C<vsprintf()> is C-specific, see L<perlfunc/sprintf> instead.
1747
1748 =item C<wait>
1749
1750 This is identical to Perl's builtin C<wait()> function,
1751 see L<perlfunc/wait>.
1752
1753 =item C<waitpid>
1754
1755 Wait for a child process to change state.  This is identical to Perl's
1756 builtin C<waitpid()> function, see L<perlfunc/waitpid>.
1757
1758         $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
1759         print "status = ", ($? / 256), "\n";
1760
1761 =item C<wcstombs>
1762
1763 This is identical to the C function C<wcstombs()>.
1764 Perl does not have any support for the wide and multibyte
1765 characters of the C standards, so this might be a rather
1766 useless function.
1767
1768 =item C<wctomb>
1769
1770 This is identical to the C function C<wctomb()>.
1771 Perl does not have any support for the wide and multibyte
1772 characters of the C standards, so this might be a rather
1773 useless function.
1774
1775 =item C<write>
1776
1777 Write to a file.  This uses file descriptors such as those obtained by
1778 calling C<POSIX::open>.
1779
1780         $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
1781         $buf = "hello";
1782         $bytes = POSIX::write( $fd, $buf, 5 );
1783
1784 Returns C<undef> on failure.
1785
1786 See also L<perlfunc/syswrite>.
1787
1788 =back
1789
1790 =head1 CLASSES
1791
1792 =head2 C<POSIX::SigAction>
1793
1794 =over 8
1795
1796 =item C<new>
1797
1798 Creates a new C<POSIX::SigAction> object which corresponds to the C
1799 C<struct sigaction>.  This object will be destroyed automatically when
1800 it is no longer needed.  The first parameter is the handler, a sub
1801 reference.  The second parameter is a C<POSIX::SigSet> object, it
1802 defaults to the empty set.  The third parameter contains the
1803 C<sa_flags>, it defaults to 0.
1804
1805         $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
1806         $sigaction = POSIX::SigAction->new(
1807                         \&handler, $sigset, &POSIX::SA_NOCLDSTOP
1808                      );
1809
1810 This C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
1811 function.
1812
1813 =back
1814
1815 =over 8
1816
1817 =item C<handler>
1818
1819 =item C<mask>
1820
1821 =item C<flags>
1822
1823 accessor functions to get/set the values of a SigAction object.
1824
1825         $sigset = $sigaction->mask;
1826         $sigaction->flags(&POSIX::SA_RESTART);
1827
1828 =item C<safe>
1829
1830 accessor function for the "safe signals" flag of a SigAction object; see
1831 L<perlipc> for general information on safe (a.k.a. "deferred") signals.  If
1832 you wish to handle a signal safely, use this accessor to set the "safe" flag
1833 in the C<POSIX::SigAction> object:
1834
1835         $sigaction->safe(1);
1836
1837 You may also examine the "safe" flag on the output action object which is
1838 filled in when given as the third parameter to C<POSIX::sigaction()>:
1839
1840         sigaction(SIGINT, $new_action, $old_action);
1841         if ($old_action->safe) {
1842             # previous SIGINT handler used safe signals
1843         }
1844
1845 =back
1846
1847 =head2 C<POSIX::SigRt>
1848
1849 =over 8
1850
1851 =item C<%SIGRT>
1852
1853 A hash of the POSIX realtime signal handlers.  It is an extension of
1854 the standard C<%SIG>, the C<$POSIX::SIGRT{SIGRTMIN}> is roughly equivalent
1855 to C<$SIG{SIGRTMIN}>, but the right POSIX moves (see below) are made with
1856 the C<POSIX::SigSet> and C<POSIX::sigaction> instead of accessing the C<%SIG>.
1857
1858 You can set the C<%POSIX::SIGRT> elements to set the POSIX realtime
1859 signal handlers, use C<delete> and C<exists> on the elements, and use
1860 C<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
1861 signals there are available S<C<(SIGRTMAX - SIGRTMIN + 1>>, the C<SIGRTMAX> is
1862 a valid POSIX realtime signal).
1863
1864 Setting the C<%SIGRT> elements is equivalent to calling this:
1865
1866   sub new {
1867     my ($rtsig, $handler, $flags) = @_;
1868     my $sigset = POSIX::SigSet($rtsig);
1869     my $sigact = POSIX::SigAction->new($handler,$sigset,$flags);
1870     sigaction($rtsig, $sigact);
1871   }
1872
1873 The flags default to zero, if you want something different you can
1874 either use C<local> on C<$POSIX::SigRt::SIGACTION_FLAGS>, or you can
1875 derive from POSIX::SigRt and define your own C<new()> (the tied hash
1876 STORE method of the C<%SIGRT> calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
1877 where the C<$rtsig> ranges from zero to S<C<SIGRTMAX - SIGRTMIN + 1)>>.
1878
1879 Just as with any signal, you can use C<sigaction($rtsig, undef, $oa)> to
1880 retrieve the installed signal handler (or, rather, the signal action).
1881
1882 B<NOTE:> whether POSIX realtime signals really work in your system, or
1883 whether Perl has been compiled so that it works with them, is outside
1884 of this discussion.
1885
1886 =item C<SIGRTMIN>
1887
1888 Return the minimum POSIX realtime signal number available, or C<undef>
1889 if no POSIX realtime signals are available.
1890
1891 =item C<SIGRTMAX>
1892
1893 Return the maximum POSIX realtime signal number available, or C<undef>
1894 if no POSIX realtime signals are available.
1895
1896 =back
1897
1898 =head2 C<POSIX::SigSet>
1899
1900 =over 8
1901
1902 =item C<new>
1903
1904 Create a new SigSet object.  This object will be destroyed automatically
1905 when it is no longer needed.  Arguments may be supplied to initialize the
1906 set.
1907
1908 Create an empty set.
1909
1910         $sigset = POSIX::SigSet->new;
1911
1912 Create a set with C<SIGUSR1>.
1913
1914         $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
1915
1916 =item C<addset>
1917
1918 Add a signal to a SigSet object.
1919
1920         $sigset->addset( &POSIX::SIGUSR2 );
1921
1922 Returns C<undef> on failure.
1923
1924 =item C<delset>
1925
1926 Remove a signal from the SigSet object.
1927
1928         $sigset->delset( &POSIX::SIGUSR2 );
1929
1930 Returns C<undef> on failure.
1931
1932 =item C<emptyset>
1933
1934 Initialize the SigSet object to be empty.
1935
1936         $sigset->emptyset();
1937
1938 Returns C<undef> on failure.
1939
1940 =item C<fillset>
1941
1942 Initialize the SigSet object to include all signals.
1943
1944         $sigset->fillset();
1945
1946 Returns C<undef> on failure.
1947
1948 =item C<ismember>
1949
1950 Tests the SigSet object to see if it contains a specific signal.
1951
1952         if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
1953                 print "contains SIGUSR1\n";
1954         }
1955
1956 =back
1957
1958 =head2 C<POSIX::Termios>
1959
1960 =over 8
1961
1962 =item C<new>
1963
1964 Create a new Termios object.  This object will be destroyed automatically
1965 when it is no longer needed.  A Termios object corresponds to the termios
1966 C struct.  C<new()> mallocs a new one, C<getattr()> fills it from a file descriptor,
1967 and C<setattr()> sets a file descriptor's parameters to match Termios' contents.
1968
1969         $termios = POSIX::Termios->new;
1970
1971 =item C<getattr>
1972
1973 Get terminal control attributes.
1974
1975 Obtain the attributes for stdin.
1976
1977         $termios->getattr( 0 ) # Recommended for clarity.
1978         $termios->getattr()
1979
1980 Obtain the attributes for stdout.
1981
1982         $termios->getattr( 1 )
1983
1984 Returns C<undef> on failure.
1985
1986 =item C<getcc>
1987
1988 Retrieve a value from the c_cc field of a termios object.  The c_cc field is
1989 an array so an index must be specified.
1990
1991         $c_cc[1] = $termios->getcc(1);
1992
1993 =item C<getcflag>
1994
1995 Retrieve the c_cflag field of a termios object.
1996
1997         $c_cflag = $termios->getcflag;
1998
1999 =item C<getiflag>
2000
2001 Retrieve the c_iflag field of a termios object.
2002
2003         $c_iflag = $termios->getiflag;
2004
2005 =item C<getispeed>
2006
2007 Retrieve the input baud rate.
2008
2009         $ispeed = $termios->getispeed;
2010
2011 =item C<getlflag>
2012
2013 Retrieve the c_lflag field of a termios object.
2014
2015         $c_lflag = $termios->getlflag;
2016
2017 =item C<getoflag>
2018
2019 Retrieve the c_oflag field of a termios object.
2020
2021         $c_oflag = $termios->getoflag;
2022
2023 =item C<getospeed>
2024
2025 Retrieve the output baud rate.
2026
2027         $ospeed = $termios->getospeed;
2028
2029 =item C<setattr>
2030
2031 Set terminal control attributes.
2032
2033 Set attributes immediately for stdout.
2034
2035         $termios->setattr( 1, &POSIX::TCSANOW );
2036
2037 Returns C<undef> on failure.
2038
2039 =item C<setcc>
2040
2041 Set a value in the c_cc field of a termios object.  The c_cc field is an
2042 array so an index must be specified.
2043
2044         $termios->setcc( &POSIX::VEOF, 1 );
2045
2046 =item C<setcflag>
2047
2048 Set the c_cflag field of a termios object.
2049
2050         $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
2051
2052 =item C<setiflag>
2053
2054 Set the c_iflag field of a termios object.
2055
2056         $termios->setiflag( $c_iflag | &POSIX::BRKINT );
2057
2058 =item C<setispeed>
2059
2060 Set the input baud rate.
2061
2062         $termios->setispeed( &POSIX::B9600 );
2063
2064 Returns C<undef> on failure.
2065
2066 =item C<setlflag>
2067
2068 Set the c_lflag field of a termios object.
2069
2070         $termios->setlflag( $c_lflag | &POSIX::ECHO );
2071
2072 =item C<setoflag>
2073
2074 Set the c_oflag field of a termios object.
2075
2076         $termios->setoflag( $c_oflag | &POSIX::OPOST );
2077
2078 =item C<setospeed>
2079
2080 Set the output baud rate.
2081
2082         $termios->setospeed( &POSIX::B9600 );
2083
2084 Returns C<undef> on failure.
2085
2086 =item Baud rate values
2087
2088 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>
2089
2090 =item Terminal interface values
2091
2092 C<TCSADRAIN> C<TCSANOW> C<TCOON> C<TCIOFLUSH> C<TCOFLUSH> C<TCION> C<TCIFLUSH> C<TCSAFLUSH> C<TCIOFF> C<TCOOFF>
2093
2094 =item C<c_cc> field values
2095
2096 C<VEOF> C<VEOL> C<VERASE> C<VINTR> C<VKILL> C<VQUIT> C<VSUSP> C<VSTART> C<VSTOP> C<VMIN> C<VTIME> C<NCCS>
2097
2098 =item C<c_cflag> field values
2099
2100 C<CLOCAL> C<CREAD> C<CSIZE> C<CS5> C<CS6> C<CS7> C<CS8> C<CSTOPB> C<HUPCL> C<PARENB> C<PARODD>
2101
2102 =item C<c_iflag> field values
2103
2104 C<BRKINT> C<ICRNL> C<IGNBRK> C<IGNCR> C<IGNPAR> C<INLCR> C<INPCK> C<ISTRIP> C<IXOFF> C<IXON> C<PARMRK>
2105
2106 =item C<c_lflag> field values
2107
2108 C<ECHO> C<ECHOE> C<ECHOK> C<ECHONL> C<ICANON> C<IEXTEN> C<ISIG> C<NOFLSH> C<TOSTOP>
2109
2110 =item C<c_oflag> field values
2111
2112 C<OPOST>
2113
2114 =back
2115
2116 =head1 PATHNAME CONSTANTS
2117
2118 =over 8
2119
2120 =item Constants
2121
2122 C<_PC_CHOWN_RESTRICTED> C<_PC_LINK_MAX> C<_PC_MAX_CANON> C<_PC_MAX_INPUT> C<_PC_NAME_MAX>
2123 C<_PC_NO_TRUNC> C<_PC_PATH_MAX> C<_PC_PIPE_BUF> C<_PC_VDISABLE>
2124
2125 =back
2126
2127 =head1 POSIX CONSTANTS
2128
2129 =over 8
2130
2131 =item Constants
2132
2133 C<_POSIX_ARG_MAX> C<_POSIX_CHILD_MAX> C<_POSIX_CHOWN_RESTRICTED> C<_POSIX_JOB_CONTROL>
2134 C<_POSIX_LINK_MAX> C<_POSIX_MAX_CANON> C<_POSIX_MAX_INPUT> C<_POSIX_NAME_MAX>
2135 C<_POSIX_NGROUPS_MAX> C<_POSIX_NO_TRUNC> C<_POSIX_OPEN_MAX> C<_POSIX_PATH_MAX>
2136 C<_POSIX_PIPE_BUF> C<_POSIX_SAVED_IDS> C<_POSIX_SSIZE_MAX> C<_POSIX_STREAM_MAX>
2137 C<_POSIX_TZNAME_MAX> C<_POSIX_VDISABLE> C<_POSIX_VERSION>
2138
2139 =back
2140
2141 =head1 SYSTEM CONFIGURATION
2142
2143 =over 8
2144
2145 =item Constants
2146
2147 C<_SC_ARG_MAX> C<_SC_CHILD_MAX> C<_SC_CLK_TCK> C<_SC_JOB_CONTROL> C<_SC_NGROUPS_MAX>
2148 C<_SC_OPEN_MAX> C<_SC_PAGESIZE> C<_SC_SAVED_IDS> C<_SC_STREAM_MAX> C<_SC_TZNAME_MAX>
2149 C<_SC_VERSION>
2150
2151 =back
2152
2153 =head1 ERRNO
2154
2155 =over 8
2156
2157 =item Constants
2158
2159 C<E2BIG> C<EACCES> C<EADDRINUSE> C<EADDRNOTAVAIL> C<EAFNOSUPPORT> C<EAGAIN> C<EALREADY> C<EBADF> C<EBADMSG>
2160 C<EBUSY> C<ECANCELED> C<ECHILD> C<ECONNABORTED> C<ECONNREFUSED> C<ECONNRESET> C<EDEADLK> C<EDESTADDRREQ>
2161 C<EDOM> C<EDQUOT> C<EEXIST> C<EFAULT> C<EFBIG> C<EHOSTDOWN> C<EHOSTUNREACH> C<EIDRM> C<EILSEQ> C<EINPROGRESS>
2162 C<EINTR> C<EINVAL> C<EIO> C<EISCONN> C<EISDIR> C<ELOOP> C<EMFILE> C<EMLINK> C<EMSGSIZE> C<ENAMETOOLONG>
2163 C<ENETDOWN> C<ENETRESET> C<ENETUNREACH> C<ENFILE> C<ENOBUFS> C<ENODATA> C<ENODEV> C<ENOENT> C<ENOEXEC>
2164 C<ENOLCK> C<ENOLINK> C<ENOMEM> C<ENOMSG> C<ENOPROTOOPT> C<ENOSPC> C<ENOSR> C<ENOSTR> C<ENOSYS> C<ENOTBLK>
2165 C<ENOTCONN> C<ENOTDIR> C<ENOTEMPTY> C<ENOTRECOVERABLE> C<ENOTSOCK> C<ENOTSUP> C<ENOTTY> C<ENXIO>
2166 C<EOPNOTSUPP> C<EOTHER> C<EOVERFLOW> C<EOWNERDEAD> C<EPERM> C<EPFNOSUPPORT> C<EPIPE> C<EPROCLIM> C<EPROTO>
2167 C<EPROTONOSUPPORT> C<EPROTOTYPE> C<ERANGE> C<EREMOTE> C<ERESTART> C<EROFS> C<ESHUTDOWN>
2168 C<ESOCKTNOSUPPORT> C<ESPIPE> C<ESRCH> C<ESTALE> C<ETIME> C<ETIMEDOUT> C<ETOOMANYREFS> C<ETXTBSY> C<EUSERS>
2169 C<EWOULDBLOCK> C<EXDEV>
2170
2171 =back
2172
2173 =head1 FCNTL
2174
2175 =over 8
2176
2177 =item Constants
2178
2179 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>
2180 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>
2181 C<O_RDONLY> C<O_RDWR> C<O_TRUNC> C<O_WRONLY>
2182
2183 =back
2184
2185 =head1 FLOAT
2186
2187 =over 8
2188
2189 =item Constants
2190
2191 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>
2192 C<DBL_MIN_10_EXP> C<DBL_MIN_EXP> C<FLT_DIG> C<FLT_EPSILON> C<FLT_MANT_DIG> C<FLT_MAX>
2193 C<FLT_MAX_10_EXP> C<FLT_MAX_EXP> C<FLT_MIN> C<FLT_MIN_10_EXP> C<FLT_MIN_EXP> C<FLT_RADIX>
2194 C<FLT_ROUNDS> C<LDBL_DIG> C<LDBL_EPSILON> C<LDBL_MANT_DIG> C<LDBL_MAX> C<LDBL_MAX_10_EXP>
2195 C<LDBL_MAX_EXP> C<LDBL_MIN> C<LDBL_MIN_10_EXP> C<LDBL_MIN_EXP>
2196
2197 =back
2198
2199 =head1 LIMITS
2200
2201 =over 8
2202
2203 =item Constants
2204
2205 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>
2206 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>
2207 C<PIPE_BUF> C<SCHAR_MAX> C<SCHAR_MIN> C<SHRT_MAX> C<SHRT_MIN> C<SSIZE_MAX> C<STREAM_MAX> C<TZNAME_MAX>
2208 C<UCHAR_MAX> C<UINT_MAX> C<ULONG_MAX> C<USHRT_MAX>
2209
2210 =back
2211
2212 =head1 LOCALE
2213
2214 =over 8
2215
2216 =item Constants
2217
2218 C<LC_ALL> C<LC_COLLATE> C<LC_CTYPE> C<LC_MONETARY> C<LC_NUMERIC> C<LC_TIME>
2219
2220 =back
2221
2222 =head1 MATH
2223
2224 =over 8
2225
2226 =item Constants
2227
2228 C<HUGE_VAL>
2229
2230 =back
2231
2232 =head1 SIGNAL
2233
2234 =over 8
2235
2236 =item Constants
2237
2238 C<SA_NOCLDSTOP> C<SA_NOCLDWAIT> C<SA_NODEFER> C<SA_ONSTACK> C<SA_RESETHAND> C<SA_RESTART>
2239 C<SA_SIGINFO> C<SIGABRT> C<SIGALRM> C<SIGCHLD> C<SIGCONT> C<SIGFPE> C<SIGHUP> C<SIGILL> C<SIGINT>
2240 C<SIGKILL> C<SIGPIPE> C<SIGQUIT> C<SIGSEGV> C<SIGSTOP> C<SIGTERM> C<SIGTSTP> C<SIGTTIN> C<SIGTTOU>
2241 C<SIGUSR1> C<SIGUSR2> C<SIG_BLOCK> C<SIG_DFL> C<SIG_ERR> C<SIG_IGN> C<SIG_SETMASK>
2242 C<SIG_UNBLOCK>
2243
2244 =back
2245
2246 =head1 STAT
2247
2248 =over 8
2249
2250 =item Constants
2251
2252 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>
2253 C<S_IWUSR> C<S_IXGRP> C<S_IXOTH> C<S_IXUSR>
2254
2255 =item Macros
2256
2257 C<S_ISBLK> C<S_ISCHR> C<S_ISDIR> C<S_ISFIFO> C<S_ISREG>
2258
2259 =back
2260
2261 =head1 STDLIB
2262
2263 =over 8
2264
2265 =item Constants
2266
2267 C<EXIT_FAILURE> C<EXIT_SUCCESS> C<MB_CUR_MAX> C<RAND_MAX>
2268
2269 =back
2270
2271 =head1 STDIO
2272
2273 =over 8
2274
2275 =item Constants
2276
2277 C<BUFSIZ> C<EOF> C<FILENAME_MAX> C<L_ctermid> C<L_cuserid> C<L_tmpname> C<TMP_MAX>
2278
2279 =back
2280
2281 =head1 TIME
2282
2283 =over 8
2284
2285 =item Constants
2286
2287 C<CLK_TCK> C<CLOCKS_PER_SEC>
2288
2289 =back
2290
2291 =head1 UNISTD
2292
2293 =over 8
2294
2295 =item Constants
2296
2297 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>
2298
2299 =back
2300
2301 =head1 WAIT
2302
2303 =over 8
2304
2305 =item Constants
2306
2307 C<WNOHANG> C<WUNTRACED>
2308
2309 =over 16
2310
2311 =item C<WNOHANG>
2312
2313 Do not suspend the calling process until a child process
2314 changes state but instead return immediately.
2315
2316 =item C<WUNTRACED>
2317
2318 Catch stopped child processes.
2319
2320 =back
2321
2322 =item Macros
2323
2324 C<WIFEXITED> C<WEXITSTATUS> C<WIFSIGNALED> C<WTERMSIG> C<WIFSTOPPED> C<WSTOPSIG>
2325
2326 =over 16
2327
2328 =item C<WIFEXITED>
2329
2330 C<WIFEXITED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2331 exited normally (C<exit()> or by falling off the end of C<main()>)
2332
2333 =item C<WEXITSTATUS>
2334
2335 C<WEXITSTATUS(${^CHILD_ERROR_NATIVE})> returns the normal exit status of
2336 the child process (only meaningful if C<WIFEXITED(${^CHILD_ERROR_NATIVE})>
2337 is true)
2338
2339 =item C<WIFSIGNALED>
2340
2341 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2342 terminated because of a signal
2343
2344 =item C<WTERMSIG>
2345
2346 C<WTERMSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2347 terminated for (only meaningful if
2348 C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})>
2349 is true)
2350
2351 =item C<WIFSTOPPED>
2352
2353 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})> returns true if the child process is
2354 currently stopped (can happen only if you specified the WUNTRACED flag
2355 to C<waitpid()>)
2356
2357 =item C<WSTOPSIG>
2358
2359 C<WSTOPSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2360 was stopped for (only meaningful if
2361 C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})>
2362 is true)
2363
2364 =back
2365
2366 =back
2367