xref: /openbsd/gnu/usr.bin/perl/ext/POSIX/lib/POSIX.pod (revision e0680481)
1898184e3Ssthen=head1 NAME
2898184e3Ssthen
3898184e3SsthenPOSIX - Perl interface to IEEE Std 1003.1
4898184e3Ssthen
5898184e3Ssthen=head1 SYNOPSIS
6898184e3Ssthen
7898184e3Ssthen    use POSIX ();
8898184e3Ssthen    use POSIX qw(setsid);
9898184e3Ssthen    use POSIX qw(:errno_h :fcntl_h);
10898184e3Ssthen
11898184e3Ssthen    printf "EINTR is %d\n", EINTR;
12898184e3Ssthen
13*e0680481Safresh1    my $sess_id = POSIX::setsid();
14898184e3Ssthen
15*e0680481Safresh1    my $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
16898184e3Ssthen	# note: that's a filedescriptor, *NOT* a filehandle
17898184e3Ssthen
18898184e3Ssthen=head1 DESCRIPTION
19898184e3Ssthen
20898184e3SsthenThe POSIX module permits you to access all (or nearly all) the standard
21898184e3SsthenPOSIX 1003.1 identifiers.  Many of these identifiers have been given Perl-ish
22898184e3Sstheninterfaces.
23898184e3Ssthen
24898184e3SsthenThis document gives a condensed list of the features available in the POSIX
25898184e3Ssthenmodule.  Consult your operating system's manpages for general information on
26898184e3Ssthenmost features.  Consult L<perlfunc> for functions which are noted as being
279f11ffb7Safresh1identical or almost identical to Perl's builtin functions.
28898184e3Ssthen
29898184e3SsthenThe first section describes POSIX functions from the 1003.1 specification.
30898184e3SsthenThe second section describes some classes for signal objects, TTY objects,
31898184e3Ssthenand other miscellaneous objects.  The remaining sections list various
32898184e3Ssthenconstants and macros in an organization which roughly follows IEEE Std
33898184e3Ssthen1003.1b-1993.
34898184e3Ssthen
35eac174f2Safresh1The notation C<[C99]> indicates functions that were added in the ISO/IEC
36eac174f2Safresh19899:1999 version of the C language standard.  Some may not be available
37eac174f2Safresh1on your system if it adheres to an earlier standard.  Attempts to use
38eac174f2Safresh1any missing one will result in a fatal runtime error message.
39eac174f2Safresh1
40898184e3Ssthen=head1 CAVEATS
41898184e3Ssthen
42b8851fccSafresh1I<Everything is exported by default> (with a handful of exceptions).
43b8851fccSafresh1This is an unfortunate backwards compatibility feature and its use is
44b8851fccSafresh1B<strongly L<discouraged|perlpolicy/discouraged>>.
45b8851fccSafresh1You should either prevent the exporting (by saying S<C<use POSIX ();>>,
46b8851fccSafresh1as usual) and then use fully qualified names (e.g. C<POSIX::SEEK_END>),
47b8851fccSafresh1or give an explicit import list.
48b8851fccSafresh1If you do neither and opt for the default (as in S<C<use POSIX;>>), you
49b8851fccSafresh1will import I<hundreds and hundreds> of symbols into your namespace.
50b8851fccSafresh1
51898184e3SsthenA few functions are not implemented because they are C specific.  If you
52898184e3Ssthenattempt to call these, they will print a message telling you that they
53e5157e49Safresh1aren't implemented, and suggest using the Perl equivalent, should one
54e5157e49Safresh1exist.  For example, trying to access the C<setjmp()> call will elicit the
55e5157e49Safresh1message "C<setjmp() is C-specific: use eval {} instead>".
56898184e3Ssthen
57898184e3SsthenFurthermore, some evil vendors will claim 1003.1 compliance, but in fact
58898184e3Ssthenare not so: they will not pass the PCTS (POSIX Compliance Test Suites).
59e5157e49Safresh1For example, one vendor may not define C<EDEADLK>, or the semantics of the
60e5157e49Safresh1errno values set by C<open(2)> might not be quite right.  Perl does not
61898184e3Ssthenattempt to verify POSIX compliance.  That means you can currently
62898184e3Ssthensuccessfully say "use POSIX",  and then later in your program you find
63e5157e49Safresh1that your vendor has been lax and there's no usable C<ICANON> macro after
64898184e3Ssthenall.  This could be construed to be a bug.
65898184e3Ssthen
66898184e3Ssthen=head1 FUNCTIONS
67898184e3Ssthen
68898184e3Ssthen=over 8
69898184e3Ssthen
70e5157e49Safresh1=item C<_exit>
71898184e3Ssthen
72898184e3SsthenThis is identical to the C function C<_exit()>.  It exits the program
73898184e3Ssthenimmediately which means among other things buffered I/O is B<not> flushed.
74898184e3Ssthen
75898184e3SsthenNote that when using threads and in Linux this is B<not> a good way to
76898184e3Ssthenexit a thread because in Linux processes and threads are kind of the
77898184e3Ssthensame thing (Note: while this is the situation in early 2003 there are
78898184e3Ssthenprojects under way to have threads with more POSIXly semantics in Linux).
79898184e3SsthenIf you want not to return from a thread, detach the thread.
80898184e3Ssthen
81e5157e49Safresh1=item C<abort>
82898184e3Ssthen
83898184e3SsthenThis is identical to the C function C<abort()>.  It terminates the
84898184e3Ssthenprocess with a C<SIGABRT> signal unless caught by a signal handler or
85898184e3Ssthenif the handler does not return normally (it e.g.  does a C<longjmp>).
86898184e3Ssthen
87e5157e49Safresh1=item C<abs>
88898184e3Ssthen
899f11ffb7Safresh1This is identical to Perl's builtin C<abs()> function, returning the absolute
909f11ffb7Safresh1value of its numerical argument (except that C<POSIX::abs()> must be provided
919f11ffb7Safresh1an explicit value (rather than relying on an implicit C<$_>):
929f11ffb7Safresh1
939f11ffb7Safresh1    $absolute_value = POSIX::abs(42);   # good
949f11ffb7Safresh1
959f11ffb7Safresh1    $absolute_value = POSIX::abs();     # throws exception
96898184e3Ssthen
97e5157e49Safresh1=item C<access>
98898184e3Ssthen
99898184e3SsthenDetermines the accessibility of a file.
100898184e3Ssthen
101898184e3Ssthen	if( POSIX::access( "/", &POSIX::R_OK ) ){
102898184e3Ssthen		print "have read permission\n";
103898184e3Ssthen	}
104898184e3Ssthen
105898184e3SsthenReturns C<undef> on failure.  Note: do not use C<access()> for
106898184e3Ssthensecurity purposes.  Between the C<access()> call and the operation
107898184e3Ssthenyou are preparing for the permissions might change: a classic
108898184e3SsthenI<race condition>.
109898184e3Ssthen
110e5157e49Safresh1=item C<acos>
111898184e3Ssthen
112898184e3SsthenThis is identical to the C function C<acos()>, returning
113898184e3Ssthenthe arcus cosine of its numerical argument.  See also L<Math::Trig>.
114898184e3Ssthen
115b8851fccSafresh1=item C<acosh>
116b8851fccSafresh1
117b8851fccSafresh1This is identical to the C function C<acosh()>, returning the
118b8851fccSafresh1hyperbolic arcus cosine of its numerical argument [C99].  See also
119eac174f2Safresh1L<Math::Trig>.  Added in Perl v5.22.
120b8851fccSafresh1
121e5157e49Safresh1=item C<alarm>
122898184e3Ssthen
1239f11ffb7Safresh1This is identical to Perl's builtin C<alarm()> function, either for arming or
1249f11ffb7Safresh1disarming the C<SIGARLM> timer, except that C<POSIX::alarm()> must be provided
1259f11ffb7Safresh1an explicit value (rather than relying on an implicit C<$_>):
1269f11ffb7Safresh1
1279f11ffb7Safresh1    POSIX::alarm(3)     # good
1289f11ffb7Safresh1
1299f11ffb7Safresh1    POSIX::alarm()      # throws exception
130898184e3Ssthen
131e5157e49Safresh1=item C<asctime>
132898184e3Ssthen
133898184e3SsthenThis is identical to the C function C<asctime()>.  It returns
134898184e3Ssthena string of the form
135898184e3Ssthen
136898184e3Ssthen	"Fri Jun  2 18:22:13 2000\n\0"
137898184e3Ssthen
138898184e3Ssthenand it is called thusly
139898184e3Ssthen
140e5157e49Safresh1	$asctime = asctime($sec, $min, $hour, $mday, $mon,
141e5157e49Safresh1			   $year, $wday, $yday, $isdst);
142898184e3Ssthen
143898184e3SsthenThe C<$mon> is zero-based: January equals C<0>.  The C<$year> is
144898184e3Ssthen1900-based: 2001 equals C<101>.  C<$wday> and C<$yday> default to zero
145898184e3Ssthen(and are usually ignored anyway), and C<$isdst> defaults to -1.
146898184e3Ssthen
147eac174f2Safresh1Note the result is always in English.  Use C<L</strftime>> instead to
148eac174f2Safresh1get a result suitable for the current locale.  That function's C<%c>
149eac174f2Safresh1format yields the locale's preferred representation.
150eac174f2Safresh1
151e5157e49Safresh1=item C<asin>
152898184e3Ssthen
153898184e3SsthenThis is identical to the C function C<asin()>, returning
154898184e3Ssthenthe arcus sine of its numerical argument.  See also L<Math::Trig>.
155898184e3Ssthen
156b8851fccSafresh1=item C<asinh>
157b8851fccSafresh1
158b8851fccSafresh1This is identical to the C function C<asinh()>, returning the
159b8851fccSafresh1hyperbolic arcus sine of its numerical argument [C99].  See also
160eac174f2Safresh1L<Math::Trig>.  Added in Perl v5.22.
161b8851fccSafresh1
162e5157e49Safresh1=item C<assert>
163898184e3Ssthen
164898184e3SsthenUnimplemented, but you can use L<perlfunc/die> and the L<Carp> module
165898184e3Ssthento achieve similar things.
166898184e3Ssthen
167e5157e49Safresh1=item C<atan>
168898184e3Ssthen
169898184e3SsthenThis is identical to the C function C<atan()>, returning the
170898184e3Ssthenarcus tangent of its numerical argument.  See also L<Math::Trig>.
171898184e3Ssthen
172b8851fccSafresh1=item C<atanh>
173b8851fccSafresh1
174b8851fccSafresh1This is identical to the C function C<atanh()>, returning the
175b8851fccSafresh1hyperbolic arcus tangent of its numerical argument [C99].  See also
176eac174f2Safresh1L<Math::Trig>.  Added in Perl v5.22.
177b8851fccSafresh1
178e5157e49Safresh1=item C<atan2>
179898184e3Ssthen
180898184e3SsthenThis is identical to Perl's builtin C<atan2()> function, returning
181898184e3Ssthenthe arcus tangent defined by its two numerical arguments, the I<y>
182898184e3Ssthencoordinate and the I<x> coordinate.  See also L<Math::Trig>.
183898184e3Ssthen
184e5157e49Safresh1=item C<atexit>
185898184e3Ssthen
186b8851fccSafresh1Not implemented.  C<atexit()> is C-specific: use C<END {}> instead, see L<perlmod>.
187898184e3Ssthen
188e5157e49Safresh1=item C<atof>
189898184e3Ssthen
190b8851fccSafresh1Not implemented.  C<atof()> is C-specific.  Perl converts strings to numbers transparently.
191898184e3SsthenIf you need to force a scalar to a number, add a zero to it.
192898184e3Ssthen
193e5157e49Safresh1=item C<atoi>
194898184e3Ssthen
195b8851fccSafresh1Not implemented.  C<atoi()> is C-specific.  Perl converts strings to numbers transparently.
196898184e3SsthenIf you need to force a scalar to a number, add a zero to it.
197898184e3SsthenIf you need to have just the integer part, see L<perlfunc/int>.
198898184e3Ssthen
199e5157e49Safresh1=item C<atol>
200898184e3Ssthen
201b8851fccSafresh1Not implemented.  C<atol()> is C-specific.  Perl converts strings to numbers transparently.
202898184e3SsthenIf you need to force a scalar to a number, add a zero to it.
203898184e3SsthenIf you need to have just the integer part, see L<perlfunc/int>.
204898184e3Ssthen
205e5157e49Safresh1=item C<bsearch>
206898184e3Ssthen
207e5157e49Safresh1C<bsearch()> not supplied.  For doing binary search on wordlists,
208898184e3Ssthensee L<Search::Dict>.
209898184e3Ssthen
210e5157e49Safresh1=item C<calloc>
211898184e3Ssthen
212b8851fccSafresh1Not implemented.  C<calloc()> is C-specific.  Perl does memory management transparently.
213b8851fccSafresh1
214b8851fccSafresh1=item C<cbrt>
215b8851fccSafresh1
216eac174f2Safresh1The cube root [C99].  Added in Perl v5.22.
217898184e3Ssthen
218e5157e49Safresh1=item C<ceil>
219898184e3Ssthen
220898184e3SsthenThis is identical to the C function C<ceil()>, returning the smallest
221898184e3Sstheninteger value greater than or equal to the given numerical argument.
222898184e3Ssthen
223e5157e49Safresh1=item C<chdir>
224898184e3Ssthen
2259f11ffb7Safresh1This is identical to Perl's builtin C<chdir()> function, allowing one to
2269f11ffb7Safresh1change the working (default) directory -- see L<perlfunc/chdir> -- with the
2279f11ffb7Safresh1exception that C<POSIX::chdir()> must be provided an explicit value (rather
2289f11ffb7Safresh1than relying on an implicit C<$_>):
2299f11ffb7Safresh1
2309f11ffb7Safresh1    $rv = POSIX::chdir('path/to/dir');      # good
2319f11ffb7Safresh1
2329f11ffb7Safresh1    $rv = POSIX::chdir();                   # throws exception
233898184e3Ssthen
234e5157e49Safresh1=item C<chmod>
235898184e3Ssthen
236898184e3SsthenThis is identical to Perl's builtin C<chmod()> function, allowing
2379f11ffb7Safresh1one to change file and directory permissions -- see L<perlfunc/chmod> -- with
2389f11ffb7Safresh1the exception that C<POSIX::chmod()> can only change one file at a time
2399f11ffb7Safresh1(rather than a list of files):
2409f11ffb7Safresh1
2419f11ffb7Safresh1    $c = chmod 0664, $file1, $file2;          # good
2429f11ffb7Safresh1
2439f11ffb7Safresh1    $c = POSIX::chmod 0664, $file1;           # throws exception
2449f11ffb7Safresh1
2459f11ffb7Safresh1    $c = POSIX::chmod 0664, $file1, $file2;   # throws exception
246898184e3Ssthen
247b46d8ef2Safresh1As with the built-in C<chmod()>, C<$file> may be a filename or a file
248b46d8ef2Safresh1handle.
249b46d8ef2Safresh1
250e5157e49Safresh1=item C<chown>
251898184e3Ssthen
252898184e3SsthenThis is identical to Perl's builtin C<chown()> function, allowing one
253898184e3Ssthento change file and directory owners and groups, see L<perlfunc/chown>.
254898184e3Ssthen
255e5157e49Safresh1=item C<clearerr>
256898184e3Ssthen
257b8851fccSafresh1Not implemented.  Use the method C<IO::Handle::clearerr()> instead, to reset the error
258898184e3Ssthenstate (if any) and EOF state (if any) of the given stream.
259898184e3Ssthen
260e5157e49Safresh1=item C<clock>
261898184e3Ssthen
262898184e3SsthenThis is identical to the C function C<clock()>, returning the
263898184e3Ssthenamount of spent processor time in microseconds.
264898184e3Ssthen
265e5157e49Safresh1=item C<close>
266898184e3Ssthen
267898184e3SsthenClose the file.  This uses file descriptors such as those obtained by calling
268898184e3SsthenC<POSIX::open>.
269898184e3Ssthen
270898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_RDONLY );
271898184e3Ssthen	POSIX::close( $fd );
272898184e3Ssthen
273898184e3SsthenReturns C<undef> on failure.
274898184e3Ssthen
275898184e3SsthenSee also L<perlfunc/close>.
276898184e3Ssthen
277e5157e49Safresh1=item C<closedir>
278898184e3Ssthen
279898184e3SsthenThis is identical to Perl's builtin C<closedir()> function for closing
280898184e3Ssthena directory handle, see L<perlfunc/closedir>.
281898184e3Ssthen
282e5157e49Safresh1=item C<cos>
283898184e3Ssthen
284898184e3SsthenThis is identical to Perl's builtin C<cos()> function, for returning
285898184e3Ssthenthe cosine of its numerical argument, see L<perlfunc/cos>.
286898184e3SsthenSee also L<Math::Trig>.
287898184e3Ssthen
288e5157e49Safresh1=item C<cosh>
289898184e3Ssthen
290898184e3SsthenThis is identical to the C function C<cosh()>, for returning
291898184e3Ssthenthe hyperbolic cosine of its numeric argument.  See also L<Math::Trig>.
292898184e3Ssthen
293b8851fccSafresh1=item C<copysign>
294b8851fccSafresh1
295eac174f2Safresh1Returns C<x> but with the sign of C<y> [C99].  Added in Perl v5.22.
296b8851fccSafresh1
297b8851fccSafresh1 $x_with_sign_of_y = POSIX::copysign($x, $y);
298b8851fccSafresh1
299b8851fccSafresh1See also L</signbit>.
300b8851fccSafresh1
301e5157e49Safresh1=item C<creat>
302898184e3Ssthen
303898184e3SsthenCreate a new file.  This returns a file descriptor like the ones returned by
304898184e3SsthenC<POSIX::open>.  Use C<POSIX::close> to close the file.
305898184e3Ssthen
306898184e3Ssthen	$fd = POSIX::creat( "foo", 0611 );
307898184e3Ssthen	POSIX::close( $fd );
308898184e3Ssthen
309898184e3SsthenSee also L<perlfunc/sysopen> and its C<O_CREAT> flag.
310898184e3Ssthen
311e5157e49Safresh1=item C<ctermid>
312898184e3Ssthen
313898184e3SsthenGenerates the path name for the controlling terminal.
314898184e3Ssthen
315898184e3Ssthen	$path = POSIX::ctermid();
316898184e3Ssthen
317e5157e49Safresh1=item C<ctime>
318898184e3Ssthen
319898184e3SsthenThis is identical to the C function C<ctime()> and equivalent
320898184e3Ssthento C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
321898184e3Ssthen
322b46d8ef2Safresh1=item C<cuserid> [POSIX.1-1988]
323898184e3Ssthen
324898184e3SsthenGet the login name of the owner of the current process.
325898184e3Ssthen
326898184e3Ssthen	$name = POSIX::cuserid();
327898184e3Ssthen
328b46d8ef2Safresh1Note: this function has not been specified by POSIX since 1990 and is included
329b46d8ef2Safresh1only for backwards compatibility. New code should use L<C<getlogin()>|perlfunc/getlogin> instead.
330b46d8ef2Safresh1
331e5157e49Safresh1=item C<difftime>
332898184e3Ssthen
333898184e3SsthenThis is identical to the C function C<difftime()>, for returning
334898184e3Ssthenthe time difference (in seconds) between two times (as returned
335898184e3Ssthenby C<time()>), see L</time>.
336898184e3Ssthen
337e5157e49Safresh1=item C<div>
338898184e3Ssthen
339b8851fccSafresh1Not implemented.  C<div()> is C-specific, use L<perlfunc/int> on the usual C</> division and
340898184e3Ssthenthe modulus C<%>.
341898184e3Ssthen
342e5157e49Safresh1=item C<dup>
343898184e3Ssthen
344898184e3SsthenThis is similar to the C function C<dup()>, for duplicating a file
345898184e3Ssthendescriptor.
346898184e3Ssthen
347898184e3SsthenThis uses file descriptors such as those obtained by calling
348898184e3SsthenC<POSIX::open>.
349898184e3Ssthen
350898184e3SsthenReturns C<undef> on failure.
351898184e3Ssthen
352e5157e49Safresh1=item C<dup2>
353898184e3Ssthen
354898184e3SsthenThis is similar to the C function C<dup2()>, for duplicating a file
355898184e3Ssthendescriptor to an another known file descriptor.
356898184e3Ssthen
357898184e3SsthenThis uses file descriptors such as those obtained by calling
358898184e3SsthenC<POSIX::open>.
359898184e3Ssthen
360898184e3SsthenReturns C<undef> on failure.
361898184e3Ssthen
362b8851fccSafresh1=item C<erf>
363b8851fccSafresh1
364eac174f2Safresh1The error function [C99].  Added in Perl v5.22.
365b8851fccSafresh1
366b8851fccSafresh1=item C<erfc>
367b8851fccSafresh1
368eac174f2Safresh1The complementary error function [C99].  Added in Perl v5.22.
369b8851fccSafresh1
370e5157e49Safresh1=item C<errno>
371898184e3Ssthen
372898184e3SsthenReturns the value of errno.
373898184e3Ssthen
374898184e3Ssthen	$errno = POSIX::errno();
375898184e3Ssthen
376898184e3SsthenThis identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
377898184e3Ssthen
378e5157e49Safresh1=item C<execl>
379898184e3Ssthen
380b8851fccSafresh1Not implemented.  C<execl()> is C-specific, see L<perlfunc/exec>.
381898184e3Ssthen
382e5157e49Safresh1=item C<execle>
383898184e3Ssthen
384b8851fccSafresh1Not implemented.  C<execle()> is C-specific, see L<perlfunc/exec>.
385898184e3Ssthen
386e5157e49Safresh1=item C<execlp>
387898184e3Ssthen
388b8851fccSafresh1Not implemented.  C<execlp()> is C-specific, see L<perlfunc/exec>.
389898184e3Ssthen
390e5157e49Safresh1=item C<execv>
391898184e3Ssthen
392b8851fccSafresh1Not implemented.  C<execv()> is C-specific, see L<perlfunc/exec>.
393898184e3Ssthen
394e5157e49Safresh1=item C<execve>
395898184e3Ssthen
396b8851fccSafresh1Not implemented.  C<execve()> is C-specific, see L<perlfunc/exec>.
397898184e3Ssthen
398e5157e49Safresh1=item C<execvp>
399898184e3Ssthen
400b8851fccSafresh1Not implemented.  C<execvp()> is C-specific, see L<perlfunc/exec>.
401898184e3Ssthen
402e5157e49Safresh1=item C<exit>
403898184e3Ssthen
404898184e3SsthenThis is identical to Perl's builtin C<exit()> function for exiting the
405898184e3Ssthenprogram, see L<perlfunc/exit>.
406898184e3Ssthen
407e5157e49Safresh1=item C<exp>
408898184e3Ssthen
409898184e3SsthenThis is identical to Perl's builtin C<exp()> function for
410898184e3Ssthenreturning the exponent (I<e>-based) of the numerical argument,
411898184e3Ssthensee L<perlfunc/exp>.
412898184e3Ssthen
413b8851fccSafresh1=item C<expm1>
414b8851fccSafresh1
415b8851fccSafresh1Equivalent to C<exp(x) - 1>, but more precise for small argument values [C99].
416eac174f2Safresh1Added in Perl v5.22.
417b8851fccSafresh1
418b8851fccSafresh1See also L</log1p>.
419b8851fccSafresh1
420e5157e49Safresh1=item C<fabs>
421898184e3Ssthen
422898184e3SsthenThis is identical to Perl's builtin C<abs()> function for returning
423898184e3Ssthenthe absolute value of the numerical argument, see L<perlfunc/abs>.
424898184e3Ssthen
425e5157e49Safresh1=item C<fclose>
426898184e3Ssthen
427b8851fccSafresh1Not implemented.  Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
428898184e3Ssthen
429e5157e49Safresh1=item C<fcntl>
430898184e3Ssthen
431898184e3SsthenThis is identical to Perl's builtin C<fcntl()> function,
432898184e3Ssthensee L<perlfunc/fcntl>.
433898184e3Ssthen
434e5157e49Safresh1=item C<fdopen>
435898184e3Ssthen
436b8851fccSafresh1Not implemented.  Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
437898184e3Ssthen
438e5157e49Safresh1=item C<feof>
439898184e3Ssthen
440b8851fccSafresh1Not implemented.  Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
441898184e3Ssthen
442e5157e49Safresh1=item C<ferror>
443898184e3Ssthen
444b8851fccSafresh1Not implemented.  Use method C<IO::Handle::error()> instead.
445898184e3Ssthen
446e5157e49Safresh1=item C<fflush>
447898184e3Ssthen
448b8851fccSafresh1Not implemented.  Use method C<IO::Handle::flush()> instead.
449e5157e49Safresh1See also C<L<perlvar/$OUTPUT_AUTOFLUSH>>.
450898184e3Ssthen
451e5157e49Safresh1=item C<fgetc>
452898184e3Ssthen
453b8851fccSafresh1Not implemented.  Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
454898184e3Ssthen
455e5157e49Safresh1=item C<fgetpos>
456898184e3Ssthen
457b8851fccSafresh1Not implemented.  Use method C<IO::Seekable::getpos()> instead, or see L<perlfunc/seek>.
458898184e3Ssthen
459e5157e49Safresh1=item C<fgets>
460898184e3Ssthen
461b8851fccSafresh1Not implemented.  Use method C<IO::Handle::gets()> instead.  Similar to E<lt>E<gt>, also known
462898184e3Ssthenas L<perlfunc/readline>.
463898184e3Ssthen
464e5157e49Safresh1=item C<fileno>
465898184e3Ssthen
466b8851fccSafresh1Not implemented.  Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
467898184e3Ssthen
468e5157e49Safresh1=item C<floor>
469898184e3Ssthen
470898184e3SsthenThis is identical to the C function C<floor()>, returning the largest
471898184e3Sstheninteger value less than or equal to the numerical argument.
472898184e3Ssthen
473b8851fccSafresh1=item C<fdim>
474b8851fccSafresh1
475b8851fccSafresh1"Positive difference", S<C<x - y>> if S<C<x E<gt> y>>, zero otherwise [C99].
476eac174f2Safresh1Added in Perl v5.22.
477b8851fccSafresh1
478b8851fccSafresh1=item C<fegetround>
479b8851fccSafresh1
480b8851fccSafresh1Returns the current floating point rounding mode, one of
481b8851fccSafresh1
48256d68f1eSafresh1  FE_TONEAREST FE_TOWARDZERO FE_UPWARD FE_DOWNWARD
483b8851fccSafresh1
484b8851fccSafresh1C<FE_TONEAREST> is like L</round>, C<FE_TOWARDZERO> is like L</trunc> [C99].
485eac174f2Safresh1Added in Perl v5.22.
486b8851fccSafresh1
487b8851fccSafresh1=item C<fesetround>
488b8851fccSafresh1
489eac174f2Safresh1Sets the floating point rounding mode, see L</fegetround> [C99].  Added in
490eac174f2Safresh1Perl v5.22.
491b8851fccSafresh1
492b8851fccSafresh1=item C<fma>
493b8851fccSafresh1
494b8851fccSafresh1"Fused multiply-add", S<C<x * y + z>>, possibly faster (and less lossy)
495eac174f2Safresh1than the explicit two operations [C99].  Added in Perl v5.22.
496b8851fccSafresh1
497b8851fccSafresh1 my $fused = POSIX::fma($x, $y, $z);
498b8851fccSafresh1
499b8851fccSafresh1=item C<fmax>
500b8851fccSafresh1
501b8851fccSafresh1Maximum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
502eac174f2Safresh1Added in Perl v5.22.
503b8851fccSafresh1
504*e0680481Safresh1 my $max = POSIX::fmax($x, $y);
505b8851fccSafresh1
506b8851fccSafresh1=item C<fmin>
507b8851fccSafresh1
508b8851fccSafresh1Minimum of C<x> and C<y>, except when either is C<NaN>, returns the other [C99].
509eac174f2Safresh1Added in Perl v5.22.
510b8851fccSafresh1
511b8851fccSafresh1 my $min = POSIX::fmin($x, $y);
512b8851fccSafresh1
513e5157e49Safresh1=item C<fmod>
514898184e3Ssthen
515898184e3SsthenThis is identical to the C function C<fmod()>.
516898184e3Ssthen
517898184e3Ssthen	$r = fmod($x, $y);
518898184e3Ssthen
519b8851fccSafresh1It returns the remainder S<C<$r = $x - $n*$y>>, where S<C<$n = trunc($x/$y)>>.
520898184e3SsthenThe C<$r> has the same sign as C<$x> and magnitude (absolute value)
521898184e3Ssthenless than the magnitude of C<$y>.
522898184e3Ssthen
523e5157e49Safresh1=item C<fopen>
524898184e3Ssthen
525b8851fccSafresh1Not implemented.  Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
526898184e3Ssthen
527e5157e49Safresh1=item C<fork>
528898184e3Ssthen
529898184e3SsthenThis is identical to Perl's builtin C<fork()> function
530898184e3Ssthenfor duplicating the current process, see L<perlfunc/fork>
531898184e3Ssthenand L<perlfork> if you are in Windows.
532898184e3Ssthen
533e5157e49Safresh1=item C<fpathconf>
534898184e3Ssthen
535898184e3SsthenRetrieves the value of a configurable limit on a file or directory.  This
536898184e3Ssthenuses file descriptors such as those obtained by calling C<POSIX::open>.
537898184e3Ssthen
538898184e3SsthenThe following will determine the maximum length of the longest allowable
53991f110e0Safresh1pathname on the filesystem which holds F</var/foo>.
540898184e3Ssthen
541898184e3Ssthen	$fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
542898184e3Ssthen	$path_max = POSIX::fpathconf($fd, &POSIX::_PC_PATH_MAX);
543898184e3Ssthen
544898184e3SsthenReturns C<undef> on failure.
545898184e3Ssthen
546b8851fccSafresh1=item C<fpclassify>
547b8851fccSafresh1
548b8851fccSafresh1Returns one of
549b8851fccSafresh1
550b8851fccSafresh1  FP_NORMAL FP_ZERO FP_SUBNORMAL FP_INFINITE FP_NAN
551b8851fccSafresh1
552b8851fccSafresh1telling the class of the argument [C99].  C<FP_INFINITE> is positive
553b8851fccSafresh1or negative infinity, C<FP_NAN> is not-a-number.  C<FP_SUBNORMAL>
554b8851fccSafresh1means subnormal numbers (also known as denormals), very small numbers
555b8851fccSafresh1with low precision. C<FP_ZERO> is zero.  C<FP_NORMAL> is all the rest.
556eac174f2Safresh1Added in Perl v5.22.
557b8851fccSafresh1
558e5157e49Safresh1=item C<fprintf>
559898184e3Ssthen
560b8851fccSafresh1Not implemented.  C<fprintf()> is C-specific, see L<perlfunc/printf> instead.
561898184e3Ssthen
562e5157e49Safresh1=item C<fputc>
563898184e3Ssthen
564b8851fccSafresh1Not implemented.  C<fputc()> is C-specific, see L<perlfunc/print> instead.
565898184e3Ssthen
566e5157e49Safresh1=item C<fputs>
567898184e3Ssthen
568b8851fccSafresh1Not implemented.  C<fputs()> is C-specific, see L<perlfunc/print> instead.
569898184e3Ssthen
570e5157e49Safresh1=item C<fread>
571898184e3Ssthen
572b8851fccSafresh1Not implemented.  C<fread()> is C-specific, see L<perlfunc/read> instead.
573898184e3Ssthen
574e5157e49Safresh1=item C<free>
575898184e3Ssthen
576b8851fccSafresh1Not implemented.  C<free()> is C-specific.  Perl does memory management transparently.
577898184e3Ssthen
578e5157e49Safresh1=item C<freopen>
579898184e3Ssthen
580b8851fccSafresh1Not implemented.  C<freopen()> is C-specific, see L<perlfunc/open> instead.
581898184e3Ssthen
582e5157e49Safresh1=item C<frexp>
583898184e3Ssthen
584898184e3SsthenReturn the mantissa and exponent of a floating-point number.
585898184e3Ssthen
586898184e3Ssthen	($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
587898184e3Ssthen
588e5157e49Safresh1=item C<fscanf>
589898184e3Ssthen
590b8851fccSafresh1Not implemented.  C<fscanf()> is C-specific, use E<lt>E<gt> and regular expressions instead.
591898184e3Ssthen
592e5157e49Safresh1=item C<fseek>
593898184e3Ssthen
594b8851fccSafresh1Not implemented.  Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
595898184e3Ssthen
596e5157e49Safresh1=item C<fsetpos>
597898184e3Ssthen
598b8851fccSafresh1Not implemented.  Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
599898184e3Ssthen
600e5157e49Safresh1=item C<fstat>
601898184e3Ssthen
602898184e3SsthenGet file status.  This uses file descriptors such as those obtained by
603898184e3Ssthencalling C<POSIX::open>.  The data returned is identical to the data from
604898184e3SsthenPerl's builtin C<stat> function.
605898184e3Ssthen
606898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_RDONLY );
607898184e3Ssthen	@stats = POSIX::fstat( $fd );
608898184e3Ssthen
609e5157e49Safresh1=item C<fsync>
610898184e3Ssthen
611b8851fccSafresh1Not implemented.  Use method C<IO::Handle::sync()> instead.
612898184e3Ssthen
613e5157e49Safresh1=item C<ftell>
614898184e3Ssthen
615b8851fccSafresh1Not implemented.  Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
616898184e3Ssthen
617e5157e49Safresh1=item C<fwrite>
618898184e3Ssthen
619b8851fccSafresh1Not implemented.  C<fwrite()> is C-specific, see L<perlfunc/print> instead.
620898184e3Ssthen
621e5157e49Safresh1=item C<getc>
622898184e3Ssthen
623898184e3SsthenThis is identical to Perl's builtin C<getc()> function,
624898184e3Ssthensee L<perlfunc/getc>.
625898184e3Ssthen
626e5157e49Safresh1=item C<getchar>
627898184e3Ssthen
628898184e3SsthenReturns one character from STDIN.  Identical to Perl's C<getc()>,
629898184e3Ssthensee L<perlfunc/getc>.
630898184e3Ssthen
631e5157e49Safresh1=item C<getcwd>
632898184e3Ssthen
633898184e3SsthenReturns the name of the current working directory.
634898184e3SsthenSee also L<Cwd>.
635898184e3Ssthen
636e5157e49Safresh1=item C<getegid>
637898184e3Ssthen
638898184e3SsthenReturns the effective group identifier.  Similar to Perl' s builtin
639898184e3Ssthenvariable C<$(>, see L<perlvar/$EGID>.
640898184e3Ssthen
641e5157e49Safresh1=item C<getenv>
642898184e3Ssthen
643898184e3SsthenReturns the value of the specified environment variable.
644898184e3SsthenThe same information is available through the C<%ENV> array.
645898184e3Ssthen
646e5157e49Safresh1=item C<geteuid>
647898184e3Ssthen
648898184e3SsthenReturns the effective user identifier.  Identical to Perl's builtin C<$E<gt>>
649898184e3Ssthenvariable, see L<perlvar/$EUID>.
650898184e3Ssthen
651e5157e49Safresh1=item C<getgid>
652898184e3Ssthen
653898184e3SsthenReturns the user's real group identifier.  Similar to Perl's builtin
654898184e3Ssthenvariable C<$)>, see L<perlvar/$GID>.
655898184e3Ssthen
656e5157e49Safresh1=item C<getgrgid>
657898184e3Ssthen
658898184e3SsthenThis is identical to Perl's builtin C<getgrgid()> function for
659898184e3Ssthenreturning group entries by group identifiers, see
660898184e3SsthenL<perlfunc/getgrgid>.
661898184e3Ssthen
662e5157e49Safresh1=item C<getgrnam>
663898184e3Ssthen
664898184e3SsthenThis is identical to Perl's builtin C<getgrnam()> function for
665898184e3Ssthenreturning group entries by group names, see L<perlfunc/getgrnam>.
666898184e3Ssthen
667e5157e49Safresh1=item C<getgroups>
668898184e3Ssthen
669898184e3SsthenReturns the ids of the user's supplementary groups.  Similar to Perl's
670898184e3Ssthenbuiltin variable C<$)>, see L<perlvar/$GID>.
671898184e3Ssthen
672e5157e49Safresh1=item C<getlogin>
673898184e3Ssthen
674898184e3SsthenThis is identical to Perl's builtin C<getlogin()> function for
675898184e3Ssthenreturning the user name associated with the current session, see
676898184e3SsthenL<perlfunc/getlogin>.
677898184e3Ssthen
678b8851fccSafresh1=item C<getpayload>
679b8851fccSafresh1
680b8851fccSafresh1	use POSIX ':nan_payload';
681b8851fccSafresh1	getpayload($var)
682b8851fccSafresh1
683eac174f2Safresh1Returns the C<NaN> payload.  Added in Perl v5.24.
684b8851fccSafresh1
685b8851fccSafresh1Note the API instability warning in L</setpayload>.
686b8851fccSafresh1
687b8851fccSafresh1See L</nan> for more discussion about C<NaN>.
688b8851fccSafresh1
689e5157e49Safresh1=item C<getpgrp>
690898184e3Ssthen
691898184e3SsthenThis is identical to Perl's builtin C<getpgrp()> function for
692898184e3Ssthenreturning the process group identifier of the current process, see
693898184e3SsthenL<perlfunc/getpgrp>.
694898184e3Ssthen
695e5157e49Safresh1=item C<getpid>
696898184e3Ssthen
697898184e3SsthenReturns the process identifier.  Identical to Perl's builtin
698898184e3Ssthenvariable C<$$>, see L<perlvar/$PID>.
699898184e3Ssthen
700e5157e49Safresh1=item C<getppid>
701898184e3Ssthen
702898184e3SsthenThis is identical to Perl's builtin C<getppid()> function for
703898184e3Ssthenreturning the process identifier of the parent process of the current
704898184e3Ssthenprocess , see L<perlfunc/getppid>.
705898184e3Ssthen
706e5157e49Safresh1=item C<getpwnam>
707898184e3Ssthen
708898184e3SsthenThis is identical to Perl's builtin C<getpwnam()> function for
709898184e3Ssthenreturning user entries by user names, see L<perlfunc/getpwnam>.
710898184e3Ssthen
711e5157e49Safresh1=item C<getpwuid>
712898184e3Ssthen
713898184e3SsthenThis is identical to Perl's builtin C<getpwuid()> function for
714898184e3Ssthenreturning user entries by user identifiers, see L<perlfunc/getpwuid>.
715898184e3Ssthen
716e5157e49Safresh1=item C<gets>
717898184e3Ssthen
718898184e3SsthenReturns one line from C<STDIN>, similar to E<lt>E<gt>, also known
719898184e3Ssthenas the C<readline()> function, see L<perlfunc/readline>.
720898184e3Ssthen
721898184e3SsthenB<NOTE>: if you have C programs that still use C<gets()>, be very
722898184e3Ssthenafraid.  The C<gets()> function is a source of endless grief because
723898184e3Ssthenit has no buffer overrun checks.  It should B<never> be used.  The
724898184e3SsthenC<fgets()> function should be preferred instead.
725898184e3Ssthen
726e5157e49Safresh1=item C<getuid>
727898184e3Ssthen
728898184e3SsthenReturns the user's identifier.  Identical to Perl's builtin C<$E<lt>> variable,
729898184e3Ssthensee L<perlvar/$UID>.
730898184e3Ssthen
731e5157e49Safresh1=item C<gmtime>
732898184e3Ssthen
733898184e3SsthenThis is identical to Perl's builtin C<gmtime()> function for
734898184e3Ssthenconverting seconds since the epoch to a date in Greenwich Mean Time,
735898184e3Ssthensee L<perlfunc/gmtime>.
736898184e3Ssthen
737b8851fccSafresh1=item C<hypot>
738b8851fccSafresh1
739b8851fccSafresh1Equivalent to C<S<sqrt(x * x + y * y)>> except more stable on very large
740eac174f2Safresh1or very small arguments [C99].  Added in Perl v5.22.
741b8851fccSafresh1
742b8851fccSafresh1=item C<ilogb>
743b8851fccSafresh1
744eac174f2Safresh1Integer binary logarithm [C99].  Added in Perl v5.22.
745b8851fccSafresh1
746b8851fccSafresh1For example C<ilogb(20)> is 4, as an integer.
747b8851fccSafresh1
748b8851fccSafresh1See also L</logb>.
749b8851fccSafresh1
750b8851fccSafresh1=item C<Inf>
751b8851fccSafresh1
752b8851fccSafresh1The infinity as a constant:
753b8851fccSafresh1
754b8851fccSafresh1   use POSIX qw(Inf);
755b8851fccSafresh1   my $pos_inf = +Inf;  # Or just Inf.
756b8851fccSafresh1   my $neg_inf = -Inf;
757b8851fccSafresh1
758b8851fccSafresh1See also L</isinf>, and L</fpclassify>.
759b8851fccSafresh1
760e5157e49Safresh1=item C<isalnum>
761898184e3Ssthen
762eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
763b8851fccSafresh1matching against S<C<qr/ ^ [[:alnum:]]+ $ /x>>, which you should convert
764b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
765898184e3Ssthen
766e5157e49Safresh1=item C<isalpha>
767e5157e49Safresh1
768eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
769b8851fccSafresh1matching against S<C<qr/ ^ [[:alpha:]]+ $ /x>>, which you should convert
770b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
771e5157e49Safresh1
772e5157e49Safresh1=item C<isatty>
773898184e3Ssthen
774898184e3SsthenReturns a boolean indicating whether the specified filehandle is connected
775898184e3Ssthento a tty.  Similar to the C<-t> operator, see L<perlfunc/-X>.
776898184e3Ssthen
777e5157e49Safresh1=item C<iscntrl>
778898184e3Ssthen
779eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
780b8851fccSafresh1matching against S<C<qr/ ^ [[:cntrl:]]+ $ /x>>, which you should convert
781b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
782898184e3Ssthen
783e5157e49Safresh1=item C<isdigit>
784898184e3Ssthen
785eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
786b8851fccSafresh1matching against S<C<qr/ ^ [[:digit:]]+ $ /x>>, which you should convert
787b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
788898184e3Ssthen
789b8851fccSafresh1=item C<isfinite>
790898184e3Ssthen
791b8851fccSafresh1Returns true if the argument is a finite number (that is, not an
792eac174f2Safresh1infinity, or the not-a-number) [C99].  Added in Perl v5.22.
793b8851fccSafresh1
794b8851fccSafresh1See also L</isinf>, L</isnan>, and L</fpclassify>.
795898184e3Ssthen
796e5157e49Safresh1=item C<isgraph>
797898184e3Ssthen
798eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
799b8851fccSafresh1matching against S<C<qr/ ^ [[:graph:]]+ $ /x>>, which you should convert
800b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
801898184e3Ssthen
802b8851fccSafresh1=item C<isgreater>
803b8851fccSafresh1
804b8851fccSafresh1(Also C<isgreaterequal>, C<isless>, C<islessequal>, C<islessgreater>,
805b8851fccSafresh1C<isunordered>)
806b8851fccSafresh1
807eac174f2Safresh1Floating point comparisons which handle the C<NaN> [C99].  Added in Perl
808eac174f2Safresh1v5.22.
809b8851fccSafresh1
810b8851fccSafresh1=item C<isinf>
811b8851fccSafresh1
812b8851fccSafresh1Returns true if the argument is an infinity (positive or negative) [C99].
813eac174f2Safresh1Added in Perl v5.22.
814b8851fccSafresh1
815b8851fccSafresh1See also L</Inf>, L</isnan>, L</isfinite>, and L</fpclassify>.
816898184e3Ssthen
817e5157e49Safresh1=item C<islower>
818898184e3Ssthen
819eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
820b8851fccSafresh1matching against S<C<qr/ ^ [[:lower:]]+ $ /x>>, which you should convert
821b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
822898184e3Ssthen
823b8851fccSafresh1=item C<isnan>
824898184e3Ssthen
825eac174f2Safresh1Returns true if the argument is C<NaN> (not-a-number) [C99].  Added in
826eac174f2Safresh1Perl v5.22.
827b8851fccSafresh1
828eac174f2Safresh1Note that you can also test for "C<NaN>-ness" with
829eac174f2Safresh1L<equality operators|perlop/"Equality Operators"> (C<==> or C<!=>), as in
830b8851fccSafresh1
831eac174f2Safresh1    print "x is not a NaN\n" if $x == $x;
832b8851fccSafresh1
833eac174f2Safresh1since the C<NaN> is not equal to anything, B<including itself>.
834b8851fccSafresh1
835b8851fccSafresh1See also L</nan>, L</NaN>, L</isinf>, and L</fpclassify>.
836b8851fccSafresh1
837b8851fccSafresh1=item C<isnormal>
838b8851fccSafresh1
839b8851fccSafresh1Returns true if the argument is normal (that is, not a subnormal/denormal,
840eac174f2Safresh1and not an infinity, or a not-a-number) [C99].  Added in Perl v5.22.
841b8851fccSafresh1
842b8851fccSafresh1See also L</isfinite>, and L</fpclassify>.
843898184e3Ssthen
844e5157e49Safresh1=item C<isprint>
845898184e3Ssthen
846eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
847b8851fccSafresh1matching against S<C<qr/ ^ [[:print:]]+ $ /x>>, which you should convert
848b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
849898184e3Ssthen
850e5157e49Safresh1=item C<ispunct>
851898184e3Ssthen
852eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
853b8851fccSafresh1matching against S<C<qr/ ^ [[:punct:]]+ $ /x>>, which you should convert
854b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
855e5157e49Safresh1
856b8851fccSafresh1=item C<issignaling>
857b8851fccSafresh1
858b8851fccSafresh1	use POSIX ':nan_payload';
859b8851fccSafresh1	issignaling($var, $payload)
860b8851fccSafresh1
861eac174f2Safresh1Return true if the argument is a I<signaling> NaN.  Added in Perl v5.24.
862b8851fccSafresh1
863b8851fccSafresh1Note the API instability warning in L</setpayload>.
864b8851fccSafresh1
865b8851fccSafresh1See L</nan> for more discussion about C<NaN>.
866e5157e49Safresh1
867e5157e49Safresh1=item C<isspace>
868e5157e49Safresh1
869eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
870b8851fccSafresh1matching against S<C<qr/ ^ [[:space:]]+ $ /x>>, which you should convert
871b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
872e5157e49Safresh1
873e5157e49Safresh1=item C<isupper>
874e5157e49Safresh1
875eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
876b8851fccSafresh1matching against S<C<qr/ ^ [[:upper:]]+ $ /x>>, which you should convert
877b8851fccSafresh1to use instead.  See L<perlrecharclass/POSIX Character Classes>.
878e5157e49Safresh1
879e5157e49Safresh1=item C<isxdigit>
880e5157e49Safresh1
881eac174f2Safresh1This function has been removed as of Perl v5.24.  It was very similar to
882b8851fccSafresh1matching against S<C<qr/ ^ [[:xdigit:]]+ $ /x>>, which you should
883b8851fccSafresh1convert to use instead.  See L<perlrecharclass/POSIX Character Classes>.
884e5157e49Safresh1
885b8851fccSafresh1=item C<j0>
886b8851fccSafresh1
887b8851fccSafresh1=item C<j1>
888b8851fccSafresh1
889b8851fccSafresh1=item C<jn>
890b8851fccSafresh1
891b8851fccSafresh1=item C<y0>
892b8851fccSafresh1
893b8851fccSafresh1=item C<y1>
894b8851fccSafresh1
895b8851fccSafresh1=item C<yn>
896b8851fccSafresh1
897b8851fccSafresh1The Bessel function of the first kind of the order zero.
898e5157e49Safresh1
899e5157e49Safresh1=item C<kill>
900898184e3Ssthen
901898184e3SsthenThis is identical to Perl's builtin C<kill()> function for sending
902898184e3Ssthensignals to processes (often to terminate them), see L<perlfunc/kill>.
903898184e3Ssthen
904e5157e49Safresh1=item C<labs>
905898184e3Ssthen
906b8851fccSafresh1Not implemented.  (For returning absolute values of long integers.)
907e5157e49Safresh1C<labs()> is C-specific, see L<perlfunc/abs> instead.
908898184e3Ssthen
909e5157e49Safresh1=item C<lchown>
910898184e3Ssthen
911898184e3SsthenThis is identical to the C function, except the order of arguments is
912898184e3Ssthenconsistent with Perl's builtin C<chown()> with the added restriction
913b8851fccSafresh1of only one path, not a list of paths.  Does the same thing as the
914898184e3SsthenC<chown()> function but changes the owner of a symbolic link instead
915898184e3Ssthenof the file the symbolic link points to.
916898184e3Ssthen
917b8851fccSafresh1 POSIX::lchown($uid, $gid, $file_path);
918b8851fccSafresh1
919e5157e49Safresh1=item C<ldexp>
920898184e3Ssthen
921898184e3SsthenThis is identical to the C function C<ldexp()>
922898184e3Ssthenfor multiplying floating point numbers with powers of two.
923898184e3Ssthen
924898184e3Ssthen	$x_quadrupled = POSIX::ldexp($x, 2);
925898184e3Ssthen
926e5157e49Safresh1=item C<ldiv>
927898184e3Ssthen
928b8851fccSafresh1Not implemented.  (For computing dividends of long integers.)
929e5157e49Safresh1C<ldiv()> is C-specific, use C</> and C<int()> instead.
930898184e3Ssthen
931b8851fccSafresh1=item C<lgamma>
932b8851fccSafresh1
933eac174f2Safresh1The logarithm of the Gamma function [C99].  Added in Perl v5.22.
934b8851fccSafresh1
935b8851fccSafresh1See also L</tgamma>.
936b8851fccSafresh1
937b8851fccSafresh1=item C<log1p>
938b8851fccSafresh1
939b8851fccSafresh1Equivalent to S<C<log(1 + x)>>, but more stable results for small argument
940eac174f2Safresh1values [C99].  Added in Perl v5.22.
941b8851fccSafresh1
942b8851fccSafresh1=item C<log2>
943b8851fccSafresh1
944eac174f2Safresh1Logarithm base two [C99].  Added in Perl v5.22.
945b8851fccSafresh1
946b8851fccSafresh1See also L</expm1>.
947b8851fccSafresh1
948b8851fccSafresh1=item C<logb>
949b8851fccSafresh1
950eac174f2Safresh1Integer binary logarithm [C99].  Added in Perl v5.22.
951b8851fccSafresh1
952b8851fccSafresh1For example C<logb(20)> is 4, as a floating point number.
953b8851fccSafresh1
954b8851fccSafresh1See also L</ilogb>.
955b8851fccSafresh1
956e5157e49Safresh1=item C<link>
957898184e3Ssthen
958898184e3SsthenThis is identical to Perl's builtin C<link()> function
959898184e3Ssthenfor creating hard links into files, see L<perlfunc/link>.
960898184e3Ssthen
961e5157e49Safresh1=item C<localeconv>
962898184e3Ssthen
963898184e3SsthenGet numeric formatting information.  Returns a reference to a hash
96456d68f1eSafresh1containing the formatting values of the locale that currently underlies
96556d68f1eSafresh1the program, regardless of whether or not it is called from within the
96656d68f1eSafresh1scope of a S<C<use locale>>.  Users of this function should also read
96756d68f1eSafresh1L<perllocale>, which provides a comprehensive discussion of Perl locale
96856d68f1eSafresh1handling, including
969e5157e49Safresh1L<a section devoted to this function|perllocale/The localeconv function>.
9709f11ffb7Safresh1Prior to Perl 5.28, or when operating in a non thread-safe environment,
9719f11ffb7Safresh1it should not be used in a threaded application unless it's certain that
9729f11ffb7Safresh1the underlying locale is C or POSIX.  This is because it otherwise
9739f11ffb7Safresh1changes the locale, which globally affects all threads simultaneously.
9749f11ffb7Safresh1Windows platforms starting with Visual Studio 2005 are mostly
9759f11ffb7Safresh1thread-safe, but use of this function in those prior to Visual Studio
976eac174f2Safresh12015 can have a race with a thread that has called
9779f11ffb7Safresh1L<perlapi/switch_to_global_locale>.
978898184e3Ssthen
979898184e3SsthenHere is how to query the database for the B<de> (Deutsch or German) locale.
980898184e3Ssthen
98191f110e0Safresh1	my $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
98291f110e0Safresh1	print "Locale: \"$loc\"\n";
98391f110e0Safresh1	my $lconv = POSIX::localeconv();
98491f110e0Safresh1	foreach my $property (qw(
98591f110e0Safresh1		decimal_point
98691f110e0Safresh1		thousands_sep
98791f110e0Safresh1		grouping
98891f110e0Safresh1		int_curr_symbol
98991f110e0Safresh1		currency_symbol
99091f110e0Safresh1		mon_decimal_point
99191f110e0Safresh1		mon_thousands_sep
99291f110e0Safresh1		mon_grouping
99391f110e0Safresh1		positive_sign
99491f110e0Safresh1		negative_sign
99591f110e0Safresh1		int_frac_digits
99691f110e0Safresh1		frac_digits
99791f110e0Safresh1		p_cs_precedes
99891f110e0Safresh1		p_sep_by_space
99991f110e0Safresh1		n_cs_precedes
100091f110e0Safresh1		n_sep_by_space
100191f110e0Safresh1		p_sign_posn
100291f110e0Safresh1		n_sign_posn
10032f878dc6Safresh1		int_p_cs_precedes
10042f878dc6Safresh1		int_p_sep_by_space
10052f878dc6Safresh1		int_n_cs_precedes
10062f878dc6Safresh1		int_n_sep_by_space
10072f878dc6Safresh1		int_p_sign_posn
10082f878dc6Safresh1		int_n_sign_posn
100991f110e0Safresh1	))
101091f110e0Safresh1	{
1011e5157e49Safresh1		printf qq(%s: "%s",\n),
1012e5157e49Safresh1			$property, $lconv->{$property};
101391f110e0Safresh1	}
1014898184e3Ssthen
1015b8851fccSafresh1The members whose names begin with C<int_p_> and C<int_n_> were added by
1016b8851fccSafresh1POSIX.1-2008 and are only available on systems that support them.
1017b8851fccSafresh1
1018*e0680481Safresh1A value of -1 returned for numeric entries indicates that the field is
1019*e0680481Safresh1not applicable to the locale.  This is rare except in the C and related
1020*e0680481Safresh1locales, which don't have most monetary values defined.  It can also
1021*e0680481Safresh1happen, quirkily, in fields that are otherwise boolean to indicate that
1022*e0680481Safresh1the value is kind of neither true nor false.  This happens in C<p_cs_precedes>
1023*e0680481Safresh1and C<int_p_cs_precedes> when the currency symbol neither precedes nor
1024*e0680481Safresh1succeeds a positive value but is infixed, by replacing the radix
1025*e0680481Safresh1character.
1026*e0680481Safresh1
1027*e0680481Safresh1Prior to Perl v5.37.7, empty string fields and numeric fields with value
1028*e0680481Safresh1-1 were omittted from the returned hash.
1029*e0680481Safresh1
1030e5157e49Safresh1=item C<localtime>
1031898184e3Ssthen
1032898184e3SsthenThis is identical to Perl's builtin C<localtime()> function for
10339f11ffb7Safresh1converting seconds since the epoch to a date see L<perlfunc/localtime> except
10349f11ffb7Safresh1that C<POSIX::localtime()> must be provided an explicit value (rather than
10359f11ffb7Safresh1relying on an implicit C<$_>):
10369f11ffb7Safresh1
10379f11ffb7Safresh1    @localtime = POSIX::localtime(time);    # good
10389f11ffb7Safresh1
10399f11ffb7Safresh1    @localtime = localtime();               # good
10409f11ffb7Safresh1
10419f11ffb7Safresh1    @localtime = POSIX::localtime();        # throws exception
1042898184e3Ssthen
1043e5157e49Safresh1=item C<log>
1044898184e3Ssthen
1045898184e3SsthenThis is identical to Perl's builtin C<log()> function,
1046898184e3Ssthenreturning the natural (I<e>-based) logarithm of the numerical argument,
1047898184e3Ssthensee L<perlfunc/log>.
1048898184e3Ssthen
1049e5157e49Safresh1=item C<log10>
1050898184e3Ssthen
1051898184e3SsthenThis is identical to the C function C<log10()>,
1052898184e3Ssthenreturning the 10-base logarithm of the numerical argument.
1053898184e3SsthenYou can also use
1054898184e3Ssthen
1055898184e3Ssthen    sub log10 { log($_[0]) / log(10) }
1056898184e3Ssthen
1057898184e3Ssthenor
1058898184e3Ssthen
1059898184e3Ssthen    sub log10 { log($_[0]) / 2.30258509299405 }
1060898184e3Ssthen
1061898184e3Ssthenor
1062898184e3Ssthen
1063898184e3Ssthen    sub log10 { log($_[0]) * 0.434294481903252 }
1064898184e3Ssthen
1065e5157e49Safresh1=item C<longjmp>
1066898184e3Ssthen
1067b8851fccSafresh1Not implemented.  C<longjmp()> is C-specific: use L<perlfunc/die> instead.
1068898184e3Ssthen
1069e5157e49Safresh1=item C<lseek>
1070898184e3Ssthen
1071898184e3SsthenMove the file's read/write position.  This uses file descriptors such as
1072898184e3Ssthenthose obtained by calling C<POSIX::open>.
1073898184e3Ssthen
1074898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1075898184e3Ssthen	$off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
1076898184e3Ssthen
1077898184e3SsthenReturns C<undef> on failure.
1078898184e3Ssthen
1079b8851fccSafresh1=item C<lrint>
1080b8851fccSafresh1
1081b8851fccSafresh1Depending on the current floating point rounding mode, rounds the
1082b8851fccSafresh1argument either toward nearest (like L</round>), toward zero (like
1083b8851fccSafresh1L</trunc>), downward (toward negative infinity), or upward (toward
1084eac174f2Safresh1positive infinity) [C99].  Added in Perl v5.22.
1085b8851fccSafresh1
1086b8851fccSafresh1For the rounding mode, see L</fegetround>.
1087b8851fccSafresh1
1088b8851fccSafresh1=item C<lround>
1089b8851fccSafresh1
1090eac174f2Safresh1Like L</round>, but as integer, as opposed to floating point [C99].  Added
1091eac174f2Safresh1in Perl v5.22.
1092b8851fccSafresh1
1093b8851fccSafresh1See also L</ceil>, L</floor>, L</trunc>.
1094b8851fccSafresh1
1095b8851fccSafresh1Owing to an oversight, this is not currently exported by default, or as part of
1096b8851fccSafresh1the C<:math_h_c99> export tag; importing it must therefore be done by explicit
10979f11ffb7Safresh1name.
1098b8851fccSafresh1
1099e5157e49Safresh1=item C<malloc>
1100898184e3Ssthen
1101b8851fccSafresh1Not implemented.  C<malloc()> is C-specific.  Perl does memory management transparently.
1102898184e3Ssthen
1103e5157e49Safresh1=item C<mblen>
1104898184e3Ssthen
110556d68f1eSafresh1This is the same as the C function C<mblen()> on unthreaded perls.  On
110656d68f1eSafresh1threaded perls, it transparently (almost) substitutes the more
110756d68f1eSafresh1thread-safe L<C<mbrlen>(3)>, if available, instead of C<mblen>.
1108b8851fccSafresh1
110956d68f1eSafresh1Core Perl does not have any support for wide and multibyte locales,
111056d68f1eSafresh1except Unicode UTF-8 locales.  This function, in conjunction with
111156d68f1eSafresh1L</mbtowc> and L</wctomb> may be used to roll your own decoding/encoding
111256d68f1eSafresh1of other types of multi-byte locales.
1113b8851fccSafresh1
111456d68f1eSafresh1Use C<undef> as the first parameter to this function to get the effect
111556d68f1eSafresh1of passing NULL as the first parameter to C<mblen>.  This resets any
111656d68f1eSafresh1shift state to its initial value.  The return value is undefined if
111756d68f1eSafresh1C<mbrlen> was substituted, so you should never rely on it.
1118898184e3Ssthen
111956d68f1eSafresh1When the first parameter is a scalar containing a value that either is a
112056d68f1eSafresh1PV string or can be forced into one, the return value is the number of
112156d68f1eSafresh1bytes occupied by the first character of that string; or 0 if that first
112256d68f1eSafresh1character is the wide NUL character; or negative if there is an error.
112356d68f1eSafresh1This is based on the locale that currently underlies the program,
112456d68f1eSafresh1regardless of whether or not the function is called from Perl code that
112556d68f1eSafresh1is within the scope of S<C<use locale>>.  Perl makes no attempt at
112656d68f1eSafresh1hiding from your code any differences in the C<errno> setting between
112756d68f1eSafresh1C<mblen> and C<mbrlen>.  It does set C<errno> to 0 before calling them.
1128898184e3Ssthen
112956d68f1eSafresh1The optional second parameter is ignored if it is larger than the
113056d68f1eSafresh1actual length of the first parameter string.
1131898184e3Ssthen
1132e5157e49Safresh1=item C<mbtowc>
1133898184e3Ssthen
113456d68f1eSafresh1This is the same as the C function C<mbtowc()> on unthreaded perls.  On
113556d68f1eSafresh1threaded perls, it transparently (almost) substitutes the more
113656d68f1eSafresh1thread-safe L<C<mbrtowc>(3)>, if available, instead of C<mbtowc>.
1137b8851fccSafresh1
113856d68f1eSafresh1Core Perl does not have any support for wide and multibyte locales,
113956d68f1eSafresh1except Unicode UTF-8 locales.  This function, in conjunction with
114056d68f1eSafresh1L</mblen> and L</wctomb> may be used to roll your own decoding/encoding
114156d68f1eSafresh1of other types of multi-byte locales.
114256d68f1eSafresh1
114356d68f1eSafresh1The first parameter is a scalar into which, upon success, the wide
114456d68f1eSafresh1character represented by the multi-byte string contained in the second
114556d68f1eSafresh1parameter is stored.  The optional third parameter is ignored if it is
114656d68f1eSafresh1larger than the actual length of the second parameter string.
114756d68f1eSafresh1
114856d68f1eSafresh1Use C<undef> as the second parameter to this function to get the effect
1149*e0680481Safresh1of passing NULL as the second parameter to C<mbtowc>.  This ignores the
1150*e0680481Safresh1first parameter, and resets any shift state to its initial value.  The
1151*e0680481Safresh1return value is undefined if C<mbrtowc> was substituted, so you should
1152*e0680481Safresh1never rely on it.
115356d68f1eSafresh1
115456d68f1eSafresh1When the second parameter is a scalar containing a value that either is
115556d68f1eSafresh1a PV string or can be forced into one, the return value is the number of
115656d68f1eSafresh1bytes occupied by the first character of that string; or 0 if that first
115756d68f1eSafresh1character is the wide NUL character; or negative if there is an error.
115856d68f1eSafresh1This is based on the locale that currently underlies the program,
115956d68f1eSafresh1regardless of whether or not the function is called from Perl code that
116056d68f1eSafresh1is within the scope of S<C<use locale>>.  Perl makes no attempt at
116156d68f1eSafresh1hiding from your code any differences in the C<errno> setting between
116256d68f1eSafresh1C<mbtowc> and C<mbrtowc>.  It does set C<errno> to 0 before calling
116356d68f1eSafresh1them.
1164898184e3Ssthen
1165e5157e49Safresh1=item C<memchr>
1166898184e3Ssthen
1167b8851fccSafresh1Not implemented.  C<memchr()> is C-specific, see L<perlfunc/index> instead.
1168898184e3Ssthen
1169e5157e49Safresh1=item C<memcmp>
1170898184e3Ssthen
1171b8851fccSafresh1Not implemented.  C<memcmp()> is C-specific, use C<eq> instead, see L<perlop>.
1172898184e3Ssthen
1173e5157e49Safresh1=item C<memcpy>
1174898184e3Ssthen
1175b8851fccSafresh1Not implemented.  C<memcpy()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1176898184e3Ssthen
1177e5157e49Safresh1=item C<memmove>
1178898184e3Ssthen
1179b8851fccSafresh1Not implemented.  C<memmove()> is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1180898184e3Ssthen
1181e5157e49Safresh1=item C<memset>
1182898184e3Ssthen
1183b8851fccSafresh1Not implemented.  C<memset()> is C-specific, use C<x> instead, see L<perlop>.
1184898184e3Ssthen
1185e5157e49Safresh1=item C<mkdir>
1186898184e3Ssthen
1187898184e3SsthenThis is identical to Perl's builtin C<mkdir()> function
1188898184e3Ssthenfor creating directories, see L<perlfunc/mkdir>.
1189898184e3Ssthen
1190e5157e49Safresh1=item C<mkfifo>
1191898184e3Ssthen
1192898184e3SsthenThis is similar to the C function C<mkfifo()> for creating
1193898184e3SsthenFIFO special files.
1194898184e3Ssthen
1195898184e3Ssthen	if (mkfifo($path, $mode)) { ....
1196898184e3Ssthen
1197898184e3SsthenReturns C<undef> on failure.  The C<$mode> is similar to the
1198898184e3Ssthenmode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
1199898184e3Ssthenyou B<must> specify the C<$mode>.
1200898184e3Ssthen
1201e5157e49Safresh1=item C<mktime>
1202898184e3Ssthen
1203898184e3SsthenConvert date/time info to a calendar time.
1204898184e3Ssthen
1205898184e3SsthenSynopsis:
1206898184e3Ssthen
1207e5157e49Safresh1	mktime(sec, min, hour, mday, mon, year, wday = 0,
1208e5157e49Safresh1	       yday = 0, isdst = -1)
1209898184e3Ssthen
1210b8851fccSafresh1The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1211b8851fccSafresh1I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
1212b8851fccSafresh1year (C<year>) is given in years since 1900; I<i.e.>, the year 1995 is 95; the
1213898184e3Ssthenyear 2001 is 101.  Consult your system's C<mktime()> manpage for details
1214898184e3Ssthenabout these and the other arguments.
1215898184e3Ssthen
1216898184e3SsthenCalendar time for December 12, 1995, at 10:30 am.
1217898184e3Ssthen
1218898184e3Ssthen	$time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
1219898184e3Ssthen	print "Date = ", POSIX::ctime($time_t);
1220898184e3Ssthen
1221898184e3SsthenReturns C<undef> on failure.
1222898184e3Ssthen
1223e5157e49Safresh1=item C<modf>
1224898184e3Ssthen
1225898184e3SsthenReturn the integral and fractional parts of a floating-point number.
1226898184e3Ssthen
1227898184e3Ssthen	($fractional, $integral) = POSIX::modf( 3.14 );
1228898184e3Ssthen
1229b8851fccSafresh1See also L</round>.
1230b8851fccSafresh1
1231b8851fccSafresh1=item C<NaN>
1232b8851fccSafresh1
1233b8851fccSafresh1The not-a-number as a constant:
1234b8851fccSafresh1
1235b8851fccSafresh1   use POSIX qw(NaN);
1236b8851fccSafresh1   my $nan = NaN;
1237b8851fccSafresh1
1238b8851fccSafresh1See also L</nan>, C</isnan>, and L</fpclassify>.
1239b8851fccSafresh1
1240b8851fccSafresh1=item C<nan>
1241b8851fccSafresh1
1242b8851fccSafresh1   my $nan = nan();
1243b8851fccSafresh1
1244eac174f2Safresh1Returns C<NaN>, not-a-number [C99].  Added in Perl v5.22.
1245b8851fccSafresh1
1246b8851fccSafresh1The returned NaN is always a I<quiet> NaN, as opposed to I<signaling>.
1247b8851fccSafresh1
1248b8851fccSafresh1With an argument, can be used to generate a NaN with I<payload>.
1249b8851fccSafresh1The argument is first interpreted as a floating point number,
1250b8851fccSafresh1but then any fractional parts are truncated (towards zero),
1251b8851fccSafresh1and the value is interpreted as an unsigned integer.
1252b8851fccSafresh1The bits of this integer are stored in the unused bits of the NaN.
1253b8851fccSafresh1
1254b8851fccSafresh1The result has a dual nature: it is a NaN, but it also carries
1255b8851fccSafresh1the integer inside it.  The integer can be retrieved with L</getpayload>.
1256b8851fccSafresh1Note, though, that the payload is not propagated, not even on copies,
1257b8851fccSafresh1and definitely not in arithmetic operations.
1258b8851fccSafresh1
1259b8851fccSafresh1How many bits fit in the NaN depends on what kind of floating points
1260b8851fccSafresh1are being used, but on the most common platforms (64-bit IEEE 754,
1261b8851fccSafresh1or the x86 80-bit long doubles) there are 51 and 61 bits available,
1262b8851fccSafresh1respectively.  (There would be 52 and 62, but the quiet/signaling
1263b8851fccSafresh1bit of NaNs takes away one.)  However, because of the floating-point-to-
1264b8851fccSafresh1integer-and-back conversions, please test carefully whether you get back
1265b8851fccSafresh1what you put in.  If your integers are only 32 bits wide, you probably
1266b8851fccSafresh1should not rely on more than 32 bits of payload.
1267b8851fccSafresh1
1268b8851fccSafresh1Whether a "signaling" NaN is in any way different from a "quiet" NaN,
1269b8851fccSafresh1depends on the platform.  Also note that the payload of the default
1270b8851fccSafresh1NaN (no argument to nan()) is not necessarily zero, use C<setpayload>
1271b8851fccSafresh1to explicitly set the payload.  On some platforms like the 32-bit x86,
1272b8851fccSafresh1(unless using the 80-bit long doubles) the signaling bit is not supported
1273b8851fccSafresh1at all.
1274b8851fccSafresh1
1275b8851fccSafresh1See also L</isnan>, L</NaN>, L</setpayload> and L</issignaling>.
1276b8851fccSafresh1
1277b8851fccSafresh1=item C<nearbyint>
1278b8851fccSafresh1
1279b8851fccSafresh1Returns the nearest integer to the argument, according to the current
1280eac174f2Safresh1rounding mode (see L</fegetround>) [C99].  Added in Perl v5.22.
1281b8851fccSafresh1
1282b8851fccSafresh1=item C<nextafter>
1283b8851fccSafresh1
1284b8851fccSafresh1Returns the next representable floating point number after C<x> in the
1285eac174f2Safresh1direction of C<y> [C99].  Added in Perl v5.22.
1286b8851fccSafresh1
1287b8851fccSafresh1 my $nextafter = POSIX::nextafter($x, $y);
1288b8851fccSafresh1
1289b8851fccSafresh1Like L</nexttoward>, but potentially less accurate.
1290b8851fccSafresh1
1291b8851fccSafresh1=item C<nexttoward>
1292b8851fccSafresh1
1293b8851fccSafresh1Returns the next representable floating point number after C<x> in the
1294eac174f2Safresh1direction of C<y> [C99].  Added in Perl v5.22.
1295b8851fccSafresh1
1296b8851fccSafresh1 my $nexttoward = POSIX::nexttoward($x, $y);
1297b8851fccSafresh1
1298b8851fccSafresh1Like L</nextafter>, but potentially more accurate.
1299b8851fccSafresh1
1300e5157e49Safresh1=item C<nice>
1301898184e3Ssthen
1302898184e3SsthenThis is similar to the C function C<nice()>, for changing
1303898184e3Ssthenthe scheduling preference of the current process.  Positive
1304b8851fccSafresh1arguments mean a more polite process, negative values a more
1305b8851fccSafresh1needy process.  Normal (non-root) user processes can only change towards
1306b8851fccSafresh1being more polite.
1307898184e3Ssthen
1308898184e3SsthenReturns C<undef> on failure.
1309898184e3Ssthen
1310e5157e49Safresh1=item C<offsetof>
1311898184e3Ssthen
1312b8851fccSafresh1Not implemented.  C<offsetof()> is C-specific, you probably want to see L<perlfunc/pack> instead.
1313898184e3Ssthen
1314e5157e49Safresh1=item C<open>
1315898184e3Ssthen
1316898184e3SsthenOpen a file for reading for writing.  This returns file descriptors, not
1317898184e3SsthenPerl filehandles.  Use C<POSIX::close> to close the file.
1318898184e3Ssthen
1319898184e3SsthenOpen a file read-only with mode 0666.
1320898184e3Ssthen
1321898184e3Ssthen	$fd = POSIX::open( "foo" );
1322898184e3Ssthen
1323898184e3SsthenOpen a file for read and write.
1324898184e3Ssthen
1325898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_RDWR );
1326898184e3Ssthen
1327898184e3SsthenOpen a file for write, with truncation.
1328898184e3Ssthen
1329e5157e49Safresh1	$fd = POSIX::open(
1330e5157e49Safresh1		"foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC
1331e5157e49Safresh1	);
1332898184e3Ssthen
1333898184e3SsthenCreate a new file with mode 0640.  Set up the file for writing.
1334898184e3Ssthen
1335e5157e49Safresh1	$fd = POSIX::open(
1336e5157e49Safresh1		"foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640
1337e5157e49Safresh1	);
1338898184e3Ssthen
1339898184e3SsthenReturns C<undef> on failure.
1340898184e3Ssthen
1341898184e3SsthenSee also L<perlfunc/sysopen>.
1342898184e3Ssthen
1343e5157e49Safresh1=item C<opendir>
1344898184e3Ssthen
1345898184e3SsthenOpen a directory for reading.
1346898184e3Ssthen
1347898184e3Ssthen	$dir = POSIX::opendir( "/var" );
1348898184e3Ssthen	@files = POSIX::readdir( $dir );
1349898184e3Ssthen	POSIX::closedir( $dir );
1350898184e3Ssthen
1351898184e3SsthenReturns C<undef> on failure.
1352898184e3Ssthen
1353e5157e49Safresh1=item C<pathconf>
1354898184e3Ssthen
1355898184e3SsthenRetrieves the value of a configurable limit on a file or directory.
1356898184e3Ssthen
1357898184e3SsthenThe following will determine the maximum length of the longest allowable
1358898184e3Ssthenpathname on the filesystem which holds C</var>.
1359898184e3Ssthen
1360e5157e49Safresh1	$path_max = POSIX::pathconf( "/var",
1361e5157e49Safresh1				      &POSIX::_PC_PATH_MAX );
1362898184e3Ssthen
1363898184e3SsthenReturns C<undef> on failure.
1364898184e3Ssthen
1365e5157e49Safresh1=item C<pause>
1366898184e3Ssthen
1367898184e3SsthenThis is similar to the C function C<pause()>, which suspends
1368898184e3Ssthenthe execution of the current process until a signal is received.
1369898184e3Ssthen
1370898184e3SsthenReturns C<undef> on failure.
1371898184e3Ssthen
1372e5157e49Safresh1=item C<perror>
1373898184e3Ssthen
1374898184e3SsthenThis is identical to the C function C<perror()>, which outputs to the
1375e5157e49Safresh1standard error stream the specified message followed by C<": "> and the
1376898184e3Ssthencurrent error string.  Use the C<warn()> function and the C<$!>
1377898184e3Ssthenvariable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
1378898184e3Ssthen
1379e5157e49Safresh1=item C<pipe>
1380898184e3Ssthen
1381898184e3SsthenCreate an interprocess channel.  This returns file descriptors like those
1382898184e3Ssthenreturned by C<POSIX::open>.
1383898184e3Ssthen
1384898184e3Ssthen	my ($read, $write) = POSIX::pipe();
1385898184e3Ssthen	POSIX::write( $write, "hello", 5 );
1386898184e3Ssthen	POSIX::read( $read, $buf, 5 );
1387898184e3Ssthen
1388898184e3SsthenSee also L<perlfunc/pipe>.
1389898184e3Ssthen
1390e5157e49Safresh1=item C<pow>
1391898184e3Ssthen
1392898184e3SsthenComputes C<$x> raised to the power C<$exponent>.
1393898184e3Ssthen
1394898184e3Ssthen	$ret = POSIX::pow( $x, $exponent );
1395898184e3Ssthen
1396898184e3SsthenYou can also use the C<**> operator, see L<perlop>.
1397898184e3Ssthen
1398e5157e49Safresh1=item C<printf>
1399898184e3Ssthen
1400b8851fccSafresh1Formats and prints the specified arguments to C<STDOUT>.
1401898184e3SsthenSee also L<perlfunc/printf>.
1402898184e3Ssthen
1403e5157e49Safresh1=item C<putc>
1404898184e3Ssthen
1405b8851fccSafresh1Not implemented.  C<putc()> is C-specific, see L<perlfunc/print> instead.
1406898184e3Ssthen
1407e5157e49Safresh1=item C<putchar>
1408898184e3Ssthen
1409b8851fccSafresh1Not implemented.  C<putchar()> is C-specific, see L<perlfunc/print> instead.
1410898184e3Ssthen
1411e5157e49Safresh1=item C<puts>
1412898184e3Ssthen
1413b8851fccSafresh1Not implemented.  C<puts()> is C-specific, see L<perlfunc/print> instead.
1414898184e3Ssthen
1415e5157e49Safresh1=item C<qsort>
1416898184e3Ssthen
1417b8851fccSafresh1Not implemented.  C<qsort()> is C-specific, see L<perlfunc/sort> instead.
1418898184e3Ssthen
1419e5157e49Safresh1=item C<raise>
1420898184e3Ssthen
1421898184e3SsthenSends the specified signal to the current process.
1422898184e3SsthenSee also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
1423898184e3Ssthen
1424e5157e49Safresh1=item C<rand>
1425898184e3Ssthen
1426b8851fccSafresh1Not implemented.  C<rand()> is non-portable, see L<perlfunc/rand> instead.
1427898184e3Ssthen
1428e5157e49Safresh1=item C<read>
1429898184e3Ssthen
1430898184e3SsthenRead from a file.  This uses file descriptors such as those obtained by
1431898184e3Ssthencalling C<POSIX::open>.  If the buffer C<$buf> is not large enough for the
1432898184e3Ssthenread then Perl will extend it to make room for the request.
1433898184e3Ssthen
1434898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1435898184e3Ssthen	$bytes = POSIX::read( $fd, $buf, 3 );
1436898184e3Ssthen
1437898184e3SsthenReturns C<undef> on failure.
1438898184e3Ssthen
1439898184e3SsthenSee also L<perlfunc/sysread>.
1440898184e3Ssthen
1441e5157e49Safresh1=item C<readdir>
1442898184e3Ssthen
1443898184e3SsthenThis is identical to Perl's builtin C<readdir()> function
1444898184e3Ssthenfor reading directory entries, see L<perlfunc/readdir>.
1445898184e3Ssthen
1446e5157e49Safresh1=item C<realloc>
1447898184e3Ssthen
1448b8851fccSafresh1Not implemented.  C<realloc()> is C-specific.  Perl does memory management transparently.
1449b8851fccSafresh1
1450b8851fccSafresh1=item C<remainder>
1451b8851fccSafresh1
1452b8851fccSafresh1Given C<x> and C<y>, returns the value S<C<x - n*y>>, where C<n> is the integer
1453eac174f2Safresh1closest to C<x>/C<y> [C99].  Added in Perl v5.22.
1454b8851fccSafresh1
1455b8851fccSafresh1 my $remainder = POSIX::remainder($x, $y)
1456b8851fccSafresh1
1457b8851fccSafresh1See also L</remquo>.
1458898184e3Ssthen
1459e5157e49Safresh1=item C<remove>
1460898184e3Ssthen
1461b46d8ef2Safresh1Deletes a name from the filesystem.  Calls L<perlfunc/unlink> for
1462b46d8ef2Safresh1files and L<perlfunc/rmdir> for directories.
1463898184e3Ssthen
1464b8851fccSafresh1=item C<remquo>
1465b8851fccSafresh1
1466b8851fccSafresh1Like L</remainder> but also returns the low-order bits of the quotient (n)
1467eac174f2Safresh1[C99].  Added in Perl v5.22.
1468b8851fccSafresh1
1469b8851fccSafresh1(This is quite esoteric interface, mainly used to implement numerical
1470b8851fccSafresh1algorithms.)
1471b8851fccSafresh1
1472e5157e49Safresh1=item C<rename>
1473898184e3Ssthen
1474898184e3SsthenThis is identical to Perl's builtin C<rename()> function
1475898184e3Ssthenfor renaming files, see L<perlfunc/rename>.
1476898184e3Ssthen
1477e5157e49Safresh1=item C<rewind>
1478898184e3Ssthen
1479898184e3SsthenSeeks to the beginning of the file.
1480898184e3Ssthen
1481e5157e49Safresh1=item C<rewinddir>
1482898184e3Ssthen
1483898184e3SsthenThis is identical to Perl's builtin C<rewinddir()> function for
1484898184e3Ssthenrewinding directory entry streams, see L<perlfunc/rewinddir>.
1485898184e3Ssthen
1486b8851fccSafresh1=item C<rint>
1487b8851fccSafresh1
1488b8851fccSafresh1Identical to L</lrint>.
1489b8851fccSafresh1
1490e5157e49Safresh1=item C<rmdir>
1491898184e3Ssthen
1492898184e3SsthenThis is identical to Perl's builtin C<rmdir()> function
1493898184e3Ssthenfor removing (empty) directories, see L<perlfunc/rmdir>.
1494898184e3Ssthen
1495b8851fccSafresh1=item C<round>
1496b8851fccSafresh1
1497b8851fccSafresh1Returns the integer (but still as floating point) nearest to the
1498eac174f2Safresh1argument [C99].  Added in Perl v5.22.
1499b8851fccSafresh1
1500b8851fccSafresh1See also L</ceil>, L</floor>, L</lround>, L</modf>, and L</trunc>.
1501b8851fccSafresh1
1502b8851fccSafresh1=item C<scalbn>
1503b8851fccSafresh1
1504eac174f2Safresh1Returns S<C<x * 2**y>> [C99].  Added in Perl v5.22.
1505b8851fccSafresh1
1506b8851fccSafresh1See also L</frexp> and L</ldexp>.
1507b8851fccSafresh1
1508e5157e49Safresh1=item C<scanf>
1509898184e3Ssthen
1510b8851fccSafresh1Not implemented.  C<scanf()> is C-specific, use E<lt>E<gt> and regular expressions instead,
1511898184e3Ssthensee L<perlre>.
1512898184e3Ssthen
1513e5157e49Safresh1=item C<setgid>
1514898184e3Ssthen
1515898184e3SsthenSets the real group identifier and the effective group identifier for
1516898184e3Ssthenthis process.  Similar to assigning a value to the Perl's builtin
1517898184e3SsthenC<$)> variable, see L<perlvar/$EGID>, except that the latter
1518898184e3Ssthenwill change only the real user identifier, and that the setgid()
1519898184e3Ssthenuses only a single numeric argument, as opposed to a space-separated
1520898184e3Ssthenlist of numbers.
1521898184e3Ssthen
1522e5157e49Safresh1=item C<setjmp>
1523898184e3Ssthen
1524b8851fccSafresh1Not implemented.  C<setjmp()> is C-specific: use C<eval {}> instead,
1525898184e3Ssthensee L<perlfunc/eval>.
1526898184e3Ssthen
1527e5157e49Safresh1=item C<setlocale>
1528898184e3Ssthen
152956d68f1eSafresh1WARNING!  Prior to Perl 5.28 or on a system that does not support
153056d68f1eSafresh1thread-safe locale operations, do NOT use this function in a
153156d68f1eSafresh1L<thread|threads>.  The locale will change in all other threads at the
153256d68f1eSafresh1same time, and should your thread get paused by the operating system,
153356d68f1eSafresh1and another started, that thread will not have the locale it is
153456d68f1eSafresh1expecting.  On some platforms, there can be a race leading to segfaults
153556d68f1eSafresh1if two threads call this function nearly simultaneously.  This warning
153656d68f1eSafresh1does not apply on unthreaded builds, or on perls where
153756d68f1eSafresh1C<${^SAFE_LOCALES}> exists and is non-zero; namely Perl 5.28 and later
153856d68f1eSafresh1compiled to be locale-thread-safe.
1539b8851fccSafresh1
154056d68f1eSafresh1This function
154156d68f1eSafresh1modifies and queries the program's underlying locale.  Users of this
1542e5157e49Safresh1function should read L<perllocale>, whch provides a comprehensive
1543e5157e49Safresh1discussion of Perl locale handling, knowledge of which is necessary to
1544e5157e49Safresh1properly use this function.  It contains
1545e5157e49Safresh1L<a section devoted to this function|perllocale/The setlocale function>.
1546e5157e49Safresh1The discussion here is merely a summary reference for C<setlocale()>.
1547e5157e49Safresh1Note that Perl itself is almost entirely unaffected by the locale
1548e5157e49Safresh1except within the scope of S<C<"use locale">>.  (Exceptions are listed
154956d68f1eSafresh1in L<perllocale/Not within the scope of "use locale">, and
155056d68f1eSafresh1locale-dependent functions within the POSIX module ARE always affected
155156d68f1eSafresh1by the current locale.)
1552e5157e49Safresh1
1553e5157e49Safresh1The following examples assume
1554898184e3Ssthen
1555898184e3Ssthen	use POSIX qw(setlocale LC_ALL LC_CTYPE);
1556898184e3Ssthen
1557898184e3Ssthenhas been issued.
1558898184e3Ssthen
1559898184e3SsthenThe following will set the traditional UNIX system locale behavior
1560898184e3Ssthen(the second argument C<"C">).
1561898184e3Ssthen
1562898184e3Ssthen	$loc = setlocale( LC_ALL, "C" );
1563898184e3Ssthen
1564e5157e49Safresh1The following will query the current C<LC_CTYPE> category.  (No second
1565898184e3Ssthenargument means 'query'.)
1566898184e3Ssthen
1567898184e3Ssthen	$loc = setlocale( LC_CTYPE );
1568898184e3Ssthen
1569e5157e49Safresh1The following will set the C<LC_CTYPE> behaviour according to the locale
1570898184e3Ssthenenvironment variables (the second argument C<"">).
1571e5157e49Safresh1Please see your system's C<setlocale(3)> documentation for the locale
1572898184e3Ssthenenvironment variables' meaning or consult L<perllocale>.
1573898184e3Ssthen
1574898184e3Ssthen	$loc = setlocale( LC_CTYPE, "" );
1575898184e3Ssthen
1576e5157e49Safresh1The following will set the C<LC_COLLATE> behaviour to Argentinian
1577898184e3SsthenSpanish. B<NOTE>: The naming and availability of locales depends on
1578898184e3Ssthenyour operating system. Please consult L<perllocale> for how to find
1579898184e3Ssthenout which locales are available in your system.
1580898184e3Ssthen
1581898184e3Ssthen	$loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
1582898184e3Ssthen
1583b8851fccSafresh1=item C<setpayload>
1584b8851fccSafresh1
1585b8851fccSafresh1	use POSIX ':nan_payload';
1586b8851fccSafresh1	setpayload($var, $payload);
1587b8851fccSafresh1
1588eac174f2Safresh1Sets the C<NaN> payload of var.  Added in Perl v5.24.
1589b8851fccSafresh1
1590b8851fccSafresh1NOTE: the NaN payload APIs are based on the latest (as of June 2015)
1591b8851fccSafresh1proposed ISO C interfaces, but they are not yet a standard.  Things
1592b8851fccSafresh1may change.
1593b8851fccSafresh1
1594b8851fccSafresh1See L</nan> for more discussion about C<NaN>.
1595b8851fccSafresh1
1596b8851fccSafresh1See also L</setpayloadsig>, L</isnan>, L</getpayload>, and L</issignaling>.
1597b8851fccSafresh1
1598b8851fccSafresh1=item C<setpayloadsig>
1599b8851fccSafresh1
1600b8851fccSafresh1	use POSIX ':nan_payload';
1601b8851fccSafresh1	setpayloadsig($var, $payload);
1602b8851fccSafresh1
1603eac174f2Safresh1Like L</setpayload> but also makes the NaN I<signaling>.  Added in Perl
1604eac174f2Safresh1v5.24.
1605b8851fccSafresh1
1606b8851fccSafresh1Depending on the platform the NaN may or may not behave differently.
1607b8851fccSafresh1
1608b8851fccSafresh1Note the API instability warning in L</setpayload>.
1609b8851fccSafresh1
1610b8851fccSafresh1Note that because how the floating point formats work out, on the most
1611b8851fccSafresh1common platforms signaling payload of zero is best avoided,
1612b8851fccSafresh1since it might end up being identical to C<+Inf>.
1613b8851fccSafresh1
1614b8851fccSafresh1See also L</nan>, L</isnan>, L</getpayload>, and L</issignaling>.
1615b8851fccSafresh1
1616e5157e49Safresh1=item C<setpgid>
1617898184e3Ssthen
1618898184e3SsthenThis is similar to the C function C<setpgid()> for
1619898184e3Ssthensetting the process group identifier of the current process.
1620898184e3Ssthen
1621898184e3SsthenReturns C<undef> on failure.
1622898184e3Ssthen
1623e5157e49Safresh1=item C<setsid>
1624898184e3Ssthen
1625898184e3SsthenThis is identical to the C function C<setsid()> for
1626898184e3Ssthensetting the session identifier of the current process.
1627898184e3Ssthen
1628e5157e49Safresh1=item C<setuid>
1629898184e3Ssthen
1630898184e3SsthenSets the real user identifier and the effective user identifier for
1631898184e3Ssthenthis process.  Similar to assigning a value to the Perl's builtin
1632898184e3SsthenC<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
1633898184e3Ssthenwill change only the real user identifier.
1634898184e3Ssthen
1635e5157e49Safresh1=item C<sigaction>
1636898184e3Ssthen
1637898184e3SsthenDetailed signal management.  This uses C<POSIX::SigAction> objects for
1638898184e3Ssthenthe C<action> and C<oldaction> arguments (the oldaction can also be
1639898184e3Ssthenjust a hash reference).  Consult your system's C<sigaction> manpage
1640eac174f2Safresh1for details, see also L</POSIX::SigRt>.
1641898184e3Ssthen
1642898184e3SsthenSynopsis:
1643898184e3Ssthen
1644898184e3Ssthen	sigaction(signal, action, oldaction = 0)
1645898184e3Ssthen
1646898184e3SsthenReturns C<undef> on failure.  The C<signal> must be a number (like
1647e5157e49Safresh1C<SIGHUP>), not a string (like C<"SIGHUP">), though Perl does try hard
1648898184e3Ssthento understand you.
1649898184e3Ssthen
1650e5157e49Safresh1If you use the C<SA_SIGINFO> flag, the signal handler will in addition to
1651898184e3Ssthenthe first argument, the signal name, also receive a second argument, a
1652898184e3Ssthenhash reference, inside which are the following keys with the following
1653898184e3Ssthensemantics, as defined by POSIX/SUSv3:
1654898184e3Ssthen
1655898184e3Ssthen    signo       the signal number
1656898184e3Ssthen    errno       the error number
1657898184e3Ssthen    code        if this is zero or less, the signal was sent by
1658898184e3Ssthen                a user process and the uid and pid make sense,
1659898184e3Ssthen                otherwise the signal was sent by the kernel
1660898184e3Ssthen
1661b8851fccSafresh1The constants for specific C<code> values can be imported individually
1662eac174f2Safresh1or using the C<:signal_h_si_code> tag, since Perl v5.24.
1663b8851fccSafresh1
1664898184e3SsthenThe following are also defined by POSIX/SUSv3, but unfortunately
1665898184e3Ssthennot very widely implemented:
1666898184e3Ssthen
1667898184e3Ssthen    pid         the process id generating the signal
1668898184e3Ssthen    uid         the uid of the process id generating the signal
1669898184e3Ssthen    status      exit value or signal for SIGCHLD
1670898184e3Ssthen    band        band event for SIGPOLL
1671b8851fccSafresh1    addr        address of faulting instruction or memory
1672b8851fccSafresh1                reference for SIGILL, SIGFPE, SIGSEGV or SIGBUS
1673898184e3Ssthen
1674898184e3SsthenA third argument is also passed to the handler, which contains a copy
1675e5157e49Safresh1of the raw binary contents of the C<siginfo> structure: if a system has
1676e5157e49Safresh1some non-POSIX fields, this third argument is where to C<unpack()> them
1677898184e3Ssthenfrom.
1678898184e3Ssthen
1679e5157e49Safresh1Note that not all C<siginfo> values make sense simultaneously (some are
1680898184e3Ssthenvalid only for certain signals, for example), and not all values make
1681898184e3Ssthensense from Perl perspective, you should to consult your system's
1682898184e3SsthenC<sigaction> and possibly also C<siginfo> documentation.
1683898184e3Ssthen
1684e5157e49Safresh1=item C<siglongjmp>
1685898184e3Ssthen
1686b8851fccSafresh1Not implemented.  C<siglongjmp()> is C-specific: use L<perlfunc/die> instead.
1687b8851fccSafresh1
1688b8851fccSafresh1=item C<signbit>
1689b8851fccSafresh1
1690b8851fccSafresh1Returns zero for positive arguments, non-zero for negative arguments [C99].
1691eac174f2Safresh1Added in Perl v5.22.
1692898184e3Ssthen
1693e5157e49Safresh1=item C<sigpending>
1694898184e3Ssthen
1695898184e3SsthenExamine signals that are blocked and pending.  This uses C<POSIX::SigSet>
1696898184e3Ssthenobjects for the C<sigset> argument.  Consult your system's C<sigpending>
1697898184e3Ssthenmanpage for details.
1698898184e3Ssthen
1699898184e3SsthenSynopsis:
1700898184e3Ssthen
1701898184e3Ssthen	sigpending(sigset)
1702898184e3Ssthen
1703898184e3SsthenReturns C<undef> on failure.
1704898184e3Ssthen
1705e5157e49Safresh1=item C<sigprocmask>
1706898184e3Ssthen
1707898184e3SsthenChange and/or examine calling process's signal mask.  This uses
1708898184e3SsthenC<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
1709898184e3SsthenConsult your system's C<sigprocmask> manpage for details.
1710898184e3Ssthen
1711898184e3SsthenSynopsis:
1712898184e3Ssthen
1713898184e3Ssthen	sigprocmask(how, sigset, oldsigset = 0)
1714898184e3Ssthen
1715898184e3SsthenReturns C<undef> on failure.
1716898184e3Ssthen
1717898184e3SsthenNote that you can't reliably block or unblock a signal from its own signal
1718898184e3Ssthenhandler if you're using safe signals. Other signals can be blocked or unblocked
1719898184e3Ssthenreliably.
1720898184e3Ssthen
1721e5157e49Safresh1=item C<sigsetjmp>
1722898184e3Ssthen
1723b8851fccSafresh1Not implemented.  C<sigsetjmp()> is C-specific: use C<eval {}> instead,
1724898184e3Ssthensee L<perlfunc/eval>.
1725898184e3Ssthen
1726e5157e49Safresh1=item C<sigsuspend>
1727898184e3Ssthen
1728898184e3SsthenInstall a signal mask and suspend process until signal arrives.  This uses
1729898184e3SsthenC<POSIX::SigSet> objects for the C<signal_mask> argument.  Consult your
1730898184e3Ssthensystem's C<sigsuspend> manpage for details.
1731898184e3Ssthen
1732898184e3SsthenSynopsis:
1733898184e3Ssthen
1734898184e3Ssthen	sigsuspend(signal_mask)
1735898184e3Ssthen
1736898184e3SsthenReturns C<undef> on failure.
1737898184e3Ssthen
1738e5157e49Safresh1=item C<sin>
1739898184e3Ssthen
1740898184e3SsthenThis is identical to Perl's builtin C<sin()> function
1741898184e3Ssthenfor returning the sine of the numerical argument,
1742898184e3Ssthensee L<perlfunc/sin>.  See also L<Math::Trig>.
1743898184e3Ssthen
1744e5157e49Safresh1=item C<sinh>
1745898184e3Ssthen
1746898184e3SsthenThis is identical to the C function C<sinh()>
1747898184e3Ssthenfor returning the hyperbolic sine of the numerical argument.
1748898184e3SsthenSee also L<Math::Trig>.
1749898184e3Ssthen
1750e5157e49Safresh1=item C<sleep>
1751898184e3Ssthen
1752898184e3SsthenThis is functionally identical to Perl's builtin C<sleep()> function
1753898184e3Ssthenfor suspending the execution of the current for process for certain
1754898184e3Ssthennumber of seconds, see L<perlfunc/sleep>.  There is one significant
1755898184e3Ssthendifference, however: C<POSIX::sleep()> returns the number of
1756898184e3SsthenB<unslept> seconds, while the C<CORE::sleep()> returns the
1757898184e3Ssthennumber of slept seconds.
1758898184e3Ssthen
1759e5157e49Safresh1=item C<sprintf>
1760898184e3Ssthen
1761898184e3SsthenThis is similar to Perl's builtin C<sprintf()> function
1762898184e3Ssthenfor returning a string that has the arguments formatted as requested,
1763898184e3Ssthensee L<perlfunc/sprintf>.
1764898184e3Ssthen
1765e5157e49Safresh1=item C<sqrt>
1766898184e3Ssthen
1767898184e3SsthenThis is identical to Perl's builtin C<sqrt()> function.
1768898184e3Ssthenfor returning the square root of the numerical argument,
1769898184e3Ssthensee L<perlfunc/sqrt>.
1770898184e3Ssthen
1771e5157e49Safresh1=item C<srand>
1772898184e3Ssthen
1773898184e3SsthenGive a seed the pseudorandom number generator, see L<perlfunc/srand>.
1774898184e3Ssthen
1775e5157e49Safresh1=item C<sscanf>
1776898184e3Ssthen
1777b8851fccSafresh1Not implemented.  C<sscanf()> is C-specific, use regular expressions instead,
1778898184e3Ssthensee L<perlre>.
1779898184e3Ssthen
1780e5157e49Safresh1=item C<stat>
1781898184e3Ssthen
1782898184e3SsthenThis is identical to Perl's builtin C<stat()> function
1783898184e3Ssthenfor returning information about files and directories.
1784898184e3Ssthen
1785e5157e49Safresh1=item C<strcat>
1786898184e3Ssthen
1787b8851fccSafresh1Not implemented.  C<strcat()> is C-specific, use C<.=> instead, see L<perlop>.
1788898184e3Ssthen
1789e5157e49Safresh1=item C<strchr>
1790898184e3Ssthen
1791b8851fccSafresh1Not implemented.  C<strchr()> is C-specific, see L<perlfunc/index> instead.
1792898184e3Ssthen
1793e5157e49Safresh1=item C<strcmp>
1794898184e3Ssthen
1795b8851fccSafresh1Not implemented.  C<strcmp()> is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
1796898184e3Ssthen
1797e5157e49Safresh1=item C<strcoll>
1798898184e3Ssthen
1799898184e3SsthenThis is identical to the C function C<strcoll()>
1800898184e3Ssthenfor collating (comparing) strings transformed using
1801898184e3Ssthenthe C<strxfrm()> function.  Not really needed since
1802898184e3SsthenPerl can do this transparently, see L<perllocale>.
1803898184e3Ssthen
18049f11ffb7Safresh1Beware that in a UTF-8 locale, anything you pass to this function must
18059f11ffb7Safresh1be in UTF-8; and when not in a UTF-8 locale, anything passed must not be
18069f11ffb7Safresh1UTF-8 encoded.
18079f11ffb7Safresh1
1808eac174f2Safresh1Note also that it doesn't make sense for a string to be encoded in one
1809eac174f2Safresh1locale (say, ISO-8859-6, Arabic) and to collate it based on another
1810eac174f2Safresh1(like ISO-8859-7, Greek).  The results will be essentially meaningless.
1811eac174f2Safresh1
1812e5157e49Safresh1=item C<strcpy>
1813898184e3Ssthen
1814b8851fccSafresh1Not implemented.  C<strcpy()> is C-specific, use C<=> instead, see L<perlop>.
1815898184e3Ssthen
1816e5157e49Safresh1=item C<strcspn>
1817898184e3Ssthen
1818b8851fccSafresh1Not implemented.  C<strcspn()> is C-specific, use regular expressions instead,
1819898184e3Ssthensee L<perlre>.
1820898184e3Ssthen
1821e5157e49Safresh1=item C<strerror>
1822898184e3Ssthen
1823898184e3SsthenReturns the error string for the specified errno.
1824b8851fccSafresh1Identical to the string form of C<$!>, see L<perlvar/$ERRNO>.
1825898184e3Ssthen
1826e5157e49Safresh1=item C<strftime>
1827898184e3Ssthen
1828898184e3SsthenConvert date and time information to string.  Returns the string.
1829898184e3Ssthen
1830898184e3SsthenSynopsis:
1831898184e3Ssthen
1832e5157e49Safresh1	strftime(fmt, sec, min, hour, mday, mon, year,
1833e5157e49Safresh1		 wday = -1, yday = -1, isdst = -1)
1834898184e3Ssthen
1835b8851fccSafresh1The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero,
1836b8851fccSafresh1I<i.e.>, January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1.  The
1837b8851fccSafresh1year (C<year>) is given in years since 1900, I<i.e.>, the year 1995 is 95; the
1838898184e3Ssthenyear 2001 is 101.  Consult your system's C<strftime()> manpage for details
1839898184e3Ssthenabout these and the other arguments.
1840898184e3Ssthen
1841898184e3SsthenIf you want your code to be portable, your format (C<fmt>) argument
1842898184e3Ssthenshould use only the conversion specifiers defined by the ANSI C
1843*e0680481Safresh1standard (C99, to play safe).  These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
1844898184e3SsthenBut even then, the B<results> of some of the conversion specifiers are
1845898184e3Ssthennon-portable.  For example, the specifiers C<aAbBcpZ> change according
1846898184e3Ssthento the locale settings of the user, and both how to set locales (the
1847898184e3Ssthenlocale names) and what output to expect are non-standard.
1848898184e3SsthenThe specifier C<c> changes according to the timezone settings of the
1849898184e3Ssthenuser and the timezone computation rules of the operating system.
1850898184e3SsthenThe C<Z> specifier is notoriously unportable since the names of
1851898184e3Ssthentimezones are non-standard. Sticking to the numeric specifiers is the
1852898184e3Ssthensafest route.
1853898184e3Ssthen
1854898184e3SsthenThe given arguments are made consistent as though by calling
1855898184e3SsthenC<mktime()> before calling your system's C<strftime()> function,
1856898184e3Ssthenexcept that the C<isdst> value is not affected.
1857898184e3Ssthen
1858898184e3SsthenThe string for Tuesday, December 12, 1995.
1859898184e3Ssthen
1860e5157e49Safresh1	$str = POSIX::strftime( "%A, %B %d, %Y",
1861e5157e49Safresh1				 0, 0, 0, 12, 11, 95, 2 );
1862898184e3Ssthen	print "$str\n";
1863898184e3Ssthen
1864e5157e49Safresh1=item C<strlen>
1865898184e3Ssthen
1866b8851fccSafresh1Not implemented.  C<strlen()> is C-specific, use C<length()> instead, see L<perlfunc/length>.
1867898184e3Ssthen
1868e5157e49Safresh1=item C<strncat>
1869898184e3Ssthen
1870b8851fccSafresh1Not implemented.  C<strncat()> is C-specific, use C<.=> instead, see L<perlop>.
1871898184e3Ssthen
1872e5157e49Safresh1=item C<strncmp>
1873898184e3Ssthen
1874b8851fccSafresh1Not implemented.  C<strncmp()> is C-specific, use C<eq> instead, see L<perlop>.
1875898184e3Ssthen
1876e5157e49Safresh1=item C<strncpy>
1877898184e3Ssthen
1878b8851fccSafresh1Not implemented.  C<strncpy()> is C-specific, use C<=> instead, see L<perlop>.
1879898184e3Ssthen
1880e5157e49Safresh1=item C<strpbrk>
1881898184e3Ssthen
1882b8851fccSafresh1Not implemented.  C<strpbrk()> is C-specific, use regular expressions instead,
1883898184e3Ssthensee L<perlre>.
1884898184e3Ssthen
1885e5157e49Safresh1=item C<strrchr>
1886898184e3Ssthen
1887b8851fccSafresh1Not implemented.  C<strrchr()> is C-specific, see L<perlfunc/rindex> instead.
1888898184e3Ssthen
1889e5157e49Safresh1=item C<strspn>
1890898184e3Ssthen
1891b8851fccSafresh1Not implemented.  C<strspn()> is C-specific, use regular expressions instead,
1892898184e3Ssthensee L<perlre>.
1893898184e3Ssthen
1894e5157e49Safresh1=item C<strstr>
1895898184e3Ssthen
1896898184e3SsthenThis is identical to Perl's builtin C<index()> function,
1897898184e3Ssthensee L<perlfunc/index>.
1898898184e3Ssthen
1899e5157e49Safresh1=item C<strtod>
1900898184e3Ssthen
1901898184e3SsthenString to double translation. Returns the parsed number and the number
1902898184e3Ssthenof characters in the unparsed portion of the string.  Truly
1903e5157e49Safresh1POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1904b8851fccSafresh1error, so clear C<$!> before calling C<strtod>.  However, non-POSIX systems
1905e5157e49Safresh1may not check for overflow, and therefore will never set C<$!>.
1906898184e3Ssthen
190756d68f1eSafresh1C<strtod> respects any POSIX C<setlocale()> C<LC_NUMERIC> settings,
1908e5157e49Safresh1regardless of whether or not it is called from Perl code that is within
190956d68f1eSafresh1the scope of S<C<use locale>>.  Prior to Perl 5.28, or when operating in
191056d68f1eSafresh1a non thread-safe environment, it should not be used in a threaded
191156d68f1eSafresh1application unless it's certain that the underlying locale is C
19129f11ffb7Safresh1or POSIX.  This is because it otherwise changes the locale, which
19139f11ffb7Safresh1globally affects all threads simultaneously.
1914898184e3Ssthen
1915e5157e49Safresh1To parse a string C<$str> as a floating point number use
1916898184e3Ssthen
1917898184e3Ssthen    $! = 0;
1918898184e3Ssthen    ($num, $n_unparsed) = POSIX::strtod($str);
1919898184e3Ssthen
1920e5157e49Safresh1The second returned item and C<$!> can be used to check for valid input:
1921898184e3Ssthen
1922898184e3Ssthen    if (($str eq '') || ($n_unparsed != 0) || $!) {
1923898184e3Ssthen        die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
1924898184e3Ssthen    }
1925898184e3Ssthen
1926b8851fccSafresh1When called in a scalar context C<strtod> returns the parsed number.
1927898184e3Ssthen
1928e5157e49Safresh1=item C<strtok>
1929898184e3Ssthen
1930b8851fccSafresh1Not implemented.  C<strtok()> is C-specific, use regular expressions instead, see
1931898184e3SsthenL<perlre>, or L<perlfunc/split>.
1932898184e3Ssthen
1933e5157e49Safresh1=item C<strtol>
1934898184e3Ssthen
1935898184e3SsthenString to (long) integer translation.  Returns the parsed number and
1936898184e3Ssthenthe number of characters in the unparsed portion of the string.  Truly
1937e5157e49Safresh1POSIX-compliant systems set C<$!> (C<$ERRNO>) to indicate a translation
1938e5157e49Safresh1error, so clear C<$!> before calling C<strtol>.  However, non-POSIX systems
1939e5157e49Safresh1may not check for overflow, and therefore will never set C<$!>.
1940898184e3Ssthen
1941e5157e49Safresh1C<strtol> should respect any POSIX I<setlocale()> settings.
1942898184e3Ssthen
1943e5157e49Safresh1To parse a string C<$str> as a number in some base C<$base> use
1944898184e3Ssthen
1945898184e3Ssthen    $! = 0;
1946898184e3Ssthen    ($num, $n_unparsed) = POSIX::strtol($str, $base);
1947898184e3Ssthen
1948898184e3SsthenThe base should be zero or between 2 and 36, inclusive.  When the base
1949b8851fccSafresh1is zero or omitted C<strtol> will use the string itself to determine the
1950898184e3Ssthenbase: a leading "0x" or "0X" means hexadecimal; a leading "0" means
1951898184e3Ssthenoctal; any other leading characters mean decimal.  Thus, "1234" is
1952898184e3Ssthenparsed as a decimal number, "01234" as an octal number, and "0x1234"
1953898184e3Ssthenas a hexadecimal number.
1954898184e3Ssthen
1955e5157e49Safresh1The second returned item and C<$!> can be used to check for valid input:
1956898184e3Ssthen
1957898184e3Ssthen    if (($str eq '') || ($n_unparsed != 0) || !$!) {
1958898184e3Ssthen        die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
1959898184e3Ssthen    }
1960898184e3Ssthen
1961b8851fccSafresh1When called in a scalar context C<strtol> returns the parsed number.
1962b8851fccSafresh1
1963b8851fccSafresh1=item C<strtold>
1964b8851fccSafresh1
1965b8851fccSafresh1Like L</strtod> but for long doubles.  Defined only if the
1966b8851fccSafresh1system supports long doubles.
1967898184e3Ssthen
1968e5157e49Safresh1=item C<strtoul>
1969898184e3Ssthen
1970e5157e49Safresh1String to unsigned (long) integer translation.  C<strtoul()> is identical
1971e5157e49Safresh1to C<strtol()> except that C<strtoul()> only parses unsigned integers.  See
1972898184e3SsthenL</strtol> for details.
1973898184e3Ssthen
1974e5157e49Safresh1Note: Some vendors supply C<strtod()> and C<strtol()> but not C<strtoul()>.
1975e5157e49Safresh1Other vendors that do supply C<strtoul()> parse "-1" as a valid value.
1976898184e3Ssthen
1977e5157e49Safresh1=item C<strxfrm>
1978898184e3Ssthen
1979898184e3SsthenString transformation.  Returns the transformed string.
1980898184e3Ssthen
1981898184e3Ssthen	$dst = POSIX::strxfrm( $src );
1982898184e3Ssthen
1983eac174f2Safresh1Used with C<eq> or C<cmp> as an alternative to C<L</strcoll>>.
1984898184e3Ssthen
1985898184e3SsthenNot really needed since Perl can do this transparently, see
1986898184e3SsthenL<perllocale>.
1987898184e3Ssthen
1988*e0680481Safresh1Unlike the libc C<strxfrm>, this allows NUL characters in the input
1989*e0680481Safresh1C<$src>.
1990*e0680481Safresh1
1991*e0680481Safresh1It doesn't make sense for a string to be encoded in one locale (say,
1992*e0680481Safresh1ISO-8859-6, Arabic) and to collate it based on another (like ISO-8859-7,
1993*e0680481Safresh1Greek).  Perl assumes that the current C<LC_CTYPE> locale correctly
1994*e0680481Safresh1represents the encoding of C<$src>, and ignores the value of
1995*e0680481Safresh1C<LC_COLLATE>.
19969f11ffb7Safresh1
1997e5157e49Safresh1=item C<sysconf>
1998898184e3Ssthen
1999898184e3SsthenRetrieves values of system configurable variables.
2000898184e3Ssthen
2001898184e3SsthenThe following will get the machine's clock speed.
2002898184e3Ssthen
2003898184e3Ssthen	$clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
2004898184e3Ssthen
2005898184e3SsthenReturns C<undef> on failure.
2006898184e3Ssthen
2007e5157e49Safresh1=item C<system>
2008898184e3Ssthen
2009898184e3SsthenThis is identical to Perl's builtin C<system()> function, see
2010898184e3SsthenL<perlfunc/system>.
2011898184e3Ssthen
2012e5157e49Safresh1=item C<tan>
2013898184e3Ssthen
2014898184e3SsthenThis is identical to the C function C<tan()>, returning the
2015898184e3Ssthentangent of the numerical argument.  See also L<Math::Trig>.
2016898184e3Ssthen
2017e5157e49Safresh1=item C<tanh>
2018898184e3Ssthen
2019898184e3SsthenThis is identical to the C function C<tanh()>, returning the
2020898184e3Ssthenhyperbolic tangent of the numerical argument.   See also L<Math::Trig>.
2021898184e3Ssthen
2022e5157e49Safresh1=item C<tcdrain>
2023898184e3Ssthen
2024898184e3SsthenThis is similar to the C function C<tcdrain()> for draining
2025898184e3Ssthenthe output queue of its argument stream.
2026898184e3Ssthen
2027898184e3SsthenReturns C<undef> on failure.
2028898184e3Ssthen
2029e5157e49Safresh1=item C<tcflow>
2030898184e3Ssthen
2031898184e3SsthenThis is similar to the C function C<tcflow()> for controlling
2032898184e3Ssthenthe flow of its argument stream.
2033898184e3Ssthen
2034898184e3SsthenReturns C<undef> on failure.
2035898184e3Ssthen
2036e5157e49Safresh1=item C<tcflush>
2037898184e3Ssthen
2038898184e3SsthenThis is similar to the C function C<tcflush()> for flushing
2039898184e3Ssthenthe I/O buffers of its argument stream.
2040898184e3Ssthen
2041898184e3SsthenReturns C<undef> on failure.
2042898184e3Ssthen
2043e5157e49Safresh1=item C<tcgetpgrp>
2044898184e3Ssthen
2045898184e3SsthenThis is identical to the C function C<tcgetpgrp()> for returning the
2046898184e3Ssthenprocess group identifier of the foreground process group of the controlling
2047898184e3Ssthenterminal.
2048898184e3Ssthen
2049e5157e49Safresh1=item C<tcsendbreak>
2050898184e3Ssthen
2051898184e3SsthenThis is similar to the C function C<tcsendbreak()> for sending
2052898184e3Ssthena break on its argument stream.
2053898184e3Ssthen
2054898184e3SsthenReturns C<undef> on failure.
2055898184e3Ssthen
2056e5157e49Safresh1=item C<tcsetpgrp>
2057898184e3Ssthen
2058898184e3SsthenThis is similar to the C function C<tcsetpgrp()> for setting the
2059898184e3Ssthenprocess group identifier of the foreground process group of the controlling
2060898184e3Ssthenterminal.
2061898184e3Ssthen
2062898184e3SsthenReturns C<undef> on failure.
2063898184e3Ssthen
2064b8851fccSafresh1=item C<tgamma>
2065b8851fccSafresh1
2066eac174f2Safresh1The Gamma function [C99].  Added in Perl v5.22.
2067b8851fccSafresh1
2068b8851fccSafresh1See also L</lgamma>.
2069b8851fccSafresh1
2070e5157e49Safresh1=item C<time>
2071898184e3Ssthen
2072898184e3SsthenThis is identical to Perl's builtin C<time()> function
2073898184e3Ssthenfor returning the number of seconds since the epoch
2074898184e3Ssthen(whatever it is for the system), see L<perlfunc/time>.
2075898184e3Ssthen
2076e5157e49Safresh1=item C<times>
2077898184e3Ssthen
2078e5157e49Safresh1The C<times()> function returns elapsed realtime since some point in the past
2079898184e3Ssthen(such as system startup), user and system times for this process, and user
2080898184e3Ssthenand system times used by child processes.  All times are returned in clock
2081898184e3Ssthenticks.
2082898184e3Ssthen
2083e5157e49Safresh1    ($realtime, $user, $system, $cuser, $csystem)
2084e5157e49Safresh1	= POSIX::times();
2085898184e3Ssthen
2086898184e3SsthenNote: Perl's builtin C<times()> function returns four values, measured in
2087898184e3Ssthenseconds.
2088898184e3Ssthen
2089e5157e49Safresh1=item C<tmpfile>
2090898184e3Ssthen
2091b8851fccSafresh1Not implemented.  Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
2092898184e3Ssthen
2093e5157e49Safresh1=item C<tmpnam>
2094898184e3Ssthen
2095898184e3SsthenFor security reasons, which are probably detailed in your system's
2096e5157e49Safresh1documentation for the C library C<tmpnam()> function, this interface
2097eac174f2Safresh1is no longer available since Perl v5.26; instead use L<File::Temp>.
2098898184e3Ssthen
2099e5157e49Safresh1=item C<tolower>
2100898184e3Ssthen
2101eac174f2Safresh1This function has been removed as of Perl v5.26.
2102898184e3SsthenThis is identical to the C function, except that it can apply to a single
2103b8851fccSafresh1character or to a whole string, and currently operates as if the locale
2104b8851fccSafresh1always is "C".  Consider using the C<lc()> function, see L<perlfunc/lc>,
2105898184e3Ssthensee L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
2106898184e3Ssthenstrings.
2107898184e3Ssthen
2108e5157e49Safresh1=item C<toupper>
2109898184e3Ssthen
2110eac174f2Safresh1This function has been removed as of Perl v5.26.
2111b8851fccSafresh1This is similar to the C function, except that it can apply to a single
2112b8851fccSafresh1character or to a whole string, and currently operates as if the locale
2113b8851fccSafresh1always is "C".  Consider using the C<uc()> function, see L<perlfunc/uc>,
2114b8851fccSafresh1or the equivalent C<\U> operator inside doublequotish strings.
2115b8851fccSafresh1
2116b8851fccSafresh1=item C<trunc>
2117b8851fccSafresh1
2118eac174f2Safresh1Returns the integer toward zero from the argument [C99].  Added in Perl
2119eac174f2Safresh1v5.22.
2120b8851fccSafresh1
2121b8851fccSafresh1See also L</ceil>, L</floor>, and L</round>.
2122898184e3Ssthen
2123e5157e49Safresh1=item C<ttyname>
2124898184e3Ssthen
2125898184e3SsthenThis is identical to the C function C<ttyname()> for returning the
2126898184e3Ssthenname of the current terminal.
2127898184e3Ssthen
2128e5157e49Safresh1=item C<tzname>
2129898184e3Ssthen
2130898184e3SsthenRetrieves the time conversion information from the C<tzname> variable.
2131898184e3Ssthen
2132898184e3Ssthen	POSIX::tzset();
2133898184e3Ssthen	($std, $dst) = POSIX::tzname();
2134898184e3Ssthen
2135e5157e49Safresh1=item C<tzset>
2136898184e3Ssthen
2137898184e3SsthenThis is identical to the C function C<tzset()> for setting
2138898184e3Ssthenthe current timezone based on the environment variable C<TZ>,
2139898184e3Ssthento be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
2140898184e3Ssthenfunctions.
2141898184e3Ssthen
2142e5157e49Safresh1=item C<umask>
2143898184e3Ssthen
2144898184e3SsthenThis is identical to Perl's builtin C<umask()> function
2145898184e3Ssthenfor setting (and querying) the file creation permission mask,
2146898184e3Ssthensee L<perlfunc/umask>.
2147898184e3Ssthen
2148e5157e49Safresh1=item C<uname>
2149898184e3Ssthen
2150898184e3SsthenGet name of current operating system.
2151898184e3Ssthen
2152e5157e49Safresh1	($sysname, $nodename, $release, $version, $machine)
2153e5157e49Safresh1		= POSIX::uname();
2154898184e3Ssthen
2155898184e3SsthenNote that the actual meanings of the various fields are not
2156898184e3Ssthenthat well standardized, do not expect any great portability.
2157898184e3SsthenThe C<$sysname> might be the name of the operating system,
2158898184e3Ssthenthe C<$nodename> might be the name of the host, the C<$release>
2159898184e3Ssthenmight be the (major) release number of the operating system,
2160898184e3Ssthenthe C<$version> might be the (minor) release number of the
2161898184e3Ssthenoperating system, and the C<$machine> might be a hardware identifier.
2162898184e3SsthenMaybe.
2163898184e3Ssthen
2164e5157e49Safresh1=item C<ungetc>
2165898184e3Ssthen
2166b8851fccSafresh1Not implemented.  Use method C<IO::Handle::ungetc()> instead.
2167898184e3Ssthen
2168e5157e49Safresh1=item C<unlink>
2169898184e3Ssthen
2170898184e3SsthenThis is identical to Perl's builtin C<unlink()> function
2171898184e3Ssthenfor removing files, see L<perlfunc/unlink>.
2172898184e3Ssthen
2173e5157e49Safresh1=item C<utime>
2174898184e3Ssthen
2175898184e3SsthenThis is identical to Perl's builtin C<utime()> function
2176898184e3Ssthenfor changing the time stamps of files and directories,
2177898184e3Ssthensee L<perlfunc/utime>.
2178898184e3Ssthen
2179e5157e49Safresh1=item C<vfprintf>
2180898184e3Ssthen
2181b8851fccSafresh1Not implemented.  C<vfprintf()> is C-specific, see L<perlfunc/printf> instead.
2182898184e3Ssthen
2183e5157e49Safresh1=item C<vprintf>
2184898184e3Ssthen
2185b8851fccSafresh1Not implemented.  C<vprintf()> is C-specific, see L<perlfunc/printf> instead.
2186898184e3Ssthen
2187e5157e49Safresh1=item C<vsprintf>
2188898184e3Ssthen
2189b8851fccSafresh1Not implemented.  C<vsprintf()> is C-specific, see L<perlfunc/sprintf> instead.
2190898184e3Ssthen
2191e5157e49Safresh1=item C<wait>
2192898184e3Ssthen
2193898184e3SsthenThis is identical to Perl's builtin C<wait()> function,
2194898184e3Ssthensee L<perlfunc/wait>.
2195898184e3Ssthen
2196e5157e49Safresh1=item C<waitpid>
2197898184e3Ssthen
2198898184e3SsthenWait for a child process to change state.  This is identical to Perl's
2199898184e3Ssthenbuiltin C<waitpid()> function, see L<perlfunc/waitpid>.
2200898184e3Ssthen
2201898184e3Ssthen	$pid = POSIX::waitpid( -1, POSIX::WNOHANG );
2202898184e3Ssthen	print "status = ", ($? / 256), "\n";
2203898184e3Ssthen
2204b8851fccSafresh1See L</mblen>.
2205898184e3Ssthen
2206e5157e49Safresh1=item C<wctomb>
2207898184e3Ssthen
220856d68f1eSafresh1This is the same as the C function C<wctomb()> on unthreaded perls.  On
220956d68f1eSafresh1threaded perls, it transparently (almost) substitutes the more
221056d68f1eSafresh1thread-safe L<C<wcrtomb>(3)>, if available, instead of C<wctomb>.
2211b8851fccSafresh1
221256d68f1eSafresh1Core Perl does not have any support for wide and multibyte locales,
221356d68f1eSafresh1except Unicode UTF-8 locales.  This function, in conjunction with
221456d68f1eSafresh1L</mblen> and L</mbtowc> may be used to roll your own decoding/encoding
221556d68f1eSafresh1of other types of multi-byte locales.
221656d68f1eSafresh1
221756d68f1eSafresh1Use C<undef> as the first parameter to this function to get the effect
2218*e0680481Safresh1of passing NULL as the first parameter to C<wctomb>.  This ignores the
2219*e0680481Safresh1second parameter, and resets any shift state to its initial value.  The
2220*e0680481Safresh1return value is undefined if C<wcrtomb> was substituted, so you should
2221*e0680481Safresh1never rely on it.
222256d68f1eSafresh1
222356d68f1eSafresh1When the first parameter is a scalar, the code point contained in the
222456d68f1eSafresh1scalar second parameter is converted into a multi-byte string and stored
222556d68f1eSafresh1into the first parameter scalar.  This is based on the locale that
222656d68f1eSafresh1currently underlies the program, regardless of whether or not the
222756d68f1eSafresh1function is called from Perl code that is within the scope of S<C<use
222856d68f1eSafresh1locale>>.  The return value is the number of bytes stored; or negative
222956d68f1eSafresh1if the code point isn't representable in the current locale.  Perl makes
223056d68f1eSafresh1no attempt at hiding from your code any differences in the C<errno>
223156d68f1eSafresh1setting between C<wctomb> and C<wcrtomb>.  It does set C<errno> to 0
223256d68f1eSafresh1before calling them.
2233898184e3Ssthen
2234e5157e49Safresh1=item C<write>
2235898184e3Ssthen
2236898184e3SsthenWrite to a file.  This uses file descriptors such as those obtained by
2237898184e3Ssthencalling C<POSIX::open>.
2238898184e3Ssthen
2239898184e3Ssthen	$fd = POSIX::open( "foo", &POSIX::O_WRONLY );
2240898184e3Ssthen	$buf = "hello";
2241898184e3Ssthen	$bytes = POSIX::write( $fd, $buf, 5 );
2242898184e3Ssthen
2243898184e3SsthenReturns C<undef> on failure.
2244898184e3Ssthen
2245898184e3SsthenSee also L<perlfunc/syswrite>.
2246898184e3Ssthen
2247898184e3Ssthen=back
2248898184e3Ssthen
2249898184e3Ssthen=head1 CLASSES
2250898184e3Ssthen
2251e5157e49Safresh1=head2 C<POSIX::SigAction>
2252898184e3Ssthen
2253898184e3Ssthen=over 8
2254898184e3Ssthen
2255e5157e49Safresh1=item C<new>
2256898184e3Ssthen
2257898184e3SsthenCreates a new C<POSIX::SigAction> object which corresponds to the C
2258898184e3SsthenC<struct sigaction>.  This object will be destroyed automatically when
2259898184e3Ssthenit is no longer needed.  The first parameter is the handler, a sub
2260898184e3Ssthenreference.  The second parameter is a C<POSIX::SigSet> object, it
2261898184e3Ssthendefaults to the empty set.  The third parameter contains the
2262898184e3SsthenC<sa_flags>, it defaults to 0.
2263898184e3Ssthen
2264898184e3Ssthen	$sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
2265e5157e49Safresh1	$sigaction = POSIX::SigAction->new(
2266e5157e49Safresh1			\&handler, $sigset, &POSIX::SA_NOCLDSTOP
2267e5157e49Safresh1		     );
2268898184e3Ssthen
2269898184e3SsthenThis C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
2270898184e3Ssthenfunction.
2271898184e3Ssthen
2272898184e3Ssthen=back
2273898184e3Ssthen
2274898184e3Ssthen=over 8
2275898184e3Ssthen
2276e5157e49Safresh1=item C<handler>
2277898184e3Ssthen
2278e5157e49Safresh1=item C<mask>
2279898184e3Ssthen
2280e5157e49Safresh1=item C<flags>
2281898184e3Ssthen
2282898184e3Ssthenaccessor functions to get/set the values of a SigAction object.
2283898184e3Ssthen
2284898184e3Ssthen	$sigset = $sigaction->mask;
2285898184e3Ssthen	$sigaction->flags(&POSIX::SA_RESTART);
2286898184e3Ssthen
2287e5157e49Safresh1=item C<safe>
2288898184e3Ssthen
2289898184e3Ssthenaccessor function for the "safe signals" flag of a SigAction object; see
2290898184e3SsthenL<perlipc> for general information on safe (a.k.a. "deferred") signals.  If
2291898184e3Ssthenyou wish to handle a signal safely, use this accessor to set the "safe" flag
2292898184e3Ssthenin the C<POSIX::SigAction> object:
2293898184e3Ssthen
2294898184e3Ssthen	$sigaction->safe(1);
2295898184e3Ssthen
2296898184e3SsthenYou may also examine the "safe" flag on the output action object which is
2297898184e3Ssthenfilled in when given as the third parameter to C<POSIX::sigaction()>:
2298898184e3Ssthen
2299898184e3Ssthen	sigaction(SIGINT, $new_action, $old_action);
2300898184e3Ssthen	if ($old_action->safe) {
2301898184e3Ssthen	    # previous SIGINT handler used safe signals
2302898184e3Ssthen	}
2303898184e3Ssthen
2304898184e3Ssthen=back
2305898184e3Ssthen
2306e5157e49Safresh1=head2 C<POSIX::SigRt>
2307898184e3Ssthen
2308898184e3Ssthen=over 8
2309898184e3Ssthen
2310e5157e49Safresh1=item C<%SIGRT>
2311898184e3Ssthen
2312898184e3SsthenA hash of the POSIX realtime signal handlers.  It is an extension of
2313e5157e49Safresh1the standard C<%SIG>, the C<$POSIX::SIGRT{SIGRTMIN}> is roughly equivalent
2314e5157e49Safresh1to C<$SIG{SIGRTMIN}>, but the right POSIX moves (see below) are made with
2315e5157e49Safresh1the C<POSIX::SigSet> and C<POSIX::sigaction> instead of accessing the C<%SIG>.
2316898184e3Ssthen
2317e5157e49Safresh1You can set the C<%POSIX::SIGRT> elements to set the POSIX realtime
2318898184e3Ssthensignal handlers, use C<delete> and C<exists> on the elements, and use
2319898184e3SsthenC<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
2320e5157e49Safresh1signals there are available S<C<(SIGRTMAX - SIGRTMIN + 1>>, the C<SIGRTMAX> is
2321898184e3Ssthena valid POSIX realtime signal).
2322898184e3Ssthen
2323e5157e49Safresh1Setting the C<%SIGRT> elements is equivalent to calling this:
2324898184e3Ssthen
2325898184e3Ssthen  sub new {
2326898184e3Ssthen    my ($rtsig, $handler, $flags) = @_;
2327898184e3Ssthen    my $sigset = POSIX::SigSet($rtsig);
2328898184e3Ssthen    my $sigact = POSIX::SigAction->new($handler,$sigset,$flags);
2329898184e3Ssthen    sigaction($rtsig, $sigact);
2330898184e3Ssthen  }
2331898184e3Ssthen
2332898184e3SsthenThe flags default to zero, if you want something different you can
2333e5157e49Safresh1either use C<local> on C<$POSIX::SigRt::SIGACTION_FLAGS>, or you can
2334898184e3Ssthenderive from POSIX::SigRt and define your own C<new()> (the tied hash
2335e5157e49Safresh1STORE method of the C<%SIGRT> calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
2336e5157e49Safresh1where the C<$rtsig> ranges from zero to S<C<SIGRTMAX - SIGRTMIN + 1)>>.
2337898184e3Ssthen
2338e5157e49Safresh1Just as with any signal, you can use C<sigaction($rtsig, undef, $oa)> to
2339898184e3Ssthenretrieve the installed signal handler (or, rather, the signal action).
2340898184e3Ssthen
2341898184e3SsthenB<NOTE:> whether POSIX realtime signals really work in your system, or
2342898184e3Ssthenwhether Perl has been compiled so that it works with them, is outside
2343898184e3Ssthenof this discussion.
2344898184e3Ssthen
2345e5157e49Safresh1=item C<SIGRTMIN>
2346898184e3Ssthen
2347898184e3SsthenReturn the minimum POSIX realtime signal number available, or C<undef>
2348898184e3Ssthenif no POSIX realtime signals are available.
2349898184e3Ssthen
2350e5157e49Safresh1=item C<SIGRTMAX>
2351898184e3Ssthen
2352898184e3SsthenReturn the maximum POSIX realtime signal number available, or C<undef>
2353898184e3Ssthenif no POSIX realtime signals are available.
2354898184e3Ssthen
2355898184e3Ssthen=back
2356898184e3Ssthen
2357e5157e49Safresh1=head2 C<POSIX::SigSet>
2358898184e3Ssthen
2359898184e3Ssthen=over 8
2360898184e3Ssthen
2361e5157e49Safresh1=item C<new>
2362898184e3Ssthen
2363898184e3SsthenCreate a new SigSet object.  This object will be destroyed automatically
2364898184e3Ssthenwhen it is no longer needed.  Arguments may be supplied to initialize the
2365898184e3Ssthenset.
2366898184e3Ssthen
2367898184e3SsthenCreate an empty set.
2368898184e3Ssthen
2369898184e3Ssthen	$sigset = POSIX::SigSet->new;
2370898184e3Ssthen
2371e5157e49Safresh1Create a set with C<SIGUSR1>.
2372898184e3Ssthen
2373898184e3Ssthen	$sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
2374898184e3Ssthen
237556d68f1eSafresh1Throws an error if any of the signals supplied cannot be added to the
237656d68f1eSafresh1set.
237756d68f1eSafresh1
2378e5157e49Safresh1=item C<addset>
2379898184e3Ssthen
2380898184e3SsthenAdd a signal to a SigSet object.
2381898184e3Ssthen
2382898184e3Ssthen	$sigset->addset( &POSIX::SIGUSR2 );
2383898184e3Ssthen
2384898184e3SsthenReturns C<undef> on failure.
2385898184e3Ssthen
2386e5157e49Safresh1=item C<delset>
2387898184e3Ssthen
2388898184e3SsthenRemove a signal from the SigSet object.
2389898184e3Ssthen
2390898184e3Ssthen	$sigset->delset( &POSIX::SIGUSR2 );
2391898184e3Ssthen
2392898184e3SsthenReturns C<undef> on failure.
2393898184e3Ssthen
2394e5157e49Safresh1=item C<emptyset>
2395898184e3Ssthen
2396898184e3SsthenInitialize the SigSet object to be empty.
2397898184e3Ssthen
2398898184e3Ssthen	$sigset->emptyset();
2399898184e3Ssthen
2400898184e3SsthenReturns C<undef> on failure.
2401898184e3Ssthen
2402e5157e49Safresh1=item C<fillset>
2403898184e3Ssthen
2404898184e3SsthenInitialize the SigSet object to include all signals.
2405898184e3Ssthen
2406898184e3Ssthen	$sigset->fillset();
2407898184e3Ssthen
2408898184e3SsthenReturns C<undef> on failure.
2409898184e3Ssthen
2410e5157e49Safresh1=item C<ismember>
2411898184e3Ssthen
2412898184e3SsthenTests the SigSet object to see if it contains a specific signal.
2413898184e3Ssthen
2414898184e3Ssthen	if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
2415898184e3Ssthen		print "contains SIGUSR1\n";
2416898184e3Ssthen	}
2417898184e3Ssthen
2418898184e3Ssthen=back
2419898184e3Ssthen
2420e5157e49Safresh1=head2 C<POSIX::Termios>
2421898184e3Ssthen
2422898184e3Ssthen=over 8
2423898184e3Ssthen
2424e5157e49Safresh1=item C<new>
2425898184e3Ssthen
2426898184e3SsthenCreate a new Termios object.  This object will be destroyed automatically
2427b8851fccSafresh1when it is no longer needed.  A Termios object corresponds to the C<termios>
2428e5157e49Safresh1C struct.  C<new()> mallocs a new one, C<getattr()> fills it from a file descriptor,
2429e5157e49Safresh1and C<setattr()> sets a file descriptor's parameters to match Termios' contents.
2430898184e3Ssthen
2431898184e3Ssthen	$termios = POSIX::Termios->new;
2432898184e3Ssthen
2433e5157e49Safresh1=item C<getattr>
2434898184e3Ssthen
2435898184e3SsthenGet terminal control attributes.
2436898184e3Ssthen
2437b8851fccSafresh1Obtain the attributes for C<stdin>.
2438898184e3Ssthen
2439898184e3Ssthen	$termios->getattr( 0 ) # Recommended for clarity.
2440898184e3Ssthen	$termios->getattr()
2441898184e3Ssthen
2442898184e3SsthenObtain the attributes for stdout.
2443898184e3Ssthen
2444898184e3Ssthen	$termios->getattr( 1 )
2445898184e3Ssthen
2446898184e3SsthenReturns C<undef> on failure.
2447898184e3Ssthen
2448e5157e49Safresh1=item C<getcc>
2449898184e3Ssthen
2450b8851fccSafresh1Retrieve a value from the C<c_cc> field of a C<termios> object.  The C<c_cc> field is
2451898184e3Ssthenan array so an index must be specified.
2452898184e3Ssthen
2453898184e3Ssthen	$c_cc[1] = $termios->getcc(1);
2454898184e3Ssthen
2455e5157e49Safresh1=item C<getcflag>
2456898184e3Ssthen
2457b8851fccSafresh1Retrieve the C<c_cflag> field of a C<termios> object.
2458898184e3Ssthen
2459898184e3Ssthen	$c_cflag = $termios->getcflag;
2460898184e3Ssthen
2461e5157e49Safresh1=item C<getiflag>
2462898184e3Ssthen
2463b8851fccSafresh1Retrieve the C<c_iflag> field of a C<termios> object.
2464898184e3Ssthen
2465898184e3Ssthen	$c_iflag = $termios->getiflag;
2466898184e3Ssthen
2467e5157e49Safresh1=item C<getispeed>
2468898184e3Ssthen
2469898184e3SsthenRetrieve the input baud rate.
2470898184e3Ssthen
2471898184e3Ssthen	$ispeed = $termios->getispeed;
2472898184e3Ssthen
2473e5157e49Safresh1=item C<getlflag>
2474898184e3Ssthen
2475b8851fccSafresh1Retrieve the C<c_lflag> field of a C<termios> object.
2476898184e3Ssthen
2477898184e3Ssthen	$c_lflag = $termios->getlflag;
2478898184e3Ssthen
2479e5157e49Safresh1=item C<getoflag>
2480898184e3Ssthen
2481b8851fccSafresh1Retrieve the C<c_oflag> field of a C<termios> object.
2482898184e3Ssthen
2483898184e3Ssthen	$c_oflag = $termios->getoflag;
2484898184e3Ssthen
2485e5157e49Safresh1=item C<getospeed>
2486898184e3Ssthen
2487898184e3SsthenRetrieve the output baud rate.
2488898184e3Ssthen
2489898184e3Ssthen	$ospeed = $termios->getospeed;
2490898184e3Ssthen
2491e5157e49Safresh1=item C<setattr>
2492898184e3Ssthen
2493898184e3SsthenSet terminal control attributes.
2494898184e3Ssthen
2495898184e3SsthenSet attributes immediately for stdout.
2496898184e3Ssthen
2497898184e3Ssthen	$termios->setattr( 1, &POSIX::TCSANOW );
2498898184e3Ssthen
2499898184e3SsthenReturns C<undef> on failure.
2500898184e3Ssthen
2501e5157e49Safresh1=item C<setcc>
2502898184e3Ssthen
2503b8851fccSafresh1Set a value in the C<c_cc> field of a C<termios> object.  The C<c_cc> field is an
2504898184e3Ssthenarray so an index must be specified.
2505898184e3Ssthen
2506898184e3Ssthen	$termios->setcc( &POSIX::VEOF, 1 );
2507898184e3Ssthen
2508e5157e49Safresh1=item C<setcflag>
2509898184e3Ssthen
2510b8851fccSafresh1Set the C<c_cflag> field of a C<termios> object.
2511898184e3Ssthen
2512898184e3Ssthen	$termios->setcflag( $c_cflag | &POSIX::CLOCAL );
2513898184e3Ssthen
2514e5157e49Safresh1=item C<setiflag>
2515898184e3Ssthen
2516b8851fccSafresh1Set the C<c_iflag> field of a C<termios> object.
2517898184e3Ssthen
2518898184e3Ssthen	$termios->setiflag( $c_iflag | &POSIX::BRKINT );
2519898184e3Ssthen
2520e5157e49Safresh1=item C<setispeed>
2521898184e3Ssthen
2522898184e3SsthenSet the input baud rate.
2523898184e3Ssthen
2524898184e3Ssthen	$termios->setispeed( &POSIX::B9600 );
2525898184e3Ssthen
2526898184e3SsthenReturns C<undef> on failure.
2527898184e3Ssthen
2528e5157e49Safresh1=item C<setlflag>
2529898184e3Ssthen
2530b8851fccSafresh1Set the C<c_lflag> field of a C<termios> object.
2531898184e3Ssthen
2532898184e3Ssthen	$termios->setlflag( $c_lflag | &POSIX::ECHO );
2533898184e3Ssthen
2534e5157e49Safresh1=item C<setoflag>
2535898184e3Ssthen
2536b8851fccSafresh1Set the C<c_oflag> field of a C<termios> object.
2537898184e3Ssthen
2538898184e3Ssthen	$termios->setoflag( $c_oflag | &POSIX::OPOST );
2539898184e3Ssthen
2540e5157e49Safresh1=item C<setospeed>
2541898184e3Ssthen
2542898184e3SsthenSet the output baud rate.
2543898184e3Ssthen
2544898184e3Ssthen	$termios->setospeed( &POSIX::B9600 );
2545898184e3Ssthen
2546898184e3SsthenReturns C<undef> on failure.
2547898184e3Ssthen
2548898184e3Ssthen=item Baud rate values
2549898184e3Ssthen
2550e5157e49Safresh1C<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>
2551898184e3Ssthen
2552898184e3Ssthen=item Terminal interface values
2553898184e3Ssthen
2554e5157e49Safresh1C<TCSADRAIN> C<TCSANOW> C<TCOON> C<TCIOFLUSH> C<TCOFLUSH> C<TCION> C<TCIFLUSH> C<TCSAFLUSH> C<TCIOFF> C<TCOOFF>
2555898184e3Ssthen
2556e5157e49Safresh1=item C<c_cc> field values
2557898184e3Ssthen
2558e5157e49Safresh1C<VEOF> C<VEOL> C<VERASE> C<VINTR> C<VKILL> C<VQUIT> C<VSUSP> C<VSTART> C<VSTOP> C<VMIN> C<VTIME> C<NCCS>
2559898184e3Ssthen
2560e5157e49Safresh1=item C<c_cflag> field values
2561898184e3Ssthen
2562e5157e49Safresh1C<CLOCAL> C<CREAD> C<CSIZE> C<CS5> C<CS6> C<CS7> C<CS8> C<CSTOPB> C<HUPCL> C<PARENB> C<PARODD>
2563898184e3Ssthen
2564e5157e49Safresh1=item C<c_iflag> field values
2565898184e3Ssthen
2566e5157e49Safresh1C<BRKINT> C<ICRNL> C<IGNBRK> C<IGNCR> C<IGNPAR> C<INLCR> C<INPCK> C<ISTRIP> C<IXOFF> C<IXON> C<PARMRK>
2567898184e3Ssthen
2568e5157e49Safresh1=item C<c_lflag> field values
2569898184e3Ssthen
2570e5157e49Safresh1C<ECHO> C<ECHOE> C<ECHOK> C<ECHONL> C<ICANON> C<IEXTEN> C<ISIG> C<NOFLSH> C<TOSTOP>
2571898184e3Ssthen
2572e5157e49Safresh1=item C<c_oflag> field values
2573898184e3Ssthen
2574e5157e49Safresh1C<OPOST>
2575898184e3Ssthen
2576898184e3Ssthen=back
2577898184e3Ssthen
2578898184e3Ssthen=head1 PATHNAME CONSTANTS
2579898184e3Ssthen
2580898184e3Ssthen=over 8
2581898184e3Ssthen
2582898184e3Ssthen=item Constants
2583898184e3Ssthen
2584e5157e49Safresh1C<_PC_CHOWN_RESTRICTED> C<_PC_LINK_MAX> C<_PC_MAX_CANON> C<_PC_MAX_INPUT> C<_PC_NAME_MAX>
2585e5157e49Safresh1C<_PC_NO_TRUNC> C<_PC_PATH_MAX> C<_PC_PIPE_BUF> C<_PC_VDISABLE>
2586898184e3Ssthen
2587898184e3Ssthen=back
2588898184e3Ssthen
2589898184e3Ssthen=head1 POSIX CONSTANTS
2590898184e3Ssthen
2591898184e3Ssthen=over 8
2592898184e3Ssthen
2593898184e3Ssthen=item Constants
2594898184e3Ssthen
2595e5157e49Safresh1C<_POSIX_ARG_MAX> C<_POSIX_CHILD_MAX> C<_POSIX_CHOWN_RESTRICTED> C<_POSIX_JOB_CONTROL>
2596e5157e49Safresh1C<_POSIX_LINK_MAX> C<_POSIX_MAX_CANON> C<_POSIX_MAX_INPUT> C<_POSIX_NAME_MAX>
2597e5157e49Safresh1C<_POSIX_NGROUPS_MAX> C<_POSIX_NO_TRUNC> C<_POSIX_OPEN_MAX> C<_POSIX_PATH_MAX>
2598e5157e49Safresh1C<_POSIX_PIPE_BUF> C<_POSIX_SAVED_IDS> C<_POSIX_SSIZE_MAX> C<_POSIX_STREAM_MAX>
2599e5157e49Safresh1C<_POSIX_TZNAME_MAX> C<_POSIX_VDISABLE> C<_POSIX_VERSION>
2600898184e3Ssthen
2601898184e3Ssthen=back
2602898184e3Ssthen
26039f11ffb7Safresh1=head1 RESOURCE CONSTANTS
26049f11ffb7Safresh1
26059f11ffb7Safresh1Imported with the C<:sys_resource_h> tag.
26069f11ffb7Safresh1
26079f11ffb7Safresh1=over 8
26089f11ffb7Safresh1
26099f11ffb7Safresh1=item Constants
26109f11ffb7Safresh1
2611eac174f2Safresh1Added in Perl v5.28:
2612eac174f2Safresh1
26139f11ffb7Safresh1C<PRIO_PROCESS> C<PRIO_PGRP> C<PRIO_USER>
26149f11ffb7Safresh1
26159f11ffb7Safresh1=back
26169f11ffb7Safresh1
2617898184e3Ssthen=head1 SYSTEM CONFIGURATION
2618898184e3Ssthen
2619898184e3Ssthen=over 8
2620898184e3Ssthen
2621898184e3Ssthen=item Constants
2622898184e3Ssthen
2623e5157e49Safresh1C<_SC_ARG_MAX> C<_SC_CHILD_MAX> C<_SC_CLK_TCK> C<_SC_JOB_CONTROL> C<_SC_NGROUPS_MAX>
2624e5157e49Safresh1C<_SC_OPEN_MAX> C<_SC_PAGESIZE> C<_SC_SAVED_IDS> C<_SC_STREAM_MAX> C<_SC_TZNAME_MAX>
2625e5157e49Safresh1C<_SC_VERSION>
2626898184e3Ssthen
2627898184e3Ssthen=back
2628898184e3Ssthen
2629898184e3Ssthen=head1 ERRNO
2630898184e3Ssthen
2631898184e3Ssthen=over 8
2632898184e3Ssthen
2633898184e3Ssthen=item Constants
2634898184e3Ssthen
2635e5157e49Safresh1C<E2BIG> C<EACCES> C<EADDRINUSE> C<EADDRNOTAVAIL> C<EAFNOSUPPORT> C<EAGAIN> C<EALREADY> C<EBADF> C<EBADMSG>
2636e5157e49Safresh1C<EBUSY> C<ECANCELED> C<ECHILD> C<ECONNABORTED> C<ECONNREFUSED> C<ECONNRESET> C<EDEADLK> C<EDESTADDRREQ>
2637e5157e49Safresh1C<EDOM> C<EDQUOT> C<EEXIST> C<EFAULT> C<EFBIG> C<EHOSTDOWN> C<EHOSTUNREACH> C<EIDRM> C<EILSEQ> C<EINPROGRESS>
2638e5157e49Safresh1C<EINTR> C<EINVAL> C<EIO> C<EISCONN> C<EISDIR> C<ELOOP> C<EMFILE> C<EMLINK> C<EMSGSIZE> C<ENAMETOOLONG>
2639e5157e49Safresh1C<ENETDOWN> C<ENETRESET> C<ENETUNREACH> C<ENFILE> C<ENOBUFS> C<ENODATA> C<ENODEV> C<ENOENT> C<ENOEXEC>
2640e5157e49Safresh1C<ENOLCK> C<ENOLINK> C<ENOMEM> C<ENOMSG> C<ENOPROTOOPT> C<ENOSPC> C<ENOSR> C<ENOSTR> C<ENOSYS> C<ENOTBLK>
2641e5157e49Safresh1C<ENOTCONN> C<ENOTDIR> C<ENOTEMPTY> C<ENOTRECOVERABLE> C<ENOTSOCK> C<ENOTSUP> C<ENOTTY> C<ENXIO>
2642e5157e49Safresh1C<EOPNOTSUPP> C<EOTHER> C<EOVERFLOW> C<EOWNERDEAD> C<EPERM> C<EPFNOSUPPORT> C<EPIPE> C<EPROCLIM> C<EPROTO>
2643e5157e49Safresh1C<EPROTONOSUPPORT> C<EPROTOTYPE> C<ERANGE> C<EREMOTE> C<ERESTART> C<EROFS> C<ESHUTDOWN>
2644e5157e49Safresh1C<ESOCKTNOSUPPORT> C<ESPIPE> C<ESRCH> C<ESTALE> C<ETIME> C<ETIMEDOUT> C<ETOOMANYREFS> C<ETXTBSY> C<EUSERS>
2645e5157e49Safresh1C<EWOULDBLOCK> C<EXDEV>
2646898184e3Ssthen
2647898184e3Ssthen=back
2648898184e3Ssthen
2649898184e3Ssthen=head1 FCNTL
2650898184e3Ssthen
2651898184e3Ssthen=over 8
2652898184e3Ssthen
2653898184e3Ssthen=item Constants
2654898184e3Ssthen
2655e5157e49Safresh1C<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>
2656e5157e49Safresh1C<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>
2657e5157e49Safresh1C<O_RDONLY> C<O_RDWR> C<O_TRUNC> C<O_WRONLY>
2658898184e3Ssthen
2659898184e3Ssthen=back
2660898184e3Ssthen
2661898184e3Ssthen=head1 FLOAT
2662898184e3Ssthen
2663898184e3Ssthen=over 8
2664898184e3Ssthen
2665898184e3Ssthen=item Constants
2666898184e3Ssthen
2667e5157e49Safresh1C<DBL_DIG> C<DBL_EPSILON> C<DBL_MANT_DIG> C<DBL_MAX> C<DBL_MAX_10_EXP> C<DBL_MAX_EXP> C<DBL_MIN>
2668e5157e49Safresh1C<DBL_MIN_10_EXP> C<DBL_MIN_EXP> C<FLT_DIG> C<FLT_EPSILON> C<FLT_MANT_DIG> C<FLT_MAX>
2669e5157e49Safresh1C<FLT_MAX_10_EXP> C<FLT_MAX_EXP> C<FLT_MIN> C<FLT_MIN_10_EXP> C<FLT_MIN_EXP> C<FLT_RADIX>
2670e5157e49Safresh1C<FLT_ROUNDS> C<LDBL_DIG> C<LDBL_EPSILON> C<LDBL_MANT_DIG> C<LDBL_MAX> C<LDBL_MAX_10_EXP>
2671e5157e49Safresh1C<LDBL_MAX_EXP> C<LDBL_MIN> C<LDBL_MIN_10_EXP> C<LDBL_MIN_EXP>
2672898184e3Ssthen
2673898184e3Ssthen=back
2674898184e3Ssthen
2675b8851fccSafresh1=head1 FLOATING-POINT ENVIRONMENT
2676b8851fccSafresh1
2677b8851fccSafresh1=over 8
2678b8851fccSafresh1
2679b8851fccSafresh1=item Constants
2680b8851fccSafresh1
2681b8851fccSafresh1C<FE_DOWNWARD> C<FE_TONEAREST> C<FE_TOWARDZERO> C<FE_UPWARD>
2682b8851fccSafresh1on systems that support them.
2683b8851fccSafresh1
2684b8851fccSafresh1=back
2685b8851fccSafresh1
2686898184e3Ssthen=head1 LIMITS
2687898184e3Ssthen
2688898184e3Ssthen=over 8
2689898184e3Ssthen
2690898184e3Ssthen=item Constants
2691898184e3Ssthen
2692e5157e49Safresh1C<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>
2693e5157e49Safresh1C<LONG_MIN> C<MAX_CANON> C<MAX_INPUT> C<MB_LEN_MAX> C<NAME_MAX> C<NGROUPS_MAX> C<OPEN_MAX> C<PATH_MAX>
2694e5157e49Safresh1C<PIPE_BUF> C<SCHAR_MAX> C<SCHAR_MIN> C<SHRT_MAX> C<SHRT_MIN> C<SSIZE_MAX> C<STREAM_MAX> C<TZNAME_MAX>
2695e5157e49Safresh1C<UCHAR_MAX> C<UINT_MAX> C<ULONG_MAX> C<USHRT_MAX>
2696898184e3Ssthen
2697898184e3Ssthen=back
2698898184e3Ssthen
2699898184e3Ssthen=head1 LOCALE
2700898184e3Ssthen
2701898184e3Ssthen=over 8
2702898184e3Ssthen
2703898184e3Ssthen=item Constants
2704898184e3Ssthen
2705b8851fccSafresh1C<LC_ALL> C<LC_COLLATE> C<LC_CTYPE> C<LC_MONETARY> C<LC_NUMERIC> C<LC_TIME> C<LC_MESSAGES>
2706b8851fccSafresh1on systems that support them.
2707898184e3Ssthen
2708898184e3Ssthen=back
2709898184e3Ssthen
2710898184e3Ssthen=head1 MATH
2711898184e3Ssthen
2712898184e3Ssthen=over 8
2713898184e3Ssthen
2714898184e3Ssthen=item Constants
2715898184e3Ssthen
2716e5157e49Safresh1C<HUGE_VAL>
2717898184e3Ssthen
2718eac174f2Safresh1Added in Perl v5.22:
2719eac174f2Safresh1
2720b8851fccSafresh1C<FP_ILOGB0> C<FP_ILOGBNAN> C<FP_INFINITE> C<FP_NAN> C<FP_NORMAL> C<FP_SUBNORMAL> C<FP_ZERO>
2721b8851fccSafresh1C<INFINITY> C<NAN> C<Inf> C<NaN>
2722b8851fccSafresh1C<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>
2723b8851fccSafresh1C<M_PI_2> C<M_PI_4> C<M_SQRT1_2> C<M_SQRT2>
2724b8851fccSafresh1on systems with C99 support.
2725b8851fccSafresh1
2726898184e3Ssthen=back
2727898184e3Ssthen
2728898184e3Ssthen=head1 SIGNAL
2729898184e3Ssthen
2730898184e3Ssthen=over 8
2731898184e3Ssthen
2732898184e3Ssthen=item Constants
2733898184e3Ssthen
2734e5157e49Safresh1C<SA_NOCLDSTOP> C<SA_NOCLDWAIT> C<SA_NODEFER> C<SA_ONSTACK> C<SA_RESETHAND> C<SA_RESTART>
2735e5157e49Safresh1C<SA_SIGINFO> C<SIGABRT> C<SIGALRM> C<SIGCHLD> C<SIGCONT> C<SIGFPE> C<SIGHUP> C<SIGILL> C<SIGINT>
2736e5157e49Safresh1C<SIGKILL> C<SIGPIPE> C<SIGQUIT> C<SIGSEGV> C<SIGSTOP> C<SIGTERM> C<SIGTSTP> C<SIGTTIN> C<SIGTTOU>
2737e5157e49Safresh1C<SIGUSR1> C<SIGUSR2> C<SIG_BLOCK> C<SIG_DFL> C<SIG_ERR> C<SIG_IGN> C<SIG_SETMASK>
2738e5157e49Safresh1C<SIG_UNBLOCK>
2739eac174f2Safresh1
2740eac174f2Safresh1Added in Perl v5.24:
2741eac174f2Safresh1
2742b8851fccSafresh1C<ILL_ILLOPC> C<ILL_ILLOPN> C<ILL_ILLADR> C<ILL_ILLTRP> C<ILL_PRVOPC> C<ILL_PRVREG> C<ILL_COPROC>
2743b8851fccSafresh1C<ILL_BADSTK> C<FPE_INTDIV> C<FPE_INTOVF> C<FPE_FLTDIV> C<FPE_FLTOVF> C<FPE_FLTUND> C<FPE_FLTRES>
2744b8851fccSafresh1C<FPE_FLTINV> C<FPE_FLTSUB> C<SEGV_MAPERR> C<SEGV_ACCERR> C<BUS_ADRALN> C<BUS_ADRERR>
2745b8851fccSafresh1C<BUS_OBJERR> C<TRAP_BRKPT> C<TRAP_TRACE> C<CLD_EXITED> C<CLD_KILLED> C<CLD_DUMPED> C<CLD_TRAPPED>
2746b8851fccSafresh1C<CLD_STOPPED> C<CLD_CONTINUED> C<POLL_IN> C<POLL_OUT> C<POLL_MSG> C<POLL_ERR> C<POLL_PRI>
2747b8851fccSafresh1C<POLL_HUP> C<SI_USER> C<SI_QUEUE> C<SI_TIMER> C<SI_ASYNCIO> C<SI_MESGQ>
2748898184e3Ssthen
2749898184e3Ssthen=back
2750898184e3Ssthen
2751898184e3Ssthen=head1 STAT
2752898184e3Ssthen
2753898184e3Ssthen=over 8
2754898184e3Ssthen
2755898184e3Ssthen=item Constants
2756898184e3Ssthen
2757e5157e49Safresh1C<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>
2758e5157e49Safresh1C<S_IWUSR> C<S_IXGRP> C<S_IXOTH> C<S_IXUSR>
2759898184e3Ssthen
2760898184e3Ssthen=item Macros
2761898184e3Ssthen
2762*e0680481Safresh1C<S_ISBLK> C<S_ISCHR> C<S_ISDIR> C<S_ISFIFO> C<S_ISLNK> C<S_ISREG> C<S_ISSOCK>
2763898184e3Ssthen
2764898184e3Ssthen=back
2765898184e3Ssthen
2766898184e3Ssthen=head1 STDLIB
2767898184e3Ssthen
2768898184e3Ssthen=over 8
2769898184e3Ssthen
2770898184e3Ssthen=item Constants
2771898184e3Ssthen
2772e5157e49Safresh1C<EXIT_FAILURE> C<EXIT_SUCCESS> C<MB_CUR_MAX> C<RAND_MAX>
2773898184e3Ssthen
2774898184e3Ssthen=back
2775898184e3Ssthen
2776898184e3Ssthen=head1 STDIO
2777898184e3Ssthen
2778898184e3Ssthen=over 8
2779898184e3Ssthen
2780898184e3Ssthen=item Constants
2781898184e3Ssthen
27829f11ffb7Safresh1C<BUFSIZ> C<EOF> C<FILENAME_MAX> C<L_ctermid> C<L_cuserid> C<TMP_MAX>
2783898184e3Ssthen
2784898184e3Ssthen=back
2785898184e3Ssthen
2786898184e3Ssthen=head1 TIME
2787898184e3Ssthen
2788898184e3Ssthen=over 8
2789898184e3Ssthen
2790898184e3Ssthen=item Constants
2791898184e3Ssthen
2792e5157e49Safresh1C<CLK_TCK> C<CLOCKS_PER_SEC>
2793898184e3Ssthen
2794898184e3Ssthen=back
2795898184e3Ssthen
2796898184e3Ssthen=head1 UNISTD
2797898184e3Ssthen
2798898184e3Ssthen=over 8
2799898184e3Ssthen
2800898184e3Ssthen=item Constants
2801898184e3Ssthen
2802e5157e49Safresh1C<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>
2803898184e3Ssthen
2804898184e3Ssthen=back
2805898184e3Ssthen
2806898184e3Ssthen=head1 WAIT
2807898184e3Ssthen
2808898184e3Ssthen=over 8
2809898184e3Ssthen
2810898184e3Ssthen=item Constants
2811898184e3Ssthen
2812e5157e49Safresh1C<WNOHANG> C<WUNTRACED>
2813898184e3Ssthen
2814898184e3Ssthen=over 16
2815898184e3Ssthen
2816e5157e49Safresh1=item C<WNOHANG>
2817898184e3Ssthen
2818898184e3SsthenDo not suspend the calling process until a child process
2819898184e3Ssthenchanges state but instead return immediately.
2820898184e3Ssthen
2821e5157e49Safresh1=item C<WUNTRACED>
2822898184e3Ssthen
2823898184e3SsthenCatch stopped child processes.
2824898184e3Ssthen
2825898184e3Ssthen=back
2826898184e3Ssthen
2827898184e3Ssthen=item Macros
2828898184e3Ssthen
2829e5157e49Safresh1C<WIFEXITED> C<WEXITSTATUS> C<WIFSIGNALED> C<WTERMSIG> C<WIFSTOPPED> C<WSTOPSIG>
2830898184e3Ssthen
2831898184e3Ssthen=over 16
2832898184e3Ssthen
2833e5157e49Safresh1=item C<WIFEXITED>
2834898184e3Ssthen
2835e5157e49Safresh1C<WIFEXITED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2836898184e3Ssthenexited normally (C<exit()> or by falling off the end of C<main()>)
2837898184e3Ssthen
2838e5157e49Safresh1=item C<WEXITSTATUS>
2839898184e3Ssthen
2840e5157e49Safresh1C<WEXITSTATUS(${^CHILD_ERROR_NATIVE})> returns the normal exit status of
2841e5157e49Safresh1the child process (only meaningful if C<WIFEXITED(${^CHILD_ERROR_NATIVE})>
2842898184e3Ssthenis true)
2843898184e3Ssthen
2844e5157e49Safresh1=item C<WIFSIGNALED>
2845898184e3Ssthen
2846e5157e49Safresh1C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})> returns true if the child process
2847898184e3Ssthenterminated because of a signal
2848898184e3Ssthen
2849e5157e49Safresh1=item C<WTERMSIG>
2850898184e3Ssthen
2851e5157e49Safresh1C<WTERMSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2852e5157e49Safresh1terminated for (only meaningful if
2853e5157e49Safresh1C<WIFSIGNALED(${^CHILD_ERROR_NATIVE})>
2854898184e3Ssthenis true)
2855898184e3Ssthen
2856e5157e49Safresh1=item C<WIFSTOPPED>
2857898184e3Ssthen
2858e5157e49Safresh1C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})> returns true if the child process is
2859898184e3Ssthencurrently stopped (can happen only if you specified the WUNTRACED flag
2860e5157e49Safresh1to C<waitpid()>)
2861898184e3Ssthen
2862e5157e49Safresh1=item C<WSTOPSIG>
2863898184e3Ssthen
2864e5157e49Safresh1C<WSTOPSIG(${^CHILD_ERROR_NATIVE})> returns the signal the child process
2865e5157e49Safresh1was stopped for (only meaningful if
2866e5157e49Safresh1C<WIFSTOPPED(${^CHILD_ERROR_NATIVE})>
2867898184e3Ssthenis true)
2868898184e3Ssthen
2869898184e3Ssthen=back
2870898184e3Ssthen
2871898184e3Ssthen=back
2872898184e3Ssthen
2873b8851fccSafresh1=head1 WINSOCK
2874b8851fccSafresh1
2875b8851fccSafresh1(Windows only.)
2876b8851fccSafresh1
2877b8851fccSafresh1=over 8
2878b8851fccSafresh1
2879b8851fccSafresh1=item Constants
2880b8851fccSafresh1
2881eac174f2Safresh1Added in Perl v5.24:
2882eac174f2Safresh1
2883b8851fccSafresh1C<WSAEINTR> C<WSAEBADF> C<WSAEACCES> C<WSAEFAULT> C<WSAEINVAL> C<WSAEMFILE> C<WSAEWOULDBLOCK>
2884b8851fccSafresh1C<WSAEINPROGRESS> C<WSAEALREADY> C<WSAENOTSOCK> C<WSAEDESTADDRREQ> C<WSAEMSGSIZE>
2885b8851fccSafresh1C<WSAEPROTOTYPE> C<WSAENOPROTOOPT> C<WSAEPROTONOSUPPORT> C<WSAESOCKTNOSUPPORT>
2886b8851fccSafresh1C<WSAEOPNOTSUPP> C<WSAEPFNOSUPPORT> C<WSAEAFNOSUPPORT> C<WSAEADDRINUSE>
2887b8851fccSafresh1C<WSAEADDRNOTAVAIL> C<WSAENETDOWN> C<WSAENETUNREACH> C<WSAENETRESET> C<WSAECONNABORTED>
2888b8851fccSafresh1C<WSAECONNRESET> C<WSAENOBUFS> C<WSAEISCONN> C<WSAENOTCONN> C<WSAESHUTDOWN>
2889b8851fccSafresh1C<WSAETOOMANYREFS> C<WSAETIMEDOUT> C<WSAECONNREFUSED> C<WSAELOOP> C<WSAENAMETOOLONG>
2890b8851fccSafresh1C<WSAEHOSTDOWN> C<WSAEHOSTUNREACH> C<WSAENOTEMPTY> C<WSAEPROCLIM> C<WSAEUSERS>
2891b8851fccSafresh1C<WSAEDQUOT> C<WSAESTALE> C<WSAEREMOTE> C<WSAEDISCON> C<WSAENOMORE> C<WSAECANCELLED>
2892b8851fccSafresh1C<WSAEINVALIDPROCTABLE> C<WSAEINVALIDPROVIDER> C<WSAEPROVIDERFAILEDINIT>
2893b8851fccSafresh1C<WSAEREFUSED>
2894b8851fccSafresh1
2895b8851fccSafresh1=back
2896b8851fccSafresh1
2897