3 POSIX - Perl interface to IEEE Std 1003.1
9 use POSIX qw(:errno_h :fcntl_h);
11 printf "EINTR is %d\n", EINTR;
13 $sess_id = POSIX::setsid();
15 $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
16 # note: that's a filedescriptor, *NOT* a filehandle
20 The POSIX module permits you to access all (or nearly all) the standard
21 POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish
22 interfaces. Things which are C<#defines> in C, like EINTR or O_NDELAY, are
23 automatically exported into your namespace. All functions are only exported
24 if you ask for them explicitly. Most likely people will prefer to use the
25 fully-qualified function names.
27 This document gives a condensed list of the features available in the POSIX
28 module. Consult your operating system's manpages for general information on
29 most features. Consult L<perlfunc> for functions which are noted as being
30 identical to Perl's builtin functions.
32 The first section describes POSIX functions from the 1003.1 specification.
33 The second section describes some classes for signal objects, TTY objects,
34 and other miscellaneous objects. The remaining sections list various
35 constants and macros in an organization which roughly follows IEEE Std
40 The POSIX module is probably the most complex Perl module supplied with
41 the standard distribution. It incorporates autoloading, namespace games,
42 and dynamic loading of code that's in Perl, C, or both. It's a great
47 A few functions are not implemented because they are C specific. If you
48 attempt to call these, they will print a message telling you that they
49 aren't implemented, and suggest using the Perl equivalent should one
50 exist. For example, trying to access the setjmp() call will elicit the
51 message "setjmp() is C-specific: use eval {} instead".
53 Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
54 are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
55 For example, one vendor may not define EDEADLK, or the semantics of the
56 errno values set by open(2) might not be quite right. Perl does not
57 attempt to verify POSIX compliance. That means you can currently
58 successfully say "use POSIX", and then later in your program you find
59 that your vendor has been lax and there's no usable ICANON macro after
60 all. This could be construed to be a bug.
68 This is identical to the C function C<_exit()>.
72 This is identical to the C function C<abort()>.
76 This is identical to Perl's builtin C<abs()> function.
80 Determines the accessibility of a file.
82 if( POSIX::access( "/", &POSIX::R_OK ) ){
83 print "have read permission\n";
86 Returns C<undef> on failure.
90 This is identical to the C function C<acos()>.
94 This is identical to Perl's builtin C<alarm()> function.
98 This is identical to the C function C<asctime()>.
102 This is identical to the C function C<asin()>.
110 This is identical to the C function C<atan()>.
114 This is identical to Perl's builtin C<atan2()> function.
118 atexit() is C-specific: use END {} instead.
122 atof() is C-specific.
126 atoi() is C-specific.
130 atol() is C-specific.
134 bsearch() not supplied.
138 calloc() is C-specific.
142 This is identical to the C function C<ceil()>.
146 This is identical to Perl's builtin C<chdir()> function.
150 This is identical to Perl's builtin C<chmod()> function.
154 This is identical to Perl's builtin C<chown()> function.
158 Use method C<FileHandle::clearerr()> instead.
162 This is identical to the C function C<clock()>.
166 Close the file. This uses file descriptors such as those obtained by calling
169 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
172 Returns C<undef> on failure.
176 This is identical to Perl's builtin C<closedir()> function.
180 This is identical to Perl's builtin C<cos()> function.
184 This is identical to the C function C<cosh()>.
188 Create a new file. This returns a file descriptor like the ones returned by
189 C<POSIX::open>. Use C<POSIX::close> to close the file.
191 $fd = POSIX::creat( "foo", 0611 );
196 Generates the path name for the controlling terminal.
198 $path = POSIX::ctermid();
202 This is identical to the C function C<ctime()>.
206 Get the character login name of the user.
208 $name = POSIX::cuserid();
212 This is identical to the C function C<difftime()>.
220 This is similar to the C function C<dup()>.
222 This uses file descriptors such as those obtained by calling
225 Returns C<undef> on failure.
229 This is similar to the C function C<dup2()>.
231 This uses file descriptors such as those obtained by calling
234 Returns C<undef> on failure.
238 Returns the value of errno.
240 $errno = POSIX::errno();
244 execl() is C-specific.
248 execle() is C-specific.
252 execlp() is C-specific.
256 execv() is C-specific.
260 execve() is C-specific.
264 execvp() is C-specific.
268 This is identical to Perl's builtin C<exit()> function.
272 This is identical to Perl's builtin C<exp()> function.
276 This is identical to Perl's builtin C<abs()> function.
280 Use method C<FileHandle::close()> instead.
284 This is identical to Perl's builtin C<fcntl()> function.
288 Use method C<FileHandle::new_from_fd()> instead.
292 Use method C<FileHandle::eof()> instead.
296 Use method C<FileHandle::error()> instead.
300 Use method C<FileHandle::flush()> instead.
304 Use method C<FileHandle::getc()> instead.
308 Use method C<FileHandle::getpos()> instead.
312 Use method C<FileHandle::gets()> instead.
316 Use method C<FileHandle::fileno()> instead.
320 This is identical to the C function C<floor()>.
324 This is identical to the C function C<fmod()>.
328 Use method C<FileHandle::open()> instead.
332 This is identical to Perl's builtin C<fork()> function.
336 Retrieves the value of a configurable limit on a file or directory. This
337 uses file descriptors such as those obtained by calling C<POSIX::open>.
339 The following will determine the maximum length of the longest allowable
340 pathname on the filesystem which holds C</tmp/foo>.
342 $fd = POSIX::open( "/tmp/foo", &POSIX::O_RDONLY );
343 $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
345 Returns C<undef> on failure.
349 fprintf() is C-specific--use printf instead.
353 fputc() is C-specific--use print instead.
357 fputs() is C-specific--use print instead.
361 fread() is C-specific--use read instead.
365 free() is C-specific.
369 freopen() is C-specific--use open instead.
373 Return the mantissa and exponent of a floating-point number.
375 ($mantissa, $exponent) = POSIX::frexp( 3.14 );
379 fscanf() is C-specific--use <> and regular expressions instead.
383 Use method C<FileHandle::seek()> instead.
387 Use method C<FileHandle::setpos()> instead.
391 Get file status. This uses file descriptors such as those obtained by
392 calling C<POSIX::open>. The data returned is identical to the data from
393 Perl's builtin C<stat> function.
395 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
396 @stats = POSIX::fstat( $fd );
400 Use method C<FileHandle::tell()> instead.
404 fwrite() is C-specific--use print instead.
408 This is identical to Perl's builtin C<getc()> function.
412 Returns one character from STDIN.
416 Returns the name of the current working directory.
420 Returns the effective group id.
424 Returns the value of the specified enironment variable.
428 Returns the effective user id.
432 Returns the user's real group id.
436 This is identical to Perl's builtin C<getgrgid()> function.
440 This is identical to Perl's builtin C<getgrnam()> function.
444 Returns the ids of the user's supplementary groups.
448 This is identical to Perl's builtin C<getlogin()> function.
452 This is identical to Perl's builtin C<getpgrp()> function.
456 Returns the process's id.
460 This is identical to Perl's builtin C<getppid()> function.
464 This is identical to Perl's builtin C<getpwnam()> function.
468 This is identical to Perl's builtin C<getpwuid()> function.
472 Returns one line from STDIN.
476 Returns the user's id.
480 This is identical to Perl's builtin C<gmtime()> function.
484 This is identical to the C function, except that it can apply to a single
485 character or to a whole string.
489 This is identical to the C function, except that it can apply to a single
490 character or to a whole string.
494 Returns a boolean indicating whether the specified filehandle is connected
499 This is identical to the C function, except that it can apply to a single
500 character or to a whole string.
504 This is identical to the C function, except that it can apply to a single
505 character or to a whole string.
509 This is identical to the C function, except that it can apply to a single
510 character or to a whole string.
514 This is identical to the C function, except that it can apply to a single
515 character or to a whole string.
519 This is identical to the C function, except that it can apply to a single
520 character or to a whole string.
524 This is identical to the C function, except that it can apply to a single
525 character or to a whole string.
529 This is identical to the C function, except that it can apply to a single
530 character or to a whole string.
534 This is identical to the C function, except that it can apply to a single
535 character or to a whole string.
539 This is identical to the C function, except that it can apply to a single
540 character or to a whole string.
544 This is identical to Perl's builtin C<kill()> function.
548 labs() is C-specific, use abs instead.
552 This is identical to the C function C<ldexp()>.
556 ldiv() is C-specific, use / and int instead.
560 This is identical to Perl's builtin C<link()> function.
564 Get numeric formatting information. Returns a reference to a hash
565 containing the current locale formatting values.
567 The database for the B<de> (Deutsch or German) locale.
569 $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
570 print "Locale = $loc\n";
571 $lconv = POSIX::localeconv();
572 print "decimal_point = ", $lconv->{decimal_point}, "\n";
573 print "thousands_sep = ", $lconv->{thousands_sep}, "\n";
574 print "grouping = ", $lconv->{grouping}, "\n";
575 print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\n";
576 print "currency_symbol = ", $lconv->{currency_symbol}, "\n";
577 print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\n";
578 print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\n";
579 print "mon_grouping = ", $lconv->{mon_grouping}, "\n";
580 print "positive_sign = ", $lconv->{positive_sign}, "\n";
581 print "negative_sign = ", $lconv->{negative_sign}, "\n";
582 print "int_frac_digits = ", $lconv->{int_frac_digits}, "\n";
583 print "frac_digits = ", $lconv->{frac_digits}, "\n";
584 print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\n";
585 print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\n";
586 print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\n";
587 print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\n";
588 print "p_sign_posn = ", $lconv->{p_sign_posn}, "\n";
589 print "n_sign_posn = ", $lconv->{n_sign_posn}, "\n";
593 This is identical to Perl's builtin C<localtime()> function.
597 This is identical to Perl's builtin C<log()> function.
601 This is identical to the C function C<log10()>.
605 longjmp() is C-specific: use die instead.
609 Move the read/write file pointer. This uses file descriptors such as
610 those obtained by calling C<POSIX::open>.
612 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
613 $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
615 Returns C<undef> on failure.
619 malloc() is C-specific.
623 This is identical to the C function C<mblen()>.
627 This is identical to the C function C<mbstowcs()>.
631 This is identical to the C function C<mbtowc()>.
635 memchr() is C-specific, use index() instead.
639 memcmp() is C-specific, use eq instead.
643 memcpy() is C-specific, use = instead.
647 memmove() is C-specific, use = instead.
651 memset() is C-specific, use x instead.
655 This is identical to Perl's builtin C<mkdir()> function.
659 This is similar to the C function C<mkfifo()>.
661 Returns C<undef> on failure.
665 Convert date/time info to a calendar time.
669 mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
671 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
672 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
673 year (C<year>) is given in years since 1900. I.e. The year 1995 is 95; the
674 year 2001 is 101. Consult your system's C<mktime()> manpage for details
675 about these and the other arguments.
677 Calendar time for December 12, 1995, at 10:30 am.
679 $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
680 print "Date = ", POSIX::ctime($time_t);
682 Returns C<undef> on failure.
686 Return the integral and fractional parts of a floating-point number.
688 ($fractional, $integral) = POSIX::modf( 3.14 );
692 This is similar to the C function C<nice()>.
694 Returns C<undef> on failure.
698 offsetof() is C-specific.
702 Open a file for reading for writing. This returns file descriptors, not
703 Perl filehandles. Use C<POSIX::close> to close the file.
705 Open a file read-only with mode 0666.
707 $fd = POSIX::open( "foo" );
709 Open a file for read and write.
711 $fd = POSIX::open( "foo", &POSIX::O_RDWR );
713 Open a file for write, with truncation.
715 $fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );
717 Create a new file with mode 0640. Set up the file for writing.
719 $fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );
721 Returns C<undef> on failure.
725 Open a directory for reading.
727 $dir = POSIX::opendir( "/tmp" );
728 @files = POSIX::readdir( $dir );
729 POSIX::closedir( $dir );
731 Returns C<undef> on failure.
735 Retrieves the value of a configurable limit on a file or directory.
737 The following will determine the maximum length of the longest allowable
738 pathname on the filesystem which holds C</tmp>.
740 $path_max = POSIX::pathconf( "/tmp", &POSIX::_PC_PATH_MAX );
742 Returns C<undef> on failure.
746 This is similar to the C function C<pause()>.
748 Returns C<undef> on failure.
752 This is identical to the C function C<perror()>.
756 Create an interprocess channel. This returns file descriptors like those
757 returned by C<POSIX::open>.
759 ($fd0, $fd1) = POSIX::pipe();
760 POSIX::write( $fd0, "hello", 5 );
761 POSIX::read( $fd1, $buf, 5 );
765 Computes $x raised to the power $exponent.
767 $ret = POSIX::pow( $x, $exponent );
771 Prints the specified arguments to STDOUT.
775 putc() is C-specific--use print instead.
779 putchar() is C-specific--use print instead.
783 puts() is C-specific--use print instead.
787 qsort() is C-specific, use sort instead.
791 Sends the specified signal to the current process.
795 rand() is non-portable, use Perl's rand instead.
799 Read from a file. This uses file descriptors such as those obtained by
800 calling C<POSIX::open>. If the buffer C<$buf> is not large enough for the
801 read then Perl will extend it to make room for the request.
803 $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
804 $bytes = POSIX::read( $fd, $buf, 3 );
806 Returns C<undef> on failure.
810 This is identical to Perl's builtin C<readdir()> function.
814 realloc() is C-specific.
818 This is identical to Perl's builtin C<unlink()> function.
822 This is identical to Perl's builtin C<rename()> function.
826 Seeks to the beginning of the file.
830 This is identical to Perl's builtin C<rewinddir()> function.
834 This is identical to Perl's builtin C<rmdir()> function.
838 scanf() is C-specific--use <> and regular expressions instead.
842 Sets the real group id for this process.
846 setjmp() is C-specific: use eval {} instead.
850 Modifies and queries program's locale.
852 The following will set the traditional UNIX system locale behavior.
854 $loc = POSIX::setlocale( &POSIX::LC_ALL, "C" );
858 This is similar to the C function C<setpgid()>.
860 Returns C<undef> on failure.
864 This is identical to the C function C<setsid()>.
868 Sets the real user id for this process.
872 Detailed signal management. This uses C<POSIX::SigAction> objects for the
873 C<action> and C<oldaction> arguments. Consult your system's C<sigaction>
878 sigaction(sig, action, oldaction = 0)
880 Returns C<undef> on failure.
884 siglongjmp() is C-specific: use die instead.
888 Examine signals that are blocked and pending. This uses C<POSIX::SigSet>
889 objects for the C<sigset> argument. Consult your system's C<sigpending>
896 Returns C<undef> on failure.
900 Change and/or examine calling process's signal mask. This uses
901 C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
902 Consult your system's C<sigprocmask> manpage for details.
906 sigprocmask(how, sigset, oldsigset = 0)
908 Returns C<undef> on failure.
912 sigsetjmp() is C-specific: use eval {} instead.
916 Install a signal mask and suspend process until signal arrives. This uses
917 C<POSIX::SigSet> objects for the C<signal_mask> argument. Consult your
918 system's C<sigsuspend> manpage for details.
922 sigsuspend(signal_mask)
924 Returns C<undef> on failure.
928 This is identical to Perl's builtin C<sin()> function.
932 This is identical to the C function C<sinh()>.
936 This is identical to Perl's builtin C<sleep()> function.
940 This is identical to Perl's builtin C<sprintf()> function.
944 This is identical to Perl's builtin C<sqrt()> function.
952 sscanf() is C-specific--use regular expressions instead.
956 This is identical to Perl's builtin C<stat()> function.
960 strcat() is C-specific, use .= instead.
964 strchr() is C-specific, use index() instead.
968 strcmp() is C-specific, use eq instead.
972 This is identical to the C function C<strcoll()>.
976 strcpy() is C-specific, use = instead.
980 strcspn() is C-specific, use regular expressions instead.
984 Returns the error string for the specified errno.
988 Convert date and time information to string. Returns the string.
992 strftime(fmt, sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
994 The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
995 I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
996 year (C<year>) is given in years since 1900. I.e. The year 1995 is 95; the
997 year 2001 is 101. Consult your system's C<strftime()> manpage for details
998 about these and the other arguments.
1000 The string for Tuesday, December 12, 1995.
1002 $str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 );
1007 strlen() is C-specific, use length instead.
1011 strncat() is C-specific, use .= instead.
1015 strncmp() is C-specific, use eq instead.
1019 strncpy() is C-specific, use = instead.
1023 stroul() is C-specific.
1027 strpbrk() is C-specific.
1031 strrchr() is C-specific, use rindex() instead.
1035 strspn() is C-specific.
1039 This is identical to Perl's builtin C<index()> function.
1043 strtod() is C-specific.
1047 strtok() is C-specific.
1051 strtol() is C-specific.
1055 String transformation. Returns the transformed string.
1057 $dst = POSIX::strxfrm( $src );
1061 Retrieves values of system configurable variables.
1063 The following will get the machine's clock speed.
1065 $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
1067 Returns C<undef> on failure.
1071 This is identical to Perl's builtin C<system()> function.
1075 This is identical to the C function C<tan()>.
1079 This is identical to the C function C<tanh()>.
1083 This is similar to the C function C<tcdrain()>.
1085 Returns C<undef> on failure.
1089 This is similar to the C function C<tcflow()>.
1091 Returns C<undef> on failure.
1095 This is similar to the C function C<tcflush()>.
1097 Returns C<undef> on failure.
1101 This is identical to the C function C<tcgetpgrp()>.
1105 This is similar to the C function C<tcsendbreak()>.
1107 Returns C<undef> on failure.
1111 This is similar to the C function C<tcsetpgrp()>.
1113 Returns C<undef> on failure.
1117 This is identical to Perl's builtin C<time()> function.
1121 The times() function returns elapsed realtime since some point in the past
1122 (such as system startup), user and system times for this process, and user
1123 and system times used by child processes. All times are returned in clock
1126 ($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
1128 Note: Perl's builtin C<times()> function returns four values, measured in
1133 Use method C<FileHandle::new_tmpfile()> instead.
1137 Returns a name for a temporary file.
1139 $tmpfile = POSIX::tmpnam();
1143 This is identical to Perl's builtin C<lc()> function.
1147 This is identical to Perl's builtin C<uc()> function.
1151 This is identical to the C function C<ttyname()>.
1155 Retrieves the time conversion information from the C<tzname> variable.
1158 ($std, $dst) = POSIX::tzname();
1162 This is identical to the C function C<tzset()>.
1166 This is identical to Perl's builtin C<umask()> function.
1170 Get name of current operating system.
1172 ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname();
1176 Use method C<FileHandle::ungetc()> instead.
1180 This is identical to Perl's builtin C<unlink()> function.
1184 This is identical to Perl's builtin C<utime()> function.
1188 vfprintf() is C-specific.
1192 vprintf() is C-specific.
1196 vsprintf() is C-specific.
1200 This is identical to Perl's builtin C<wait()> function.
1204 Wait for a child process to change state. This is identical to Perl's
1205 builtin C<waitpid()> function.
1207 $pid = POSIX::waitpid( -1, &POSIX::WNOHANG );
1208 print "status = ", ($? / 256), "\n";
1212 This is identical to the C function C<wcstombs()>.
1216 This is identical to the C function C<wctomb()>.
1220 Write to a file. This uses file descriptors such as those obtained by
1221 calling C<POSIX::open>.
1223 $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
1225 $bytes = POSIX::write( $b, $buf, 5 );
1227 Returns C<undef> on failure.
1233 =head2 POSIX::SigAction
1239 Creates a new C<POSIX::SigAction> object which corresponds to the C
1240 C<struct sigaction>. This object will be destroyed automatically when it is
1241 no longer needed. The first parameter is the fully-qualified name of a sub
1242 which is a signal-handler. The second parameter is a C<POSIX::SigSet>
1243 object. The third parameter contains the C<sa_flags>.
1245 $sigset = POSIX::SigSet->new;
1246 $sigaction = POSIX::SigAction->new( 'main::handler', $sigset, &POSIX::SA_NOCLDSTOP );
1248 This C<POSIX::SigAction> object should be used with the C<POSIX::sigaction()>
1253 =head2 POSIX::SigSet
1259 Create a new SigSet object. This object will be destroyed automatically
1260 when it is no longer needed. Arguments may be supplied to initialize the
1263 Create an empty set.
1265 $sigset = POSIX::SigSet->new;
1267 Create a set with SIGUSR1.
1269 $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
1273 Add a signal to a SigSet object.
1275 $sigset->addset( &POSIX::SIGUSR2 );
1277 Returns C<undef> on failure.
1281 Remove a signal from the SigSet object.
1283 $sigset->delset( &POSIX::SIGUSR2 );
1285 Returns C<undef> on failure.
1289 Initialize the SigSet object to be empty.
1291 $sigset->emptyset();
1293 Returns C<undef> on failure.
1297 Initialize the SigSet object to include all signals.
1301 Returns C<undef> on failure.
1305 Tests the SigSet object to see if it contains a specific signal.
1307 if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
1308 print "contains SIGUSR1\n";
1313 =head2 POSIX::Termios
1319 Create a new Termios object. This object will be destroyed automatically
1320 when it is no longer needed.
1322 $termios = POSIX::Termios->new;
1326 Get terminal control attributes.
1328 Obtain the attributes for stdin.
1332 Obtain the attributes for stdout.
1334 $termios->getattr( 1 )
1336 Returns C<undef> on failure.
1340 Retrieve a value from the c_cc field of a termios object. The c_cc field is
1341 an array so an index must be specified.
1343 $c_cc[1] = $termios->getcc(1);
1347 Retrieve the c_cflag field of a termios object.
1349 $c_cflag = $termios->getcflag;
1353 Retrieve the c_iflag field of a termios object.
1355 $c_iflag = $termios->getiflag;
1359 Retrieve the input baud rate.
1361 $ispeed = $termios->getispeed;
1365 Retrieve the c_lflag field of a termios object.
1367 $c_lflag = $termios->getlflag;
1371 Retrieve the c_oflag field of a termios object.
1373 $c_oflag = $termios->getoflag;
1377 Retrieve the output baud rate.
1379 $ospeed = $termios->getospeed;
1383 Set terminal control attributes.
1385 Set attributes immediately for stdout.
1387 $termios->setattr( 1, &POSIX::TCSANOW );
1389 Returns C<undef> on failure.
1393 Set a value in the c_cc field of a termios object. The c_cc field is an
1394 array so an index must be specified.
1396 $termios->setcc( 1, &POSIX::VEOF );
1400 Set the c_cflag field of a termios object.
1402 $termios->setcflag( &POSIX::CLOCAL );
1406 Set the c_iflag field of a termios object.
1408 $termios->setiflag( &POSIX::BRKINT );
1412 Set the input baud rate.
1414 $termios->setispeed( &POSIX::B9600 );
1416 Returns C<undef> on failure.
1420 Set the c_lflag field of a termios object.
1422 $termios->setlflag( &POSIX::ECHO );
1426 Set the c_oflag field of a termios object.
1428 $termios->setoflag( &POSIX::OPOST );
1432 Set the output baud rate.
1434 $termios->setospeed( &POSIX::B9600 );
1436 Returns C<undef> on failure.
1438 =item Baud rate values
1440 B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110
1442 =item Terminal interface values
1444 TCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF
1446 =item c_cc field values
1448 VEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS
1450 =item c_cflag field values
1452 CLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD
1454 =item c_iflag field values
1456 BRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK
1458 =item c_lflag field values
1460 ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP
1462 =item c_oflag field values
1468 =head1 PATHNAME CONSTANTS
1474 _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
1478 =head1 POSIX CONSTANTS
1484 _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
1488 =head1 SYSTEM CONFIGURATION
1494 _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
1504 E2BIG EACCES EAGAIN EBADF EBUSY ECHILD EDEADLK EDOM EEXIST EFAULT EFBIG EINTR EINVAL EIO EISDIR EMFILE EMLINK ENAMETOOLONG ENFILE ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS ENOTDIR ENOTEMPTY ENOTTY ENXIO EPERM EPIPE ERANGE EROFS ESPIPE ESRCH EXDEV
1514 FD_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
1524 DBL_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
1534 ARG_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
1544 LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME
1564 SA_NOCLDSTOP SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK
1574 S_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
1578 S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
1588 EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX
1598 BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX
1608 CLK_TCK CLOCKS_PER_SEC
1618 R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STRERR_FILENO W_OK X_OK
1632 WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG
1638 This document generated by ./mkposixman.PL version 19960129.