Perl 5.001
[p5sagit/p5-mst-13.2.git] / pod / modpods / POSIX.pod
CommitLineData
a0d0e21e 1=head1 NAME
2
3POSIX - Perl interface to IEEE 1003.1 namespace
4
5=head1 SYNOPSIS
6
7 use POSIX;
8 use POSIX 'strftime';
9
10=head1 DESCRIPTION
11
12The POSIX module permits you to access all (or nearly all) the standard
13POSIX 1003.1 identifiers. Things which are C<#defines> in C, like EINTR
14or O_NDELAY, are automatically exported into your namespace. All
15functions are only exported if you ask for them explicitly. Most likely
16people will prefer to use the fully-qualified function names.
17
18To get a list of all the possible identifiers available to you--and
19their semantics--you should pick up a 1003.1 spec, or look in the
20F<POSIX.pm> module.
21
22=head1 EXAMPLES
23
748a9306 24 printf "EINTR is %d\n", EINTR;
a0d0e21e 25
26 POSIX::setsid(0);
27
28 $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
29 # note: that's a filedescriptor, *NOT* a filehandle
30
31=head1 NOTE
32
33The POSIX module is probably the most complex Perl module supplied with
34the standard distribution. It incorporates autoloading, namespace games,
35and dynamic loading of code that's in Perl, C, or both. It's a great
36source of wisdom.
37
38=head1 CAVEATS
39
40A few functions are not implemented because they are C specific. If you
41attempt to call these, they will print a message telling you that they
748a9306 42aren't implemented, and suggest using the Perl equivalent should one
43exist. For example, trying to access the setjmp() call will elicit the
a0d0e21e 44message "setjmp() is C-specific: use eval {} instead".
45
46Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
47are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
48For example, one vendor may not define EDEADLK, or the semantics of the
49errno values set by open(2) might not be quite right. Perl does not
50attempt to verify POSIX compliance. That means you can currently
51successfully say "use POSIX", and then later in your program you find
52that your vendor has been lax and there's no usable ICANON macro after
53all. This could be construed to be a bug.