Debian Codegraph @

upstream/mageia-cauldron/man3pm/POSIX.3pm

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