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