Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man3 / POSIX.3
CommitLineData
920dae64
AT
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "POSIX 3"
132.TH POSIX 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide"
133.SH "NAME"
134POSIX \- Perl interface to IEEE Std 1003.1
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 3
138\& use POSIX;
139\& use POSIX qw(setsid);
140\& use POSIX qw(:errno_h :fcntl_h);
141.Ve
142.PP
143.Vb 1
144\& printf "EINTR is %d\en", EINTR;
145.Ve
146.PP
147.Vb 1
148\& $sess_id = POSIX::setsid();
149.Ve
150.PP
151.Vb 2
152\& $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
153\& # note: that's a filedescriptor, *NOT* a filehandle
154.Ve
155.SH "DESCRIPTION"
156.IX Header "DESCRIPTION"
157The \s-1POSIX\s0 module permits you to access all (or nearly all) the standard
158\&\s-1POSIX\s0 1003.1 identifiers. Many of these identifiers have been given Perl-ish
159interfaces.
160.PP
161\&\fIEverything is exported by default\fR with the exception of any \s-1POSIX\s0
162functions with the same name as a built-in Perl function, such as
163\&\f(CW\*(C`abs\*(C'\fR, \f(CW\*(C`alarm\*(C'\fR, \f(CW\*(C`rmdir\*(C'\fR, \f(CW\*(C`write\*(C'\fR, etc.., which will be exported
164only if you ask for them explicitly. This is an unfortunate backwards
165compatibility feature. You can stop the exporting by saying \f(CW\*(C`use
166POSIX ()\*(C'\fR and then use the fully qualified names (ie. \f(CW\*(C`POSIX::SEEK_END\*(C'\fR).
167.PP
168This document gives a condensed list of the features available in the \s-1POSIX\s0
169module. Consult your operating system's manpages for general information on
170most features. Consult perlfunc for functions which are noted as being
171identical to Perl's builtin functions.
172.PP
173The first section describes \s-1POSIX\s0 functions from the 1003.1 specification.
174The second section describes some classes for signal objects, \s-1TTY\s0 objects,
175and other miscellaneous objects. The remaining sections list various
176constants and macros in an organization which roughly follows \s-1IEEE\s0 Std
1771003.1b\-1993.
178.SH "NOTE"
179.IX Header "NOTE"
180The \s-1POSIX\s0 module is probably the most complex Perl module supplied with
181the standard distribution. It incorporates autoloading, namespace games,
182and dynamic loading of code that's in Perl, C, or both. It's a great
183source of wisdom.
184.SH "CAVEATS"
185.IX Header "CAVEATS"
186A few functions are not implemented because they are C specific. If you
187attempt to call these, they will print a message telling you that they
188aren't implemented, and suggest using the Perl equivalent should one
189exist. For example, trying to access the \fIsetjmp()\fR call will elicit the
190message \*(L"\fIsetjmp()\fR is C\-specific: use eval {} instead\*(R".
191.PP
192Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
193are not so: they will not pass the \s-1PCTS\s0 (\s-1POSIX\s0 Compliance Test Suites).
194For example, one vendor may not define \s-1EDEADLK\s0, or the semantics of the
195errno values set by \fIopen\fR\|(2) might not be quite right. Perl does not
196attempt to verify \s-1POSIX\s0 compliance. That means you can currently
197successfully say \*(L"use \s-1POSIX\s0\*(R", and then later in your program you find
198that your vendor has been lax and there's no usable \s-1ICANON\s0 macro after
199all. This could be construed to be a bug.
200.SH "FUNCTIONS"
201.IX Header "FUNCTIONS"
202.IP "_exit" 8
203.IX Item "_exit"
204This is identical to the C function \f(CW\*(C`_exit()\*(C'\fR. It exits the program
205immediately which means among other things buffered I/O is \fBnot\fR flushed.
206.Sp
207Note that when using threads and in Linux this is \fBnot\fR a good way to
208exit a thread because in Linux processes and threads are kind of the
209same thing (Note: while this is the situation in early 2003 there are
210projects under way to have threads with more POSIXly semantics in Linux).
211If you want not to return from a thread, detach the thread.
212.IP "abort" 8
213.IX Item "abort"
214This is identical to the C function \f(CW\*(C`abort()\*(C'\fR. It terminates the
215process with a \f(CW\*(C`SIGABRT\*(C'\fR signal unless caught by a signal handler or
216if the handler does not return normally (it e.g. does a \f(CW\*(C`longjmp\*(C'\fR).
217.IP "abs" 8
218.IX Item "abs"
219This is identical to Perl's builtin \f(CW\*(C`abs()\*(C'\fR function, returning
220the absolute value of its numerical argument.
221.IP "access" 8
222.IX Item "access"
223Determines the accessibility of a file.
224.Sp
225.Vb 3
226\& if( POSIX::access( "/", &POSIX::R_OK ) ){
227\& print "have read permission\en";
228\& }
229.Ve
230.Sp
231Returns \f(CW\*(C`undef\*(C'\fR on failure. Note: do not use \f(CW\*(C`access()\*(C'\fR for
232security purposes. Between the \f(CW\*(C`access()\*(C'\fR call and the operation
233you are preparing for the permissions might change: a classic
234\&\fIrace condition\fR.
235.IP "acos" 8
236.IX Item "acos"
237This is identical to the C function \f(CW\*(C`acos()\*(C'\fR, returning
238the arcus cosine of its numerical argument. See also Math::Trig.
239.IP "alarm" 8
240.IX Item "alarm"
241This is identical to Perl's builtin \f(CW\*(C`alarm()\*(C'\fR function,
242either for arming or disarming the \f(CW\*(C`SIGARLM\*(C'\fR timer.
243.IP "asctime" 8
244.IX Item "asctime"
245This is identical to the C function \f(CW\*(C`asctime()\*(C'\fR. It returns
246a string of the form
247.Sp
248.Vb 1
249\& "Fri Jun 2 18:22:13 2000\en\e0"
250.Ve
251.Sp
252and it is called thusly
253.Sp
254.Vb 2
255\& $asctime = asctime($sec, $min, $hour, $mday, $mon, $year,
256\& $wday, $yday, $isdst);
257.Ve
258.Sp
259The \f(CW$mon\fR is zero\-based: January equals \f(CW0\fR. The \f(CW$year\fR is
2601900\-based: 2001 equals \f(CW101\fR. The \f(CW$wday\fR, \f(CW$yday\fR, and \f(CW$isdst\fR
261default to zero (and the first two are usually ignored anyway).
262.IP "asin" 8
263.IX Item "asin"
264This is identical to the C function \f(CW\*(C`asin()\*(C'\fR, returning
265the arcus sine of its numerical argument. See also Math::Trig.
266.IP "assert" 8
267.IX Item "assert"
268Unimplemented, but you can use \*(L"die\*(R" in perlfunc and the Carp module
269to achieve similar things.
270.IP "atan" 8
271.IX Item "atan"
272This is identical to the C function \f(CW\*(C`atan()\*(C'\fR, returning the
273arcus tangent of its numerical argument. See also Math::Trig.
274.IP "atan2" 8
275.IX Item "atan2"
276This is identical to Perl's builtin \f(CW\*(C`atan2()\*(C'\fR function, returning
277the arcus tangent defined by its two numerical arguments, the \fIy\fR
278coordinate and the \fIx\fR coordinate. See also Math::Trig.
279.IP "atexit" 8
280.IX Item "atexit"
281\&\fIatexit()\fR is C\-specific: use \f(CW\*(C`END {}\*(C'\fR instead, see perlsub.
282.IP "atof" 8
283.IX Item "atof"
284\&\fIatof()\fR is C\-specific. Perl converts strings to numbers transparently.
285If you need to force a scalar to a number, add a zero to it.
286.IP "atoi" 8
287.IX Item "atoi"
288\&\fIatoi()\fR is C\-specific. Perl converts strings to numbers transparently.
289If you need to force a scalar to a number, add a zero to it.
290If you need to have just the integer part, see \*(L"int\*(R" in perlfunc.
291.IP "atol" 8
292.IX Item "atol"
293\&\fIatol()\fR is C\-specific. Perl converts strings to numbers transparently.
294If you need to force a scalar to a number, add a zero to it.
295If you need to have just the integer part, see \*(L"int\*(R" in perlfunc.
296.IP "bsearch" 8
297.IX Item "bsearch"
298\&\fIbsearch()\fR not supplied. For doing binary search on wordlists,
299see Search::Dict.
300.IP "calloc" 8
301.IX Item "calloc"
302\&\fIcalloc()\fR is C\-specific. Perl does memory management transparently.
303.IP "ceil" 8
304.IX Item "ceil"
305This is identical to the C function \f(CW\*(C`ceil()\*(C'\fR, returning the smallest
306integer value greater than or equal to the given numerical argument.
307.IP "chdir" 8
308.IX Item "chdir"
309This is identical to Perl's builtin \f(CW\*(C`chdir()\*(C'\fR function, allowing
310one to change the working (default) directory, see \*(L"chdir\*(R" in perlfunc.
311.IP "chmod" 8
312.IX Item "chmod"
313This is identical to Perl's builtin \f(CW\*(C`chmod()\*(C'\fR function, allowing
314one to change file and directory permissions, see \*(L"chmod\*(R" in perlfunc.
315.IP "chown" 8
316.IX Item "chown"
317This is identical to Perl's builtin \f(CW\*(C`chown()\*(C'\fR function, allowing one
318to change file and directory owners and groups, see \*(L"chown\*(R" in perlfunc.
319.IP "clearerr" 8
320.IX Item "clearerr"
321Use the method \f(CW\*(C`IO::Handle::clearerr()\*(C'\fR instead, to reset the error
322state (if any) and \s-1EOF\s0 state (if any) of the given stream.
323.IP "clock" 8
324.IX Item "clock"
325This is identical to the C function \f(CW\*(C`clock()\*(C'\fR, returning the
326amount of spent processor time in microseconds.
327.IP "close" 8
328.IX Item "close"
329Close the file. This uses file descriptors such as those obtained by calling
330\&\f(CW\*(C`POSIX::open\*(C'\fR.
331.Sp
332.Vb 2
333\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
334\& POSIX::close( $fd );
335.Ve
336.Sp
337Returns \f(CW\*(C`undef\*(C'\fR on failure.
338.Sp
339See also \*(L"close\*(R" in perlfunc.
340.IP "closedir" 8
341.IX Item "closedir"
342This is identical to Perl's builtin \f(CW\*(C`closedir()\*(C'\fR function for closing
343a directory handle, see \*(L"closedir\*(R" in perlfunc.
344.IP "cos" 8
345.IX Item "cos"
346This is identical to Perl's builtin \f(CW\*(C`cos()\*(C'\fR function, for returning
347the cosine of its numerical argument, see \*(L"cos\*(R" in perlfunc.
348See also Math::Trig.
349.IP "cosh" 8
350.IX Item "cosh"
351This is identical to the C function \f(CW\*(C`cosh()\*(C'\fR, for returning
352the hyperbolic cosine of its numeric argument. See also Math::Trig.
353.IP "creat" 8
354.IX Item "creat"
355Create a new file. This returns a file descriptor like the ones returned by
356\&\f(CW\*(C`POSIX::open\*(C'\fR. Use \f(CW\*(C`POSIX::close\*(C'\fR to close the file.
357.Sp
358.Vb 2
359\& $fd = POSIX::creat( "foo", 0611 );
360\& POSIX::close( $fd );
361.Ve
362.Sp
363See also \*(L"sysopen\*(R" in perlfunc and its \f(CW\*(C`O_CREAT\*(C'\fR flag.
364.IP "ctermid" 8
365.IX Item "ctermid"
366Generates the path name for the controlling terminal.
367.Sp
368.Vb 1
369\& $path = POSIX::ctermid();
370.Ve
371.IP "ctime" 8
372.IX Item "ctime"
373This is identical to the C function \f(CW\*(C`ctime()\*(C'\fR and equivalent
374to \f(CW\*(C`asctime(localtime(...))\*(C'\fR, see \*(L"asctime\*(R" and \*(L"localtime\*(R".
375.IP "cuserid" 8
376.IX Item "cuserid"
377Get the login name of the owner of the current process.
378.Sp
379.Vb 1
380\& $name = POSIX::cuserid();
381.Ve
382.IP "difftime" 8
383.IX Item "difftime"
384This is identical to the C function \f(CW\*(C`difftime()\*(C'\fR, for returning
385the time difference (in seconds) between two times (as returned
386by \f(CW\*(C`time()\*(C'\fR), see \*(L"time\*(R".
387.IP "div" 8
388.IX Item "div"
389\&\fIdiv()\fR is C\-specific, use \*(L"int\*(R" in perlfunc on the usual \f(CW\*(C`/\*(C'\fR division and
390the modulus \f(CW\*(C`%\*(C'\fR.
391.IP "dup" 8
392.IX Item "dup"
393This is similar to the C function \f(CW\*(C`dup()\*(C'\fR, for duplicating a file
394descriptor.
395.Sp
396This uses file descriptors such as those obtained by calling
397\&\f(CW\*(C`POSIX::open\*(C'\fR.
398.Sp
399Returns \f(CW\*(C`undef\*(C'\fR on failure.
400.IP "dup2" 8
401.IX Item "dup2"
402This is similar to the C function \f(CW\*(C`dup2()\*(C'\fR, for duplicating a file
403descriptor to an another known file descriptor.
404.Sp
405This uses file descriptors such as those obtained by calling
406\&\f(CW\*(C`POSIX::open\*(C'\fR.
407.Sp
408Returns \f(CW\*(C`undef\*(C'\fR on failure.
409.IP "errno" 8
410.IX Item "errno"
411Returns the value of errno.
412.Sp
413.Vb 1
414\& $errno = POSIX::errno();
415.Ve
416.Sp
417This identical to the numerical values of the \f(CW$!\fR, see \*(L"$ERRNO\*(R" in perlvar.
418.IP "execl" 8
419.IX Item "execl"
420\&\fIexecl()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
421.IP "execle" 8
422.IX Item "execle"
423\&\fIexecle()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
424.IP "execlp" 8
425.IX Item "execlp"
426\&\fIexeclp()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
427.IP "execv" 8
428.IX Item "execv"
429\&\fIexecv()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
430.IP "execve" 8
431.IX Item "execve"
432\&\fIexecve()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
433.IP "execvp" 8
434.IX Item "execvp"
435\&\fIexecvp()\fR is C\-specific, see \*(L"exec\*(R" in perlfunc.
436.IP "exit" 8
437.IX Item "exit"
438This is identical to Perl's builtin \f(CW\*(C`exit()\*(C'\fR function for exiting the
439program, see \*(L"exit\*(R" in perlfunc.
440.IP "exp" 8
441.IX Item "exp"
442This is identical to Perl's builtin \f(CW\*(C`exp()\*(C'\fR function for
443returning the exponent (\fIe\fR\-based) of the numerical argument,
444see \*(L"exp\*(R" in perlfunc.
445.IP "fabs" 8
446.IX Item "fabs"
447This is identical to Perl's builtin \f(CW\*(C`abs()\*(C'\fR function for returning
448the absolute value of the numerical argument, see \*(L"abs\*(R" in perlfunc.
449.IP "fclose" 8
450.IX Item "fclose"
451Use method \f(CW\*(C`IO::Handle::close()\*(C'\fR instead, or see \*(L"close\*(R" in perlfunc.
452.IP "fcntl" 8
453.IX Item "fcntl"
454This is identical to Perl's builtin \f(CW\*(C`fcntl()\*(C'\fR function,
455see \*(L"fcntl\*(R" in perlfunc.
456.IP "fdopen" 8
457.IX Item "fdopen"
458Use method \f(CW\*(C`IO::Handle::new_from_fd()\*(C'\fR instead, or see \*(L"open\*(R" in perlfunc.
459.IP "feof" 8
460.IX Item "feof"
461Use method \f(CW\*(C`IO::Handle::eof()\*(C'\fR instead, or see \*(L"eof\*(R" in perlfunc.
462.IP "ferror" 8
463.IX Item "ferror"
464Use method \f(CW\*(C`IO::Handle::error()\*(C'\fR instead.
465.IP "fflush" 8
466.IX Item "fflush"
467Use method \f(CW\*(C`IO::Handle::flush()\*(C'\fR instead.
468See also \*(L"$OUTPUT_AUTOFLUSH\*(R" in perlvar.
469.IP "fgetc" 8
470.IX Item "fgetc"
471Use method \f(CW\*(C`IO::Handle::getc()\*(C'\fR instead, or see \*(L"read\*(R" in perlfunc.
472.IP "fgetpos" 8
473.IX Item "fgetpos"
474Use method \f(CW\*(C`IO::Seekable::getpos()\*(C'\fR instead, or see \*(L"seek\*(R" in L.
475.IP "fgets" 8
476.IX Item "fgets"
477Use method \f(CW\*(C`IO::Handle::gets()\*(C'\fR instead. Similar to <>, also known
478as \*(L"readline\*(R" in perlfunc.
479.IP "fileno" 8
480.IX Item "fileno"
481Use method \f(CW\*(C`IO::Handle::fileno()\*(C'\fR instead, or see \*(L"fileno\*(R" in perlfunc.
482.IP "floor" 8
483.IX Item "floor"
484This is identical to the C function \f(CW\*(C`floor()\*(C'\fR, returning the largest
485integer value less than or equal to the numerical argument.
486.IP "fmod" 8
487.IX Item "fmod"
488This is identical to the C function \f(CW\*(C`fmod()\*(C'\fR.
489.Sp
490.Vb 1
491\& $r = fmod($x, $y);
492.Ve
493.Sp
494It returns the remainder \f(CW\*(C`$r = $x \- $n*$y\*(C'\fR, where \f(CW\*(C`$n = trunc($x/$y)\*(C'\fR.
495The \f(CW$r\fR has the same sign as \f(CW$x\fR and magnitude (absolute value)
496less than the magnitude of \f(CW$y\fR.
497.IP "fopen" 8
498.IX Item "fopen"
499Use method \f(CW\*(C`IO::File::open()\*(C'\fR instead, or see \*(L"open\*(R" in perlfunc.
500.IP "fork" 8
501.IX Item "fork"
502This is identical to Perl's builtin \f(CW\*(C`fork()\*(C'\fR function
503for duplicating the current process, see \*(L"fork\*(R" in perlfunc
504and perlfork if you are in Windows.
505.IP "fpathconf" 8
506.IX Item "fpathconf"
507Retrieves the value of a configurable limit on a file or directory. This
508uses file descriptors such as those obtained by calling \f(CW\*(C`POSIX::open\*(C'\fR.
509.Sp
510The following will determine the maximum length of the longest allowable
511pathname on the filesystem which holds \f(CW\*(C`/var/foo\*(C'\fR.
512.Sp
513.Vb 2
514\& $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
515\& $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
516.Ve
517.Sp
518Returns \f(CW\*(C`undef\*(C'\fR on failure.
519.IP "fprintf" 8
520.IX Item "fprintf"
521\&\fIfprintf()\fR is C\-specific, see \*(L"printf\*(R" in perlfunc instead.
522.IP "fputc" 8
523.IX Item "fputc"
524\&\fIfputc()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
525.IP "fputs" 8
526.IX Item "fputs"
527\&\fIfputs()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
528.IP "fread" 8
529.IX Item "fread"
530\&\fIfread()\fR is C\-specific, see \*(L"read\*(R" in perlfunc instead.
531.IP "free" 8
532.IX Item "free"
533\&\fIfree()\fR is C\-specific. Perl does memory management transparently.
534.IP "freopen" 8
535.IX Item "freopen"
536\&\fIfreopen()\fR is C\-specific, see \*(L"open\*(R" in perlfunc instead.
537.IP "frexp" 8
538.IX Item "frexp"
539Return the mantissa and exponent of a floating-point number.
540.Sp
541.Vb 1
542\& ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
543.Ve
544.IP "fscanf" 8
545.IX Item "fscanf"
546\&\fIfscanf()\fR is C\-specific, use <> and regular expressions instead.
547.IP "fseek" 8
548.IX Item "fseek"
549Use method \f(CW\*(C`IO::Seekable::seek()\*(C'\fR instead, or see \*(L"seek\*(R" in perlfunc.
550.IP "fsetpos" 8
551.IX Item "fsetpos"
552Use method \f(CW\*(C`IO::Seekable::setpos()\*(C'\fR instead, or seek \*(L"seek\*(R" in perlfunc.
553.IP "fstat" 8
554.IX Item "fstat"
555Get file status. This uses file descriptors such as those obtained by
556calling \f(CW\*(C`POSIX::open\*(C'\fR. The data returned is identical to the data from
557Perl's builtin \f(CW\*(C`stat\*(C'\fR function.
558.Sp
559.Vb 2
560\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
561\& @stats = POSIX::fstat( $fd );
562.Ve
563.IP "fsync" 8
564.IX Item "fsync"
565Use method \f(CW\*(C`IO::Handle::sync()\*(C'\fR instead.
566.IP "ftell" 8
567.IX Item "ftell"
568Use method \f(CW\*(C`IO::Seekable::tell()\*(C'\fR instead, or see \*(L"tell\*(R" in perlfunc.
569.IP "fwrite" 8
570.IX Item "fwrite"
571\&\fIfwrite()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
572.IP "getc" 8
573.IX Item "getc"
574This is identical to Perl's builtin \f(CW\*(C`getc()\*(C'\fR function,
575see \*(L"getc\*(R" in perlfunc.
576.IP "getchar" 8
577.IX Item "getchar"
578Returns one character from \s-1STDIN\s0. Identical to Perl's \f(CW\*(C`getc()\*(C'\fR,
579see \*(L"getc\*(R" in perlfunc.
580.IP "getcwd" 8
581.IX Item "getcwd"
582Returns the name of the current working directory.
583See also Cwd.
584.IP "getegid" 8
585.IX Item "getegid"
586Returns the effective group identifier. Similar to Perl' s builtin
587variable \f(CW$(\fR, see \*(L"$EGID\*(R" in perlvar.
588.IP "getenv" 8
589.IX Item "getenv"
590Returns the value of the specified environment variable.
591The same information is available through the \f(CW%ENV\fR array.
592.IP "geteuid" 8
593.IX Item "geteuid"
594Returns the effective user identifier. Identical to Perl's builtin \f(CW$>\fR
595variable, see \*(L"$EUID\*(R" in perlvar.
596.IP "getgid" 8
597.IX Item "getgid"
598Returns the user's real group identifier. Similar to Perl's builtin
599variable \f(CW$)\fR, see \*(L"$GID\*(R" in perlvar.
600.IP "getgrgid" 8
601.IX Item "getgrgid"
602This is identical to Perl's builtin \f(CW\*(C`getgrgid()\*(C'\fR function for
603returning group entries by group identifiers, see
604\&\*(L"getgrgid\*(R" in perlfunc.
605.IP "getgrnam" 8
606.IX Item "getgrnam"
607This is identical to Perl's builtin \f(CW\*(C`getgrnam()\*(C'\fR function for
608returning group entries by group names, see \*(L"getgrnam\*(R" in perlfunc.
609.IP "getgroups" 8
610.IX Item "getgroups"
611Returns the ids of the user's supplementary groups. Similar to Perl's
612builtin variable \f(CW$)\fR, see \*(L"$GID\*(R" in perlvar.
613.IP "getlogin" 8
614.IX Item "getlogin"
615This is identical to Perl's builtin \f(CW\*(C`getlogin()\*(C'\fR function for
616returning the user name associated with the current session, see
617\&\*(L"getlogin\*(R" in perlfunc.
618.IP "getpgrp" 8
619.IX Item "getpgrp"
620This is identical to Perl's builtin \f(CW\*(C`getpgrp()\*(C'\fR function for
621returning the process group identifier of the current process, see
622\&\*(L"getpgrp\*(R" in perlfunc.
623.IP "getpid" 8
624.IX Item "getpid"
625Returns the process identifier. Identical to Perl's builtin
626variable \f(CW$$\fR, see \*(L"$PID\*(R" in perlvar.
627.IP "getppid" 8
628.IX Item "getppid"
629This is identical to Perl's builtin \f(CW\*(C`getppid()\*(C'\fR function for
630returning the process identifier of the parent process of the current
631process , see \*(L"getppid\*(R" in perlfunc.
632.IP "getpwnam" 8
633.IX Item "getpwnam"
634This is identical to Perl's builtin \f(CW\*(C`getpwnam()\*(C'\fR function for
635returning user entries by user names, see \*(L"getpwnam\*(R" in perlfunc.
636.IP "getpwuid" 8
637.IX Item "getpwuid"
638This is identical to Perl's builtin \f(CW\*(C`getpwuid()\*(C'\fR function for
639returning user entries by user identifiers, see \*(L"getpwuid\*(R" in perlfunc.
640.IP "gets" 8
641.IX Item "gets"
642Returns one line from \f(CW\*(C`STDIN\*(C'\fR, similar to <>, also known
643as the \f(CW\*(C`readline()\*(C'\fR function, see \*(L"readline\*(R" in perlfunc.
644.Sp
645\&\fB\s-1NOTE\s0\fR: if you have C programs that still use \f(CW\*(C`gets()\*(C'\fR, be very
646afraid. The \f(CW\*(C`gets()\*(C'\fR function is a source of endless grief because
647it has no buffer overrun checks. It should \fBnever\fR be used. The
648\&\f(CW\*(C`fgets()\*(C'\fR function should be preferred instead.
649.IP "getuid" 8
650.IX Item "getuid"
651Returns the user's identifier. Identical to Perl's builtin \f(CW$<\fR variable,
652see \*(L"$UID\*(R" in perlvar.
653.IP "gmtime" 8
654.IX Item "gmtime"
655This is identical to Perl's builtin \f(CW\*(C`gmtime()\*(C'\fR function for
656converting seconds since the epoch to a date in Greenwich Mean Time,
657see \*(L"gmtime\*(R" in perlfunc.
658.IP "isalnum" 8
659.IX Item "isalnum"
660This is identical to the C function, except that it can apply to a
661single character or to a whole string. Note that locale settings may
662affect what characters are considered \f(CW\*(C`isalnum\*(C'\fR. Does not work on
663Unicode characters code point 256 or higher. Consider using regular
664expressions and the \f(CW\*(C`/[[:alnum:]]/\*(C'\fR construct instead, or possibly
665the \f(CW\*(C`/\ew/\*(C'\fR construct.
666.IP "isalpha" 8
667.IX Item "isalpha"
668This is identical to the C function, except that it can apply to
669a single character or to a whole string. Note that locale settings
670may affect what characters are considered \f(CW\*(C`isalpha\*(C'\fR. Does not work
671on Unicode characters code point 256 or higher. Consider using regular
672expressions and the \f(CW\*(C`/[[:alpha:]]/\*(C'\fR construct instead.
673.IP "isatty" 8
674.IX Item "isatty"
675Returns a boolean indicating whether the specified filehandle is connected
676to a tty. Similar to the \f(CW\*(C`\-t\*(C'\fR operator, see \*(L"\-X\*(R" in perlfunc.
677.IP "iscntrl" 8
678.IX Item "iscntrl"
679This is identical to the C function, except that it can apply to
680a single character or to a whole string. Note that locale settings
681may affect what characters are considered \f(CW\*(C`iscntrl\*(C'\fR. Does not work
682on Unicode characters code point 256 or higher. Consider using regular
683expressions and the \f(CW\*(C`/[[:cntrl:]]/\*(C'\fR construct instead.
684.IP "isdigit" 8
685.IX Item "isdigit"
686This is identical to the C function, except that it can apply to
687a single character or to a whole string. Note that locale settings
688may affect what characters are considered \f(CW\*(C`isdigit\*(C'\fR (unlikely, but
689still possible). Does not work on Unicode characters code point 256
690or higher. Consider using regular expressions and the \f(CW\*(C`/[[:digit:]]/\*(C'\fR
691construct instead, or the \f(CW\*(C`/\ed/\*(C'\fR construct.
692.IP "isgraph" 8
693.IX Item "isgraph"
694This is identical to the C function, except that it can apply to
695a single character or to a whole string. Note that locale settings
696may affect what characters are considered \f(CW\*(C`isgraph\*(C'\fR. Does not work
697on Unicode characters code point 256 or higher. Consider using regular
698expressions and the \f(CW\*(C`/[[:graph:]]/\*(C'\fR construct instead.
699.IP "islower" 8
700.IX Item "islower"
701This is identical to the C function, except that it can apply to
702a single character or to a whole string. Note that locale settings
703may affect what characters are considered \f(CW\*(C`islower\*(C'\fR. Does not work
704on Unicode characters code point 256 or higher. Consider using regular
705expressions and the \f(CW\*(C`/[[:lower:]]/\*(C'\fR construct instead. Do \fBnot\fR use
706\&\f(CW\*(C`/[a\-z]/\*(C'\fR.
707.IP "isprint" 8
708.IX Item "isprint"
709This is identical to the C function, except that it can apply to
710a single character or to a whole string. Note that locale settings
711may affect what characters are considered \f(CW\*(C`isprint\*(C'\fR. Does not work
712on Unicode characters code point 256 or higher. Consider using regular
713expressions and the \f(CW\*(C`/[[:print:]]/\*(C'\fR construct instead.
714.IP "ispunct" 8
715.IX Item "ispunct"
716This is identical to the C function, except that it can apply to
717a single character or to a whole string. Note that locale settings
718may affect what characters are considered \f(CW\*(C`ispunct\*(C'\fR. Does not work
719on Unicode characters code point 256 or higher. Consider using regular
720expressions and the \f(CW\*(C`/[[:punct:]]/\*(C'\fR construct instead.
721.IP "isspace" 8
722.IX Item "isspace"
723This is identical to the C function, except that it can apply to
724a single character or to a whole string. Note that locale settings
725may affect what characters are considered \f(CW\*(C`isspace\*(C'\fR. Does not work
726on Unicode characters code point 256 or higher. Consider using regular
727expressions and the \f(CW\*(C`/[[:space:]]/\*(C'\fR construct instead, or the \f(CW\*(C`/\es/\*(C'\fR
728construct. (Note that \f(CW\*(C`/\es/\*(C'\fR and \f(CW\*(C`/[[:space:]]/\*(C'\fR are slightly
729different in that \f(CW\*(C`/[[:space:]]/\*(C'\fR can normally match a vertical tab,
730while \f(CW\*(C`/\es/\*(C'\fR does not.)
731.IP "isupper" 8
732.IX Item "isupper"
733This is identical to the C function, except that it can apply to
734a single character or to a whole string. Note that locale settings
735may affect what characters are considered \f(CW\*(C`isupper\*(C'\fR. Does not work
736on Unicode characters code point 256 or higher. Consider using regular
737expressions and the \f(CW\*(C`/[[:upper:]]/\*(C'\fR construct instead. Do \fBnot\fR use
738\&\f(CW\*(C`/[A\-Z]/\*(C'\fR.
739.IP "isxdigit" 8
740.IX Item "isxdigit"
741This is identical to the C function, except that it can apply to a single
742character or to a whole string. Note that locale settings may affect what
743characters are considered \f(CW\*(C`isxdigit\*(C'\fR (unlikely, but still possible).
744Does not work on Unicode characters code point 256 or higher.
745Consider using regular expressions and the \f(CW\*(C`/[[:xdigit:]]/\*(C'\fR
746construct instead, or simply \f(CW\*(C`/[0\-9a\-f]/i\*(C'\fR.
747.IP "kill" 8
748.IX Item "kill"
749This is identical to Perl's builtin \f(CW\*(C`kill()\*(C'\fR function for sending
750signals to processes (often to terminate them), see \*(L"kill\*(R" in perlfunc.
751.IP "labs" 8
752.IX Item "labs"
753(For returning absolute values of long integers.)
754\&\fIlabs()\fR is C\-specific, see \*(L"abs\*(R" in perlfunc instead.
755.IP "ldexp" 8
756.IX Item "ldexp"
757This is identical to the C function \f(CW\*(C`ldexp()\*(C'\fR
758for multiplying floating point numbers with powers of two.
759.Sp
760.Vb 1
761\& $x_quadrupled = POSIX::ldexp($x, 2);
762.Ve
763.IP "ldiv" 8
764.IX Item "ldiv"
765(For computing dividends of long integers.)
766\&\fIldiv()\fR is C\-specific, use \f(CW\*(C`/\*(C'\fR and \f(CW\*(C`int()\*(C'\fR instead.
767.IP "link" 8
768.IX Item "link"
769This is identical to Perl's builtin \f(CW\*(C`link()\*(C'\fR function
770for creating hard links into files, see \*(L"link\*(R" in perlfunc.
771.IP "localeconv" 8
772.IX Item "localeconv"
773Get numeric formatting information. Returns a reference to a hash
774containing the current locale formatting values.
775.Sp
776Here is how to query the database for the \fBde\fR (Deutsch or German) locale.
777.Sp
778.Vb 21
779\& $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
780\& print "Locale = $loc\en";
781\& $lconv = POSIX::localeconv();
782\& print "decimal_point = ", $lconv->{decimal_point}, "\en";
783\& print "thousands_sep = ", $lconv->{thousands_sep}, "\en";
784\& print "grouping = ", $lconv->{grouping}, "\en";
785\& print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\en";
786\& print "currency_symbol = ", $lconv->{currency_symbol}, "\en";
787\& print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\en";
788\& print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\en";
789\& print "mon_grouping = ", $lconv->{mon_grouping}, "\en";
790\& print "positive_sign = ", $lconv->{positive_sign}, "\en";
791\& print "negative_sign = ", $lconv->{negative_sign}, "\en";
792\& print "int_frac_digits = ", $lconv->{int_frac_digits}, "\en";
793\& print "frac_digits = ", $lconv->{frac_digits}, "\en";
794\& print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\en";
795\& print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\en";
796\& print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\en";
797\& print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\en";
798\& print "p_sign_posn = ", $lconv->{p_sign_posn}, "\en";
799\& print "n_sign_posn = ", $lconv->{n_sign_posn}, "\en";
800.Ve
801.IP "localtime" 8
802.IX Item "localtime"
803This is identical to Perl's builtin \f(CW\*(C`localtime()\*(C'\fR function for
804converting seconds since the epoch to a date see \*(L"localtime\*(R" in perlfunc.
805.IP "log" 8
806.IX Item "log"
807This is identical to Perl's builtin \f(CW\*(C`log()\*(C'\fR function,
808returning the natural (\fIe\fR\-based) logarithm of the numerical argument,
809see \*(L"log\*(R" in perlfunc.
810.IP "log10" 8
811.IX Item "log10"
812This is identical to the C function \f(CW\*(C`log10()\*(C'\fR,
813returning the 10\-base logarithm of the numerical argument.
814You can also use
815.Sp
816.Vb 1
817\& sub log10 { log($_[0]) / log(10) }
818.Ve
819.Sp
820or
821.Sp
822.Vb 1
823\& sub log10 { log($_[0]) / 2.30258509299405 }
824.Ve
825.Sp
826or
827.Sp
828.Vb 1
829\& sub log10 { log($_[0]) * 0.434294481903252 }
830.Ve
831.IP "longjmp" 8
832.IX Item "longjmp"
833\&\fIlongjmp()\fR is C\-specific: use \*(L"die\*(R" in perlfunc instead.
834.IP "lseek" 8
835.IX Item "lseek"
836Move the file's read/write position. This uses file descriptors such as
837those obtained by calling \f(CW\*(C`POSIX::open\*(C'\fR.
838.Sp
839.Vb 2
840\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
841\& $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
842.Ve
843.Sp
844Returns \f(CW\*(C`undef\*(C'\fR on failure.
845.IP "malloc" 8
846.IX Item "malloc"
847\&\fImalloc()\fR is C\-specific. Perl does memory management transparently.
848.IP "mblen" 8
849.IX Item "mblen"
850This is identical to the C function \f(CW\*(C`mblen()\*(C'\fR.
851Perl does not have any support for the wide and multibyte
852characters of the C standards, so this might be a rather
853useless function.
854.IP "mbstowcs" 8
855.IX Item "mbstowcs"
856This is identical to the C function \f(CW\*(C`mbstowcs()\*(C'\fR.
857Perl does not have any support for the wide and multibyte
858characters of the C standards, so this might be a rather
859useless function.
860.IP "mbtowc" 8
861.IX Item "mbtowc"
862This is identical to the C function \f(CW\*(C`mbtowc()\*(C'\fR.
863Perl does not have any support for the wide and multibyte
864characters of the C standards, so this might be a rather
865useless function.
866.IP "memchr" 8
867.IX Item "memchr"
868\&\fImemchr()\fR is C\-specific, see \*(L"index\*(R" in perlfunc instead.
869.IP "memcmp" 8
870.IX Item "memcmp"
871\&\fImemcmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR instead, see perlop.
872.IP "memcpy" 8
873.IX Item "memcpy"
874\&\fImemcpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR, see perlop, or see \*(L"substr\*(R" in perlfunc.
875.IP "memmove" 8
876.IX Item "memmove"
877\&\fImemmove()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR, see perlop, or see \*(L"substr\*(R" in perlfunc.
878.IP "memset" 8
879.IX Item "memset"
880\&\fImemset()\fR is C\-specific, use \f(CW\*(C`x\*(C'\fR instead, see perlop.
881.IP "mkdir" 8
882.IX Item "mkdir"
883This is identical to Perl's builtin \f(CW\*(C`mkdir()\*(C'\fR function
884for creating directories, see \*(L"mkdir\*(R" in perlfunc.
885.IP "mkfifo" 8
886.IX Item "mkfifo"
887This is similar to the C function \f(CW\*(C`mkfifo()\*(C'\fR for creating
888\&\s-1FIFO\s0 special files.
889.Sp
890.Vb 1
891\& if (mkfifo($path, $mode)) { ....
892.Ve
893.Sp
894Returns \f(CW\*(C`undef\*(C'\fR on failure. The \f(CW$mode\fR is similar to the
895mode of \f(CW\*(C`mkdir()\*(C'\fR, see \*(L"mkdir\*(R" in perlfunc.
896.IP "mktime" 8
897.IX Item "mktime"
898Convert date/time info to a calendar time.
899.Sp
900Synopsis:
901.Sp
902.Vb 1
903\& mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
904.Ve
905.Sp
906The 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.
907I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
908year (\f(CW\*(C`year\*(C'\fR) is given in years since 1900. I.e. The year 1995 is 95; the
909year 2001 is 101. Consult your system's \f(CW\*(C`mktime()\*(C'\fR manpage for details
910about these and the other arguments.
911.Sp
912Calendar time for December 12, 1995, at 10:30 am.
913.Sp
914.Vb 2
915\& $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
916\& print "Date = ", POSIX::ctime($time_t);
917.Ve
918.Sp
919Returns \f(CW\*(C`undef\*(C'\fR on failure.
920.IP "modf" 8
921.IX Item "modf"
922Return the integral and fractional parts of a floating-point number.
923.Sp
924.Vb 1
925\& ($fractional, $integral) = POSIX::modf( 3.14 );
926.Ve
927.IP "nice" 8
928.IX Item "nice"
929This is similar to the C function \f(CW\*(C`nice()\*(C'\fR, for changing
930the scheduling preference of the current process. Positive
931arguments mean more polite process, negative values more
932needy process. Normal user processes can only be more polite.
933.Sp
934Returns \f(CW\*(C`undef\*(C'\fR on failure.
935.IP "offsetof" 8
936.IX Item "offsetof"
937\&\fIoffsetof()\fR is C\-specific, you probably want to see \*(L"pack\*(R" in perlfunc instead.
938.IP "open" 8
939.IX Item "open"
940Open a file for reading for writing. This returns file descriptors, not
941Perl filehandles. Use \f(CW\*(C`POSIX::close\*(C'\fR to close the file.
942.Sp
943Open a file read-only with mode 0666.
944.Sp
945.Vb 1
946\& $fd = POSIX::open( "foo" );
947.Ve
948.Sp
949Open a file for read and write.
950.Sp
951.Vb 1
952\& $fd = POSIX::open( "foo", &POSIX::O_RDWR );
953.Ve
954.Sp
955Open a file for write, with truncation.
956.Sp
957.Vb 1
958\& $fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );
959.Ve
960.Sp
961Create a new file with mode 0640. Set up the file for writing.
962.Sp
963.Vb 1
964\& $fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );
965.Ve
966.Sp
967Returns \f(CW\*(C`undef\*(C'\fR on failure.
968.Sp
969See also \*(L"sysopen\*(R" in perlfunc.
970.IP "opendir" 8
971.IX Item "opendir"
972Open a directory for reading.
973.Sp
974.Vb 3
975\& $dir = POSIX::opendir( "/var" );
976\& @files = POSIX::readdir( $dir );
977\& POSIX::closedir( $dir );
978.Ve
979.Sp
980Returns \f(CW\*(C`undef\*(C'\fR on failure.
981.IP "pathconf" 8
982.IX Item "pathconf"
983Retrieves the value of a configurable limit on a file or directory.
984.Sp
985The following will determine the maximum length of the longest allowable
986pathname on the filesystem which holds \f(CW\*(C`/var\*(C'\fR.
987.Sp
988.Vb 1
989\& $path_max = POSIX::pathconf( "/var", &POSIX::_PC_PATH_MAX );
990.Ve
991.Sp
992Returns \f(CW\*(C`undef\*(C'\fR on failure.
993.IP "pause" 8
994.IX Item "pause"
995This is similar to the C function \f(CW\*(C`pause()\*(C'\fR, which suspends
996the execution of the current process until a signal is received.
997.Sp
998Returns \f(CW\*(C`undef\*(C'\fR on failure.
999.IP "perror" 8
1000.IX Item "perror"
1001This is identical to the C function \f(CW\*(C`perror()\*(C'\fR, which outputs to the
1002standard error stream the specified message followed by \*(L": \*(R" and the
1003current error string. Use the \f(CW\*(C`warn()\*(C'\fR function and the \f(CW$!\fR
1004variable instead, see \*(L"warn\*(R" in perlfunc and \*(L"$ERRNO\*(R" in perlvar.
1005.IP "pipe" 8
1006.IX Item "pipe"
1007Create an interprocess channel. This returns file descriptors like those
1008returned by \f(CW\*(C`POSIX::open\*(C'\fR.
1009.Sp
1010.Vb 3
1011\& my ($read, $write) = POSIX::pipe();
1012\& POSIX::write( $write, "hello", 5 );
1013\& POSIX::read( $read, $buf, 5 );
1014.Ve
1015.Sp
1016See also \*(L"pipe\*(R" in perlfunc.
1017.IP "pow" 8
1018.IX Item "pow"
1019Computes \f(CW$x\fR raised to the power \f(CW$exponent\fR.
1020.Sp
1021.Vb 1
1022\& $ret = POSIX::pow( $x, $exponent );
1023.Ve
1024.Sp
1025You can also use the \f(CW\*(C`**\*(C'\fR operator, see perlop.
1026.IP "printf" 8
1027.IX Item "printf"
1028Formats and prints the specified arguments to \s-1STDOUT\s0.
1029See also \*(L"printf\*(R" in perlfunc.
1030.IP "putc" 8
1031.IX Item "putc"
1032\&\fIputc()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
1033.IP "putchar" 8
1034.IX Item "putchar"
1035\&\fIputchar()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
1036.IP "puts" 8
1037.IX Item "puts"
1038\&\fIputs()\fR is C\-specific, see \*(L"print\*(R" in perlfunc instead.
1039.IP "qsort" 8
1040.IX Item "qsort"
1041\&\fIqsort()\fR is C\-specific, see \*(L"sort\*(R" in perlfunc instead.
1042.IP "raise" 8
1043.IX Item "raise"
1044Sends the specified signal to the current process.
1045See also \*(L"kill\*(R" in perlfunc and the \f(CW$$\fR in \*(L"$PID\*(R" in perlvar.
1046.IP "rand" 8
1047.IX Item "rand"
1048\&\f(CW\*(C`rand()\*(C'\fR is non\-portable, see \*(L"rand\*(R" in perlfunc instead.
1049.IP "read" 8
1050.IX Item "read"
1051Read from a file. This uses file descriptors such as those obtained by
1052calling \f(CW\*(C`POSIX::open\*(C'\fR. If the buffer \f(CW$buf\fR is not large enough for the
1053read then Perl will extend it to make room for the request.
1054.Sp
1055.Vb 2
1056\& $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1057\& $bytes = POSIX::read( $fd, $buf, 3 );
1058.Ve
1059.Sp
1060Returns \f(CW\*(C`undef\*(C'\fR on failure.
1061.Sp
1062See also \*(L"sysread\*(R" in perlfunc.
1063.IP "readdir" 8
1064.IX Item "readdir"
1065This is identical to Perl's builtin \f(CW\*(C`readdir()\*(C'\fR function
1066for reading directory entries, see \*(L"readdir\*(R" in perlfunc.
1067.IP "realloc" 8
1068.IX Item "realloc"
1069\&\fIrealloc()\fR is C\-specific. Perl does memory management transparently.
1070.IP "remove" 8
1071.IX Item "remove"
1072This is identical to Perl's builtin \f(CW\*(C`unlink()\*(C'\fR function
1073for removing files, see \*(L"unlink\*(R" in perlfunc.
1074.IP "rename" 8
1075.IX Item "rename"
1076This is identical to Perl's builtin \f(CW\*(C`rename()\*(C'\fR function
1077for renaming files, see \*(L"rename\*(R" in perlfunc.
1078.IP "rewind" 8
1079.IX Item "rewind"
1080Seeks to the beginning of the file.
1081.IP "rewinddir" 8
1082.IX Item "rewinddir"
1083This is identical to Perl's builtin \f(CW\*(C`rewinddir()\*(C'\fR function for
1084rewinding directory entry streams, see \*(L"rewinddir\*(R" in perlfunc.
1085.IP "rmdir" 8
1086.IX Item "rmdir"
1087This is identical to Perl's builtin \f(CW\*(C`rmdir()\*(C'\fR function
1088for removing (empty) directories, see \*(L"rmdir\*(R" in perlfunc.
1089.IP "scanf" 8
1090.IX Item "scanf"
1091\&\fIscanf()\fR is C\-specific, use <> and regular expressions instead,
1092see perlre.
1093.IP "setgid" 8
1094.IX Item "setgid"
1095Sets the real group identifier and the effective group identifier for
1096this process. Similar to assigning a value to the Perl's builtin
1097\&\f(CW$)\fR variable, see \*(L"$GID\*(R" in perlvar, except that the latter
1098will change only the real user identifier, and that the \fIsetgid()\fR
1099uses only a single numeric argument, as opposed to a space-separated
1100list of numbers.
1101.IP "setjmp" 8
1102.IX Item "setjmp"
1103\&\f(CW\*(C`setjmp()\*(C'\fR is C\-specific: use \f(CW\*(C`eval {}\*(C'\fR instead,
1104see \*(L"eval\*(R" in perlfunc.
1105.IP "setlocale" 8
1106.IX Item "setlocale"
1107Modifies and queries program's locale. The following examples assume
1108.Sp
1109.Vb 1
1110\& use POSIX qw(setlocale LC_ALL LC_CTYPE);
1111.Ve
1112.Sp
1113has been issued.
1114.Sp
1115The following will set the traditional \s-1UNIX\s0 system locale behavior
1116(the second argument \f(CW"C"\fR).
1117.Sp
1118.Vb 1
1119\& $loc = setlocale( LC_ALL, "C" );
1120.Ve
1121.Sp
1122The following will query the current \s-1LC_CTYPE\s0 category. (No second
1123argument means 'query'.)
1124.Sp
1125.Vb 1
1126\& $loc = setlocale( LC_CTYPE );
1127.Ve
1128.Sp
1129The following will set the \s-1LC_CTYPE\s0 behaviour according to the locale
1130environment variables (the second argument \f(CW""\fR).
1131Please see your systems \f(CWsetlocale(3)\fR documentation for the locale
1132environment variables' meaning or consult perllocale.
1133.Sp
1134.Vb 1
1135\& $loc = setlocale( LC_CTYPE, "" );
1136.Ve
1137.Sp
1138The following will set the \s-1LC_COLLATE\s0 behaviour to Argentinian
1139Spanish. \fB\s-1NOTE\s0\fR: The naming and availability of locales depends on
1140your operating system. Please consult perllocale for how to find
1141out which locales are available in your system.
1142.Sp
1143.Vb 1
1144\& $loc = setlocale( LC_ALL, "es_AR.ISO8859-1" );
1145.Ve
1146.IP "setpgid" 8
1147.IX Item "setpgid"
1148This is similar to the C function \f(CW\*(C`setpgid()\*(C'\fR for
1149setting the process group identifier of the current process.
1150.Sp
1151Returns \f(CW\*(C`undef\*(C'\fR on failure.
1152.IP "setsid" 8
1153.IX Item "setsid"
1154This is identical to the C function \f(CW\*(C`setsid()\*(C'\fR for
1155setting the session identifier of the current process.
1156.IP "setuid" 8
1157.IX Item "setuid"
1158Sets the real user identifier and the effective user identifier for
1159this process. Similar to assigning a value to the Perl's builtin
1160\&\f(CW$<\fR variable, see \*(L"$UID\*(R" in perlvar, except that the latter
1161will change only the real user identifier.
1162.IP "sigaction" 8
1163.IX Item "sigaction"
1164Detailed signal management. This uses \f(CW\*(C`POSIX::SigAction\*(C'\fR objects for the
1165\&\f(CW\*(C`action\*(C'\fR and \f(CW\*(C`oldaction\*(C'\fR arguments. Consult your system's \f(CW\*(C`sigaction\*(C'\fR
1166manpage for details.
1167.Sp
1168Synopsis:
1169.Sp
1170.Vb 1
1171\& sigaction(signal, action, oldaction = 0)
1172.Ve
1173.Sp
1174Returns \f(CW\*(C`undef\*(C'\fR on failure. The \f(CW\*(C`signal\*(C'\fR must be a number (like
1175\&\s-1SIGHUP\s0), not a string (like \*(L"\s-1SIGHUP\s0\*(R"), though Perl does try hard
1176to understand you.
1177.IP "siglongjmp" 8
1178.IX Item "siglongjmp"
1179\&\fIsiglongjmp()\fR is C\-specific: use \*(L"die\*(R" in perlfunc instead.
1180.IP "sigpending" 8
1181.IX Item "sigpending"
1182Examine signals that are blocked and pending. This uses \f(CW\*(C`POSIX::SigSet\*(C'\fR
1183objects for the \f(CW\*(C`sigset\*(C'\fR argument. Consult your system's \f(CW\*(C`sigpending\*(C'\fR
1184manpage for details.
1185.Sp
1186Synopsis:
1187.Sp
1188.Vb 1
1189\& sigpending(sigset)
1190.Ve
1191.Sp
1192Returns \f(CW\*(C`undef\*(C'\fR on failure.
1193.IP "sigprocmask" 8
1194.IX Item "sigprocmask"
1195Change and/or examine calling process's signal mask. This uses
1196\&\f(CW\*(C`POSIX::SigSet\*(C'\fR objects for the \f(CW\*(C`sigset\*(C'\fR and \f(CW\*(C`oldsigset\*(C'\fR arguments.
1197Consult your system's \f(CW\*(C`sigprocmask\*(C'\fR manpage for details.
1198.Sp
1199Synopsis:
1200.Sp
1201.Vb 1
1202\& sigprocmask(how, sigset, oldsigset = 0)
1203.Ve
1204.Sp
1205Returns \f(CW\*(C`undef\*(C'\fR on failure.
1206.IP "sigsetjmp" 8
1207.IX Item "sigsetjmp"
1208\&\f(CW\*(C`sigsetjmp()\*(C'\fR is C\-specific: use \f(CW\*(C`eval {}\*(C'\fR instead,
1209see \*(L"eval\*(R" in perlfunc.
1210.IP "sigsuspend" 8
1211.IX Item "sigsuspend"
1212Install a signal mask and suspend process until signal arrives. This uses
1213\&\f(CW\*(C`POSIX::SigSet\*(C'\fR objects for the \f(CW\*(C`signal_mask\*(C'\fR argument. Consult your
1214system's \f(CW\*(C`sigsuspend\*(C'\fR manpage for details.
1215.Sp
1216Synopsis:
1217.Sp
1218.Vb 1
1219\& sigsuspend(signal_mask)
1220.Ve
1221.Sp
1222Returns \f(CW\*(C`undef\*(C'\fR on failure.
1223.IP "sin" 8
1224.IX Item "sin"
1225This is identical to Perl's builtin \f(CW\*(C`sin()\*(C'\fR function
1226for returning the sine of the numerical argument,
1227see \*(L"sin\*(R" in perlfunc. See also Math::Trig.
1228.IP "sinh" 8
1229.IX Item "sinh"
1230This is identical to the C function \f(CW\*(C`sinh()\*(C'\fR
1231for returning the hyperbolic sine of the numerical argument.
1232See also Math::Trig.
1233.IP "sleep" 8
1234.IX Item "sleep"
1235This is functionally identical to Perl's builtin \f(CW\*(C`sleep()\*(C'\fR function
1236for suspending the execution of the current for process for certain
1237number of seconds, see \*(L"sleep\*(R" in perlfunc. There is one significant
1238difference, however: \f(CW\*(C`POSIX::sleep()\*(C'\fR returns the number of
1239\&\fBunslept\fR seconds, while the \f(CW\*(C`CORE::sleep()\*(C'\fR returns the
1240number of slept seconds.
1241.IP "sprintf" 8
1242.IX Item "sprintf"
1243This is similar to Perl's builtin \f(CW\*(C`sprintf()\*(C'\fR function
1244for returning a string that has the arguments formatted as requested,
1245see \*(L"sprintf\*(R" in perlfunc.
1246.IP "sqrt" 8
1247.IX Item "sqrt"
1248This is identical to Perl's builtin \f(CW\*(C`sqrt()\*(C'\fR function.
1249for returning the square root of the numerical argument,
1250see \*(L"sqrt\*(R" in perlfunc.
1251.IP "srand" 8
1252.IX Item "srand"
1253Give a seed the pseudorandom number generator, see \*(L"srand\*(R" in perlfunc.
1254.IP "sscanf" 8
1255.IX Item "sscanf"
1256\&\fIsscanf()\fR is C\-specific, use regular expressions instead,
1257see perlre.
1258.IP "stat" 8
1259.IX Item "stat"
1260This is identical to Perl's builtin \f(CW\*(C`stat()\*(C'\fR function
1261for returning information about files and directories.
1262.IP "strcat" 8
1263.IX Item "strcat"
1264\&\fIstrcat()\fR is C\-specific, use \f(CW\*(C`.=\*(C'\fR instead, see perlop.
1265.IP "strchr" 8
1266.IX Item "strchr"
1267\&\fIstrchr()\fR is C\-specific, see \*(L"index\*(R" in perlfunc instead.
1268.IP "strcmp" 8
1269.IX Item "strcmp"
1270\&\fIstrcmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR or \f(CW\*(C`cmp\*(C'\fR instead, see perlop.
1271.IP "strcoll" 8
1272.IX Item "strcoll"
1273This is identical to the C function \f(CW\*(C`strcoll()\*(C'\fR
1274for collating (comparing) strings transformed using
1275the \f(CW\*(C`strxfrm()\*(C'\fR function. Not really needed since
1276Perl can do this transparently, see perllocale.
1277.IP "strcpy" 8
1278.IX Item "strcpy"
1279\&\fIstrcpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR instead, see perlop.
1280.IP "strcspn" 8
1281.IX Item "strcspn"
1282\&\fIstrcspn()\fR is C\-specific, use regular expressions instead,
1283see perlre.
1284.IP "strerror" 8
1285.IX Item "strerror"
1286Returns the error string for the specified errno.
1287Identical to the string form of the \f(CW$!\fR, see \*(L"$ERRNO\*(R" in perlvar.
1288.IP "strftime" 8
1289.IX Item "strftime"
1290Convert date and time information to string. Returns the string.
1291.Sp
1292Synopsis:
1293.Sp
1294.Vb 1
1295\& strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
1296.Ve
1297.Sp
1298The 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.
1299I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
1300year (\f(CW\*(C`year\*(C'\fR) is given in years since 1900. I.e., the year 1995 is 95; the
1301year 2001 is 101. Consult your system's \f(CW\*(C`strftime()\*(C'\fR manpage for details
1302about these and the other arguments.
1303.Sp
1304If you want your code to be portable, your format (\f(CW\*(C`fmt\*(C'\fR) argument
1305should use only the conversion specifiers defined by the \s-1ANSI\s0 C
1306standard (C89, to play safe). These are \f(CW\*(C`aAbBcdHIjmMpSUwWxXyYZ%\*(C'\fR.
1307But even then, the \fBresults\fR of some of the conversion specifiers are
1308non\-portable. For example, the specifiers \f(CW\*(C`aAbBcpZ\*(C'\fR change according
1309to the locale settings of the user, and both how to set locales (the
1310locale names) and what output to expect are non\-standard.
1311The specifier \f(CW\*(C`c\*(C'\fR changes according to the timezone settings of the
1312user and the timezone computation rules of the operating system.
1313The \f(CW\*(C`Z\*(C'\fR specifier is notoriously unportable since the names of
1314timezones are non\-standard. Sticking to the numeric specifiers is the
1315safest route.
1316.Sp
1317The given arguments are made consistent as though by calling
1318\&\f(CW\*(C`mktime()\*(C'\fR before calling your system's \f(CW\*(C`strftime()\*(C'\fR function,
1319except that the \f(CW\*(C`isdst\*(C'\fR value is not affected.
1320.Sp
1321The string for Tuesday, December 12, 1995.
1322.Sp
1323.Vb 2
1324\& $str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 );
1325\& print "$str\en";
1326.Ve
1327.IP "strlen" 8
1328.IX Item "strlen"
1329\&\fIstrlen()\fR is C\-specific, use \f(CW\*(C`length()\*(C'\fR instead, see \*(L"length\*(R" in perlfunc.
1330.IP "strncat" 8
1331.IX Item "strncat"
1332\&\fIstrncat()\fR is C\-specific, use \f(CW\*(C`.=\*(C'\fR instead, see perlop.
1333.IP "strncmp" 8
1334.IX Item "strncmp"
1335\&\fIstrncmp()\fR is C\-specific, use \f(CW\*(C`eq\*(C'\fR instead, see perlop.
1336.IP "strncpy" 8
1337.IX Item "strncpy"
1338\&\fIstrncpy()\fR is C\-specific, use \f(CW\*(C`=\*(C'\fR instead, see perlop.
1339.IP "strpbrk" 8
1340.IX Item "strpbrk"
1341\&\fIstrpbrk()\fR is C\-specific, use regular expressions instead,
1342see perlre.
1343.IP "strrchr" 8
1344.IX Item "strrchr"
1345\&\fIstrrchr()\fR is C\-specific, see \*(L"rindex\*(R" in perlfunc instead.
1346.IP "strspn" 8
1347.IX Item "strspn"
1348\&\fIstrspn()\fR is C\-specific, use regular expressions instead,
1349see perlre.
1350.IP "strstr" 8
1351.IX Item "strstr"
1352This is identical to Perl's builtin \f(CW\*(C`index()\*(C'\fR function,
1353see \*(L"index\*(R" in perlfunc.
1354.IP "strtod" 8
1355.IX Item "strtod"
1356String to double translation. Returns the parsed number and the number
1357of characters in the unparsed portion of the string. Truly
1358POSIX-compliant systems set $! ($ERRNO) to indicate a translation
1359error, so clear $! before calling strtod. However, non-POSIX systems
1360may not check for overflow, and therefore will never set $!.
1361.Sp
1362strtod should respect any \s-1POSIX\s0 \fI\fIsetlocale()\fI\fR settings.
1363.Sp
1364To parse a string \f(CW$str\fR as a floating point number use
1365.Sp
1366.Vb 2
1367\& $! = 0;
1368\& ($num, $n_unparsed) = POSIX::strtod($str);
1369.Ve
1370.Sp
1371The second returned item and $! can be used to check for valid input:
1372.Sp
1373.Vb 3
1374\& if (($str eq '') || ($n_unparsed != 0) || $!) {
1375\& die "Non-numeric input $str" . ($! ? ": $!\en" : "\en");
1376\& }
1377.Ve
1378.Sp
1379When called in a scalar context strtod returns the parsed number.
1380.IP "strtok" 8
1381.IX Item "strtok"
1382\&\fIstrtok()\fR is C\-specific, use regular expressions instead, see
1383perlre, or \*(L"split\*(R" in perlfunc.
1384.IP "strtol" 8
1385.IX Item "strtol"
1386String to (long) integer translation. Returns the parsed number and
1387the number of characters in the unparsed portion of the string. Truly
1388POSIX-compliant systems set $! ($ERRNO) to indicate a translation
1389error, so clear $! before calling strtol. However, non-POSIX systems
1390may not check for overflow, and therefore will never set $!.
1391.Sp
1392strtol should respect any \s-1POSIX\s0 \fI\fIsetlocale()\fI\fR settings.
1393.Sp
1394To parse a string \f(CW$str\fR as a number in some base \f(CW$base\fR use
1395.Sp
1396.Vb 2
1397\& $! = 0;
1398\& ($num, $n_unparsed) = POSIX::strtol($str, $base);
1399.Ve
1400.Sp
1401The base should be zero or between 2 and 36, inclusive. When the base
1402is zero or omitted strtol will use the string itself to determine the
1403base: a leading \*(L"0x\*(R" or \*(L"0X\*(R" means hexadecimal; a leading \*(L"0\*(R" means
1404octal; any other leading characters mean decimal. Thus, \*(L"1234\*(R" is
1405parsed as a decimal number, \*(L"01234\*(R" as an octal number, and \*(L"0x1234\*(R"
1406as a hexadecimal number.
1407.Sp
1408The second returned item and $! can be used to check for valid input:
1409.Sp
1410.Vb 3
1411\& if (($str eq '') || ($n_unparsed != 0) || !$!) {
1412\& die "Non-numeric input $str" . $! ? ": $!\en" : "\en";
1413\& }
1414.Ve
1415.Sp
1416When called in a scalar context strtol returns the parsed number.
1417.IP "strtoul" 8
1418.IX Item "strtoul"
1419String to unsigned (long) integer translation. \fIstrtoul()\fR is identical
1420to \fIstrtol()\fR except that \fIstrtoul()\fR only parses unsigned integers. See
1421\&\*(L"strtol\*(R" for details.
1422.Sp
1423Note: Some vendors supply \fIstrtod()\fR and \fIstrtol()\fR but not \fIstrtoul()\fR.
1424Other vendors that do supply \fIstrtoul()\fR parse \*(L"\-1\*(R" as a valid value.
1425.IP "strxfrm" 8
1426.IX Item "strxfrm"
1427String transformation. Returns the transformed string.
1428.Sp
1429.Vb 1
1430\& $dst = POSIX::strxfrm( $src );
1431.Ve
1432.Sp
1433Used in conjunction with the \f(CW\*(C`strcoll()\*(C'\fR function, see \*(L"strcoll\*(R".
1434.Sp
1435Not really needed since Perl can do this transparently, see
1436perllocale.
1437.IP "sysconf" 8
1438.IX Item "sysconf"
1439Retrieves values of system configurable variables.
1440.Sp
1441The following will get the machine's clock speed.
1442.Sp
1443.Vb 1
1444\& $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1445.Ve
1446.Sp
1447Returns \f(CW\*(C`undef\*(C'\fR on failure.
1448.IP "system" 8
1449.IX Item "system"
1450This is identical to Perl's builtin \f(CW\*(C`system()\*(C'\fR function, see
1451\&\*(L"system\*(R" in perlfunc.
1452.IP "tan" 8
1453.IX Item "tan"
1454This is identical to the C function \f(CW\*(C`tan()\*(C'\fR, returning the
1455tangent of the numerical argument. See also Math::Trig.
1456.IP "tanh" 8
1457.IX Item "tanh"
1458This is identical to the C function \f(CW\*(C`tanh()\*(C'\fR, returning the
1459hyperbolic tangent of the numerical argument. See also Math::Trig.
1460.IP "tcdrain" 8
1461.IX Item "tcdrain"
1462This is similar to the C function \f(CW\*(C`tcdrain()\*(C'\fR for draining
1463the output queue of its argument stream.
1464.Sp
1465Returns \f(CW\*(C`undef\*(C'\fR on failure.
1466.IP "tcflow" 8
1467.IX Item "tcflow"
1468This is similar to the C function \f(CW\*(C`tcflow()\*(C'\fR for controlling
1469the flow of its argument stream.
1470.Sp
1471Returns \f(CW\*(C`undef\*(C'\fR on failure.
1472.IP "tcflush" 8
1473.IX Item "tcflush"
1474This is similar to the C function \f(CW\*(C`tcflush()\*(C'\fR for flushing
1475the I/O buffers of its argument stream.
1476.Sp
1477Returns \f(CW\*(C`undef\*(C'\fR on failure.
1478.IP "tcgetpgrp" 8
1479.IX Item "tcgetpgrp"
1480This is identical to the C function \f(CW\*(C`tcgetpgrp()\*(C'\fR for returning the
1481process group identifier of the foreground process group of the controlling
1482terminal.
1483.IP "tcsendbreak" 8
1484.IX Item "tcsendbreak"
1485This is similar to the C function \f(CW\*(C`tcsendbreak()\*(C'\fR for sending
1486a break on its argument stream.
1487.Sp
1488Returns \f(CW\*(C`undef\*(C'\fR on failure.
1489.IP "tcsetpgrp" 8
1490.IX Item "tcsetpgrp"
1491This is similar to the C function \f(CW\*(C`tcsetpgrp()\*(C'\fR for setting the
1492process group identifier of the foreground process group of the controlling
1493terminal.
1494.Sp
1495Returns \f(CW\*(C`undef\*(C'\fR on failure.
1496.IP "time" 8
1497.IX Item "time"
1498This is identical to Perl's builtin \f(CW\*(C`time()\*(C'\fR function
1499for returning the number of seconds since the epoch
1500(whatever it is for the system), see \*(L"time\*(R" in perlfunc.
1501.IP "times" 8
1502.IX Item "times"
1503The \fItimes()\fR function returns elapsed realtime since some point in the past
1504(such as system startup), user and system times for this process, and user
1505and system times used by child processes. All times are returned in clock
1506ticks.
1507.Sp
1508.Vb 1
1509\& ($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
1510.Ve
1511.Sp
1512Note: Perl's builtin \f(CW\*(C`times()\*(C'\fR function returns four values, measured in
1513seconds.
1514.IP "tmpfile" 8
1515.IX Item "tmpfile"
1516Use method \f(CW\*(C`IO::File::new_tmpfile()\*(C'\fR instead, or see File::Temp.
1517.IP "tmpnam" 8
1518.IX Item "tmpnam"
1519Returns a name for a temporary file.
1520.Sp
1521.Vb 1
1522\& $tmpfile = POSIX::tmpnam();
1523.Ve
1524.Sp
1525For security reasons, which are probably detailed in your system's
1526documentation for the C library \fItmpnam()\fR function, this interface
1527should not be used; instead see File::Temp.
1528.IP "tolower" 8
1529.IX Item "tolower"
1530This is identical to the C function, except that it can apply to a single
1531character or to a whole string. Consider using the \f(CW\*(C`lc()\*(C'\fR function,
1532see \*(L"lc\*(R" in perlfunc, or the equivalent \f(CW\*(C`\eL\*(C'\fR operator inside doublequotish
1533strings.
1534.IP "toupper" 8
1535.IX Item "toupper"
1536This is identical to the C function, except that it can apply to a single
1537character or to a whole string. Consider using the \f(CW\*(C`uc()\*(C'\fR function,
1538see \*(L"uc\*(R" in perlfunc, or the equivalent \f(CW\*(C`\eU\*(C'\fR operator inside doublequotish
1539strings.
1540.IP "ttyname" 8
1541.IX Item "ttyname"
1542This is identical to the C function \f(CW\*(C`ttyname()\*(C'\fR for returning the
1543name of the current terminal.
1544.IP "tzname" 8
1545.IX Item "tzname"
1546Retrieves the time conversion information from the \f(CW\*(C`tzname\*(C'\fR variable.
1547.Sp
1548.Vb 2
1549\& POSIX::tzset();
1550\& ($std, $dst) = POSIX::tzname();
1551.Ve
1552.IP "tzset" 8
1553.IX Item "tzset"
1554This is identical to the C function \f(CW\*(C`tzset()\*(C'\fR for setting
1555the current timezone based on the environment variable \f(CW\*(C`TZ\*(C'\fR,
1556to be used by \f(CW\*(C`ctime()\*(C'\fR, \f(CW\*(C`localtime()\*(C'\fR, \f(CW\*(C`mktime()\*(C'\fR, and \f(CW\*(C`strftime()\*(C'\fR
1557functions.
1558.IP "umask" 8
1559.IX Item "umask"
1560This is identical to Perl's builtin \f(CW\*(C`umask()\*(C'\fR function
1561for setting (and querying) the file creation permission mask,
1562see \*(L"umask\*(R" in perlfunc.
1563.IP "uname" 8
1564.IX Item "uname"
1565Get name of current operating system.
1566.Sp
1567.Vb 1
1568\& ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
1569.Ve
1570.Sp
1571Note that the actual meanings of the various fields are not
1572that well standardized, do not expect any great portability.
1573The \f(CW$sysname\fR might be the name of the operating system,
1574the \f(CW$nodename\fR might be the name of the host, the \f(CW$release\fR
1575might be the (major) release number of the operating system,
1576the \f(CW$version\fR might be the (minor) release number of the
1577operating system, and the \f(CW$machine\fR might be a hardware identifier.
1578Maybe.
1579.IP "ungetc" 8
1580.IX Item "ungetc"
1581Use method \f(CW\*(C`IO::Handle::ungetc()\*(C'\fR instead.
1582.IP "unlink" 8
1583.IX Item "unlink"
1584This is identical to Perl's builtin \f(CW\*(C`unlink()\*(C'\fR function
1585for removing files, see \*(L"unlink\*(R" in perlfunc.
1586.IP "utime" 8
1587.IX Item "utime"
1588This is identical to Perl's builtin \f(CW\*(C`utime()\*(C'\fR function
1589for changing the time stamps of files and directories,
1590see \*(L"utime\*(R" in perlfunc.
1591.IP "vfprintf" 8
1592.IX Item "vfprintf"
1593\&\fIvfprintf()\fR is C\-specific, see \*(L"printf\*(R" in perlfunc instead.
1594.IP "vprintf" 8
1595.IX Item "vprintf"
1596\&\fIvprintf()\fR is C\-specific, see \*(L"printf\*(R" in perlfunc instead.
1597.IP "vsprintf" 8
1598.IX Item "vsprintf"
1599\&\fIvsprintf()\fR is C\-specific, see \*(L"sprintf\*(R" in perlfunc instead.
1600.IP "wait" 8
1601.IX Item "wait"
1602This is identical to Perl's builtin \f(CW\*(C`wait()\*(C'\fR function,
1603see \*(L"wait\*(R" in perlfunc.
1604.IP "waitpid" 8
1605.IX Item "waitpid"
1606Wait for a child process to change state. This is identical to Perl's
1607builtin \f(CW\*(C`waitpid()\*(C'\fR function, see \*(L"waitpid\*(R" in perlfunc.
1608.Sp
1609.Vb 2
1610\& $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
1611\& print "status = ", ($? / 256), "\en";
1612.Ve
1613.IP "wcstombs" 8
1614.IX Item "wcstombs"
1615This is identical to the C function \f(CW\*(C`wcstombs()\*(C'\fR.
1616Perl does not have any support for the wide and multibyte
1617characters of the C standards, so this might be a rather
1618useless function.
1619.IP "wctomb" 8
1620.IX Item "wctomb"
1621This is identical to the C function \f(CW\*(C`wctomb()\*(C'\fR.
1622Perl does not have any support for the wide and multibyte
1623characters of the C standards, so this might be a rather
1624useless function.
1625.IP "write" 8
1626.IX Item "write"
1627Write to a file. This uses file descriptors such as those obtained by
1628calling \f(CW\*(C`POSIX::open\*(C'\fR.
1629.Sp
1630.Vb 3
1631\& $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
1632\& $buf = "hello";
1633\& $bytes = POSIX::write( $b, $buf, 5 );
1634.Ve
1635.Sp
1636Returns \f(CW\*(C`undef\*(C'\fR on failure.
1637.Sp
1638See also \*(L"syswrite\*(R" in perlfunc.
1639.SH "CLASSES"
1640.IX Header "CLASSES"
1641.Sh "POSIX::SigAction"
1642.IX Subsection "POSIX::SigAction"
1643.IP "new" 8
1644.IX Item "new"
1645Creates a new \f(CW\*(C`POSIX::SigAction\*(C'\fR object which corresponds to the C
1646\&\f(CW\*(C`struct sigaction\*(C'\fR. This object will be destroyed automatically when it is
1647no longer needed. The first parameter is the fully-qualified name of a sub
1648which is a signal\-handler. The second parameter is a \f(CW\*(C`POSIX::SigSet\*(C'\fR
1649object, it defaults to the empty set. The third parameter contains the
1650\&\f(CW\*(C`sa_flags\*(C'\fR, it defaults to 0.
1651.Sp
1652.Vb 2
1653\& $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
1654\& $sigaction = POSIX::SigAction->new( \e&main::handler, $sigset, &POSIX::SA_NOCLDSTOP );
1655.Ve
1656.Sp
1657This \f(CW\*(C`POSIX::SigAction\*(C'\fR object is intended for use with the \f(CW\*(C`POSIX::sigaction()\*(C'\fR
1658function.
1659.IP "handler" 8
1660.IX Item "handler"
1661.PD 0
1662.IP "mask" 8
1663.IX Item "mask"
1664.IP "flags" 8
1665.IX Item "flags"
1666.PD
1667accessor functions to get/set the values of a SigAction object.
1668.Sp
1669.Vb 2
1670\& $sigset = $sigaction->mask;
1671\& $sigaction->flags(&POSIX::SA_RESTART);
1672.Ve
1673.IP "safe" 8
1674.IX Item "safe"
1675accessor function for the \*(L"safe signals\*(R" flag of a SigAction object; see
1676perlipc for general information on safe (a.k.a. \*(L"deferred\*(R") signals. If
1677you wish to handle a signal safely, use this accessor to set the \*(L"safe\*(R" flag
1678in the \f(CW\*(C`POSIX::SigAction\*(C'\fR object:
1679.Sp
1680.Vb 1
1681\& $sigaction->safe(1);
1682.Ve
1683.Sp
1684You may also examine the \*(L"safe\*(R" flag on the output action object which is
1685filled in when given as the third parameter to \f(CW\*(C`POSIX::sigaction()\*(C'\fR:
1686.Sp
1687.Vb 4
1688\& sigaction(SIGINT, $new_action, $old_action);
1689\& if ($old_action->safe) {
1690\& # previous SIGINT handler used safe signals
1691\& }
1692.Ve
1693.Sh "POSIX::SigSet"
1694.IX Subsection "POSIX::SigSet"
1695.IP "new" 8
1696.IX Item "new"
1697Create a new SigSet object. This object will be destroyed automatically
1698when it is no longer needed. Arguments may be supplied to initialize the
1699set.
1700.Sp
1701Create an empty set.
1702.Sp
1703.Vb 1
1704\& $sigset = POSIX::SigSet->new;
1705.Ve
1706.Sp
1707Create a set with \s-1SIGUSR1\s0.
1708.Sp
1709.Vb 1
1710\& $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
1711.Ve
1712.IP "addset" 8
1713.IX Item "addset"
1714Add a signal to a SigSet object.
1715.Sp
1716.Vb 1
1717\& $sigset->addset( &POSIX::SIGUSR2 );
1718.Ve
1719.Sp
1720Returns \f(CW\*(C`undef\*(C'\fR on failure.
1721.IP "delset" 8
1722.IX Item "delset"
1723Remove a signal from the SigSet object.
1724.Sp
1725.Vb 1
1726\& $sigset->delset( &POSIX::SIGUSR2 );
1727.Ve
1728.Sp
1729Returns \f(CW\*(C`undef\*(C'\fR on failure.
1730.IP "emptyset" 8
1731.IX Item "emptyset"
1732Initialize the SigSet object to be empty.
1733.Sp
1734.Vb 1
1735\& $sigset->emptyset();
1736.Ve
1737.Sp
1738Returns \f(CW\*(C`undef\*(C'\fR on failure.
1739.IP "fillset" 8
1740.IX Item "fillset"
1741Initialize the SigSet object to include all signals.
1742.Sp
1743.Vb 1
1744\& $sigset->fillset();
1745.Ve
1746.Sp
1747Returns \f(CW\*(C`undef\*(C'\fR on failure.
1748.IP "ismember" 8
1749.IX Item "ismember"
1750Tests the SigSet object to see if it contains a specific signal.
1751.Sp
1752.Vb 3
1753\& if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
1754\& print "contains SIGUSR1\en";
1755\& }
1756.Ve
1757.Sh "POSIX::Termios"
1758.IX Subsection "POSIX::Termios"
1759.IP "new" 8
1760.IX Item "new"
1761Create a new Termios object. This object will be destroyed automatically
1762when it is no longer needed. A Termios object corresponds to the termios
1763C struct. \fInew()\fR mallocs a new one, \fIgetattr()\fR fills it from a file descriptor,
1764and \fIsetattr()\fR sets a file descriptor's parameters to match Termios' contents.
1765.Sp
1766.Vb 1
1767\& $termios = POSIX::Termios->new;
1768.Ve
1769.IP "getattr" 8
1770.IX Item "getattr"
1771Get terminal control attributes.
1772.Sp
1773Obtain the attributes for stdin.
1774.Sp
1775.Vb 1
1776\& $termios->getattr()
1777.Ve
1778.Sp
1779Obtain the attributes for stdout.
1780.Sp
1781.Vb 1
1782\& $termios->getattr( 1 )
1783.Ve
1784.Sp
1785Returns \f(CW\*(C`undef\*(C'\fR on failure.
1786.IP "getcc" 8
1787.IX Item "getcc"
1788Retrieve a value from the c_cc field of a termios object. The c_cc field is
1789an array so an index must be specified.
1790.Sp
1791.Vb 1
1792\& $c_cc[1] = $termios->getcc(1);
1793.Ve
1794.IP "getcflag" 8
1795.IX Item "getcflag"
1796Retrieve the c_cflag field of a termios object.
1797.Sp
1798.Vb 1
1799\& $c_cflag = $termios->getcflag;
1800.Ve
1801.IP "getiflag" 8
1802.IX Item "getiflag"
1803Retrieve the c_iflag field of a termios object.
1804.Sp
1805.Vb 1
1806\& $c_iflag = $termios->getiflag;
1807.Ve
1808.IP "getispeed" 8
1809.IX Item "getispeed"
1810Retrieve the input baud rate.
1811.Sp
1812.Vb 1
1813\& $ispeed = $termios->getispeed;
1814.Ve
1815.IP "getlflag" 8
1816.IX Item "getlflag"
1817Retrieve the c_lflag field of a termios object.
1818.Sp
1819.Vb 1
1820\& $c_lflag = $termios->getlflag;
1821.Ve
1822.IP "getoflag" 8
1823.IX Item "getoflag"
1824Retrieve the c_oflag field of a termios object.
1825.Sp
1826.Vb 1
1827\& $c_oflag = $termios->getoflag;
1828.Ve
1829.IP "getospeed" 8
1830.IX Item "getospeed"
1831Retrieve the output baud rate.
1832.Sp
1833.Vb 1
1834\& $ospeed = $termios->getospeed;
1835.Ve
1836.IP "setattr" 8
1837.IX Item "setattr"
1838Set terminal control attributes.
1839.Sp
1840Set attributes immediately for stdout.
1841.Sp
1842.Vb 1
1843\& $termios->setattr( 1, &POSIX::TCSANOW );
1844.Ve
1845.Sp
1846Returns \f(CW\*(C`undef\*(C'\fR on failure.
1847.IP "setcc" 8
1848.IX Item "setcc"
1849Set a value in the c_cc field of a termios object. The c_cc field is an
1850array so an index must be specified.
1851.Sp
1852.Vb 1
1853\& $termios->setcc( &POSIX::VEOF, 1 );
1854.Ve
1855.IP "setcflag" 8
1856.IX Item "setcflag"
1857Set the c_cflag field of a termios object.
1858.Sp
1859.Vb 1
1860\& $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
1861.Ve
1862.IP "setiflag" 8
1863.IX Item "setiflag"
1864Set the c_iflag field of a termios object.
1865.Sp
1866.Vb 1
1867\& $termios->setiflag( $c_iflag | &POSIX::BRKINT );
1868.Ve
1869.IP "setispeed" 8
1870.IX Item "setispeed"
1871Set the input baud rate.
1872.Sp
1873.Vb 1
1874\& $termios->setispeed( &POSIX::B9600 );
1875.Ve
1876.Sp
1877Returns \f(CW\*(C`undef\*(C'\fR on failure.
1878.IP "setlflag" 8
1879.IX Item "setlflag"
1880Set the c_lflag field of a termios object.
1881.Sp
1882.Vb 1
1883\& $termios->setlflag( $c_lflag | &POSIX::ECHO );
1884.Ve
1885.IP "setoflag" 8
1886.IX Item "setoflag"
1887Set the c_oflag field of a termios object.
1888.Sp
1889.Vb 1
1890\& $termios->setoflag( $c_oflag | &POSIX::OPOST );
1891.Ve
1892.IP "setospeed" 8
1893.IX Item "setospeed"
1894Set the output baud rate.
1895.Sp
1896.Vb 1
1897\& $termios->setospeed( &POSIX::B9600 );
1898.Ve
1899.Sp
1900Returns \f(CW\*(C`undef\*(C'\fR on failure.
1901.IP "Baud rate values" 8
1902.IX Item "Baud rate values"
1903B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110
1904.IP "Terminal interface values" 8
1905.IX Item "Terminal interface values"
1906\&\s-1TCSADRAIN\s0 \s-1TCSANOW\s0 \s-1TCOON\s0 \s-1TCIOFLUSH\s0 \s-1TCOFLUSH\s0 \s-1TCION\s0 \s-1TCIFLUSH\s0 \s-1TCSAFLUSH\s0 \s-1TCIOFF\s0 \s-1TCOOFF\s0
1907.IP "c_cc field values" 8
1908.IX Item "c_cc field values"
1909\&\s-1VEOF\s0 \s-1VEOL\s0 \s-1VERASE\s0 \s-1VINTR\s0 \s-1VKILL\s0 \s-1VQUIT\s0 \s-1VSUSP\s0 \s-1VSTART\s0 \s-1VSTOP\s0 \s-1VMIN\s0 \s-1VTIME\s0 \s-1NCCS\s0
1910.IP "c_cflag field values" 8
1911.IX Item "c_cflag field values"
1912\&\s-1CLOCAL\s0 \s-1CREAD\s0 \s-1CSIZE\s0 \s-1CS5\s0 \s-1CS6\s0 \s-1CS7\s0 \s-1CS8\s0 \s-1CSTOPB\s0 \s-1HUPCL\s0 \s-1PARENB\s0 \s-1PARODD\s0
1913.IP "c_iflag field values" 8
1914.IX Item "c_iflag field values"
1915\&\s-1BRKINT\s0 \s-1ICRNL\s0 \s-1IGNBRK\s0 \s-1IGNCR\s0 \s-1IGNPAR\s0 \s-1INLCR\s0 \s-1INPCK\s0 \s-1ISTRIP\s0 \s-1IXOFF\s0 \s-1IXON\s0 \s-1PARMRK\s0
1916.IP "c_lflag field values" 8
1917.IX Item "c_lflag field values"
1918\&\s-1ECHO\s0 \s-1ECHOE\s0 \s-1ECHOK\s0 \s-1ECHONL\s0 \s-1ICANON\s0 \s-1IEXTEN\s0 \s-1ISIG\s0 \s-1NOFLSH\s0 \s-1TOSTOP\s0
1919.IP "c_oflag field values" 8
1920.IX Item "c_oflag field values"
1921\&\s-1OPOST\s0
1922.SH "PATHNAME CONSTANTS"
1923.IX Header "PATHNAME CONSTANTS"
1924.IP "Constants" 8
1925.IX Item "Constants"
1926_PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
1927.SH "POSIX CONSTANTS"
1928.IX Header "POSIX CONSTANTS"
1929.IP "Constants" 8
1930.IX Item "Constants"
1931_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION
1932.SH "SYSTEM CONFIGURATION"
1933.IX Header "SYSTEM CONFIGURATION"
1934.IP "Constants" 8
1935.IX Item "Constants"
1936_SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
1937.SH "ERRNO"
1938.IX Header "ERRNO"
1939.IP "Constants" 8
1940.IX Item "Constants"
1941E2BIG \s-1EACCES\s0 \s-1EADDRINUSE\s0 \s-1EADDRNOTAVAIL\s0 \s-1EAFNOSUPPORT\s0 \s-1EAGAIN\s0 \s-1EALREADY\s0 \s-1EBADF\s0
1942\&\s-1EBUSY\s0 \s-1ECHILD\s0 \s-1ECONNABORTED\s0 \s-1ECONNREFUSED\s0 \s-1ECONNRESET\s0 \s-1EDEADLK\s0 \s-1EDESTADDRREQ\s0
1943\&\s-1EDOM\s0 \s-1EDQUOT\s0 \s-1EEXIST\s0 \s-1EFAULT\s0 \s-1EFBIG\s0 \s-1EHOSTDOWN\s0 \s-1EHOSTUNREACH\s0 \s-1EINPROGRESS\s0 \s-1EINTR\s0
1944\&\s-1EINVAL\s0 \s-1EIO\s0 \s-1EISCONN\s0 \s-1EISDIR\s0 \s-1ELOOP\s0 \s-1EMFILE\s0 \s-1EMLINK\s0 \s-1EMSGSIZE\s0 \s-1ENAMETOOLONG\s0
1945\&\s-1ENETDOWN\s0 \s-1ENETRESET\s0 \s-1ENETUNREACH\s0 \s-1ENFILE\s0 \s-1ENOBUFS\s0 \s-1ENODEV\s0 \s-1ENOENT\s0 \s-1ENOEXEC\s0
1946\&\s-1ENOLCK\s0 \s-1ENOMEM\s0 \s-1ENOPROTOOPT\s0 \s-1ENOSPC\s0 \s-1ENOSYS\s0 \s-1ENOTBLK\s0 \s-1ENOTCONN\s0 \s-1ENOTDIR\s0
1947\&\s-1ENOTEMPTY\s0 \s-1ENOTSOCK\s0 \s-1ENOTTY\s0 \s-1ENXIO\s0 \s-1EOPNOTSUPP\s0 \s-1EPERM\s0 \s-1EPFNOSUPPORT\s0 \s-1EPIPE\s0
1948\&\s-1EPROCLIM\s0 \s-1EPROTONOSUPPORT\s0 \s-1EPROTOTYPE\s0 \s-1ERANGE\s0 \s-1EREMOTE\s0 \s-1ERESTART\s0 \s-1EROFS\s0
1949\&\s-1ESHUTDOWN\s0 \s-1ESOCKTNOSUPPORT\s0 \s-1ESPIPE\s0 \s-1ESRCH\s0 \s-1ESTALE\s0 \s-1ETIMEDOUT\s0 \s-1ETOOMANYREFS\s0
1950\&\s-1ETXTBSY\s0 \s-1EUSERS\s0 \s-1EWOULDBLOCK\s0 \s-1EXDEV\s0
1951.SH "FCNTL"
1952.IX Header "FCNTL"
1953.IP "Constants" 8
1954.IX Item "Constants"
1955\&\s-1FD_CLOEXEC\s0 F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY
1956.SH "FLOAT"
1957.IX Header "FLOAT"
1958.IP "Constants" 8
1959.IX Item "Constants"
1960\&\s-1DBL_DIG\s0 \s-1DBL_EPSILON\s0 \s-1DBL_MANT_DIG\s0 \s-1DBL_MAX\s0 \s-1DBL_MAX_10_EXP\s0 \s-1DBL_MAX_EXP\s0 \s-1DBL_MIN\s0 \s-1DBL_MIN_10_EXP\s0 \s-1DBL_MIN_EXP\s0 \s-1FLT_DIG\s0 \s-1FLT_EPSILON\s0 \s-1FLT_MANT_DIG\s0 \s-1FLT_MAX\s0 \s-1FLT_MAX_10_EXP\s0 \s-1FLT_MAX_EXP\s0 \s-1FLT_MIN\s0 \s-1FLT_MIN_10_EXP\s0 \s-1FLT_MIN_EXP\s0 \s-1FLT_RADIX\s0 \s-1FLT_ROUNDS\s0 \s-1LDBL_DIG\s0 \s-1LDBL_EPSILON\s0 \s-1LDBL_MANT_DIG\s0 \s-1LDBL_MAX\s0 \s-1LDBL_MAX_10_EXP\s0 \s-1LDBL_MAX_EXP\s0 \s-1LDBL_MIN\s0 \s-1LDBL_MIN_10_EXP\s0 \s-1LDBL_MIN_EXP\s0
1961.SH "LIMITS"
1962.IX Header "LIMITS"
1963.IP "Constants" 8
1964.IX Item "Constants"
1965\&\s-1ARG_MAX\s0 \s-1CHAR_BIT\s0 \s-1CHAR_MAX\s0 \s-1CHAR_MIN\s0 \s-1CHILD_MAX\s0 \s-1INT_MAX\s0 \s-1INT_MIN\s0 \s-1LINK_MAX\s0 \s-1LONG_MAX\s0 \s-1LONG_MIN\s0 \s-1MAX_CANON\s0 \s-1MAX_INPUT\s0 \s-1MB_LEN_MAX\s0 \s-1NAME_MAX\s0 \s-1NGROUPS_MAX\s0 \s-1OPEN_MAX\s0 \s-1PATH_MAX\s0 \s-1PIPE_BUF\s0 \s-1SCHAR_MAX\s0 \s-1SCHAR_MIN\s0 \s-1SHRT_MAX\s0 \s-1SHRT_MIN\s0 \s-1SSIZE_MAX\s0 \s-1STREAM_MAX\s0 \s-1TZNAME_MAX\s0 \s-1UCHAR_MAX\s0 \s-1UINT_MAX\s0 \s-1ULONG_MAX\s0 \s-1USHRT_MAX\s0
1966.SH "LOCALE"
1967.IX Header "LOCALE"
1968.IP "Constants" 8
1969.IX Item "Constants"
1970\&\s-1LC_ALL\s0 \s-1LC_COLLATE\s0 \s-1LC_CTYPE\s0 \s-1LC_MONETARY\s0 \s-1LC_NUMERIC\s0 \s-1LC_TIME\s0
1971.SH "MATH"
1972.IX Header "MATH"
1973.IP "Constants" 8
1974.IX Item "Constants"
1975\&\s-1HUGE_VAL\s0
1976.SH "SIGNAL"
1977.IX Header "SIGNAL"
1978.IP "Constants" 8
1979.IX Item "Constants"
1980\&\s-1SA_NOCLDSTOP\s0 \s-1SA_NOCLDWAIT\s0 \s-1SA_NODEFER\s0 \s-1SA_ONSTACK\s0 \s-1SA_RESETHAND\s0 \s-1SA_RESTART\s0
1981\&\s-1SA_SIGINFO\s0 \s-1SIGABRT\s0 \s-1SIGALRM\s0 \s-1SIGCHLD\s0 \s-1SIGCONT\s0 \s-1SIGFPE\s0 \s-1SIGHUP\s0 \s-1SIGILL\s0 \s-1SIGINT\s0
1982\&\s-1SIGKILL\s0 \s-1SIGPIPE\s0 \s-1SIGQUIT\s0 \s-1SIGSEGV\s0 \s-1SIGSTOP\s0 \s-1SIGTERM\s0 \s-1SIGTSTP\s0 \s-1SIGTTIN\s0 \s-1SIGTTOU\s0
1983\&\s-1SIGUSR1\s0 \s-1SIGUSR2\s0 \s-1SIG_BLOCK\s0 \s-1SIG_DFL\s0 \s-1SIG_ERR\s0 \s-1SIG_IGN\s0 \s-1SIG_SETMASK\s0
1984\&\s-1SIG_UNBLOCK\s0
1985.SH "STAT"
1986.IX Header "STAT"
1987.IP "Constants" 8
1988.IX Item "Constants"
1989S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
1990.IP "Macros" 8
1991.IX Item "Macros"
1992S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
1993.SH "STDLIB"
1994.IX Header "STDLIB"
1995.IP "Constants" 8
1996.IX Item "Constants"
1997\&\s-1EXIT_FAILURE\s0 \s-1EXIT_SUCCESS\s0 \s-1MB_CUR_MAX\s0 \s-1RAND_MAX\s0
1998.SH "STDIO"
1999.IX Header "STDIO"
2000.IP "Constants" 8
2001.IX Item "Constants"
2002\&\s-1BUFSIZ\s0 \s-1EOF\s0 \s-1FILENAME_MAX\s0 L_ctermid L_cuserid L_tmpname \s-1TMP_MAX\s0
2003.SH "TIME"
2004.IX Header "TIME"
2005.IP "Constants" 8
2006.IX Item "Constants"
2007\&\s-1CLK_TCK\s0 \s-1CLOCKS_PER_SEC\s0
2008.SH "UNISTD"
2009.IX Header "UNISTD"
2010.IP "Constants" 8
2011.IX Item "Constants"
2012R_OK \s-1SEEK_CUR\s0 \s-1SEEK_END\s0 \s-1SEEK_SET\s0 \s-1STDIN_FILENO\s0 \s-1STDOUT_FILENO\s0 \s-1STDERR_FILENO\s0 W_OK X_OK
2013.SH "WAIT"
2014.IX Header "WAIT"
2015.IP "Constants" 8
2016.IX Item "Constants"
2017\&\s-1WNOHANG\s0 \s-1WUNTRACED\s0
2018.RS 8
2019.IP "\s-1WNOHANG\s0" 16
2020.IX Item "WNOHANG"
2021Do not suspend the calling process until a child process
2022changes state but instead return immediately.
2023.IP "\s-1WUNTRACED\s0" 16
2024.IX Item "WUNTRACED"
2025Catch stopped child processes.
2026.RE
2027.RS 8
2028.RE
2029.IP "Macros" 8
2030.IX Item "Macros"
2031\&\s-1WIFEXITED\s0 \s-1WEXITSTATUS\s0 \s-1WIFSIGNALED\s0 \s-1WTERMSIG\s0 \s-1WIFSTOPPED\s0 \s-1WSTOPSIG\s0
2032.RS 8
2033.IP "\s-1WIFEXITED\s0" 16
2034.IX Item "WIFEXITED"
2035\&\s-1WIFEXITED\s0($?) returns true if the child process exited normally
2036(\f(CW\*(C`exit()\*(C'\fR or by falling off the end of \f(CW\*(C`main()\*(C'\fR)
2037.IP "\s-1WEXITSTATUS\s0" 16
2038.IX Item "WEXITSTATUS"
2039\&\s-1WEXITSTATUS\s0($?) returns the normal exit status of the child process
2040(only meaningful if \s-1WIFEXITED\s0($?) is true)
2041.IP "\s-1WIFSIGNALED\s0" 16
2042.IX Item "WIFSIGNALED"
2043\&\s-1WIFSIGNALED\s0($?) returns true if the child process terminated because
2044of a signal
2045.IP "\s-1WTERMSIG\s0" 16
2046.IX Item "WTERMSIG"
2047\&\s-1WTERMSIG\s0($?) returns the signal the child process terminated for
2048(only meaningful if \s-1WIFSIGNALED\s0($?) is true)
2049.IP "\s-1WIFSTOPPED\s0" 16
2050.IX Item "WIFSTOPPED"
2051\&\s-1WIFSTOPPED\s0($?) returns true if the child process is currently stopped
2052(can happen only if you specified the \s-1WUNTRACED\s0 flag to \fIwaitpid()\fR)
2053.IP "\s-1WSTOPSIG\s0" 16
2054.IX Item "WSTOPSIG"
2055\&\s-1WSTOPSIG\s0($?) returns the signal the child process was stopped for
2056(only meaningful if \s-1WIFSTOPPED\s0($?) is true)
2057.RE
2058.RS 8
2059.RE