aboutsummaryrefslogtreecommitdiffstats
path: root/man2/open.2
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-05-18 16:06:42 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-05-18 16:06:42 +0000
commita1d5f77cc8a41c7c0ba751140e31b8b0e71fd091 (patch)
treef55287808a115d93eb00615d65ca49ab9257bcf9 /man2/open.2
parent09a1235aaebbdd25fb974ab31e8bcdcf77e49031 (diff)
downloadman-pages-a1d5f77cc8a41c7c0ba751140e31b8b0e71fd091.tar.gz
Reordered sections to be more consistent, in some cases renaming
sections or shifting paragraphs between sections.
Diffstat (limited to 'man2/open.2')
-rw-r--r--man2/open.2103
1 files changed, 57 insertions, 46 deletions
diff --git a/man2/open.2 b/man2/open.2
index 2b6efd4f20..3360cf040e 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -369,46 +369,6 @@ return the new file descriptor, or \-1 if an error occurred
(in which case,
.I errno
is set appropriately).
-.SH NOTES
-There are many infelicities in the protocol underlying NFS, affecting
-amongst others
-.BR O_SYNC " and " O_NDELAY .
-
-POSIX provides for three different variants of synchronised I/O,
-corresponding to the flags \fBO_SYNC\fR, \fBO_DSYNC\fR and
-\fBO_RSYNC\fR.
-Currently (2.1.130) these are all synonymous under Linux.
-
-Note that
-.BR open ()
-can open device special files, but
-.BR creat ()
-cannot create them; use
-.BR mknod (2)
-instead.
-.LP
-On NFS file systems with UID mapping enabled,
-.BR open ()
-may
-return a file descriptor but e.g.
-.BR read (2)
-requests are denied
-with \fBEACCES\fP.
-This is because the client performs
-.BR open ()
-by checking the
-permissions, but UID mapping is performed by the server upon
-read and write requests.
-
-If the file is newly created, its st_atime, st_ctime, st_mtime fields
-(respectively, time of last access, time of last status change, and
-time of last modification; see
-.BR stat (2))
-are set
-to the current time, and so are the st_ctime and st_mtime fields of the
-parent directory.
-Otherwise, if the file is modified because of the O_TRUNC flag,
-its st_ctime and st_mtime fields are set to the current time.
.SH ERRORS
.TP
.B EACCES
@@ -523,12 +483,6 @@ The
flag was specified, and an incompatible lease was held on the file
(see
.BR fcntl (2)).
-.SH NOTES
-Under Linux, the O_NONBLOCK flag indicates that one wants to open
-but does not necessarily have the intention to read or write.
-This is typically used to open devices in order to get a file descriptor
-for use with
-.BR ioctl (2).
.SH "CONFORMING TO"
SVr4, 4.3BSD, POSIX.1-2001.
The
@@ -540,6 +494,14 @@ flags are Linux specific.
One may have to define the
.B _GNU_SOURCE
macro to get their definitions.
+.SH NOTES
+Under Linux, the
+.B O_NONBLOCK
+flag indicates that one wants to open
+but does not necessarily have the intention to read or write.
+This is typically used to open devices in order to get a file descriptor
+for use with
+.BR ioctl (2).
.LP
The (undefined) effect of
.B O_RDONLY | O_TRUNC
@@ -565,6 +527,55 @@ Older Linux kernels simply ignore this flag.
One may have to define the
.B _GNU_SOURCE
macro to get its definition.
+.PP
+There are many infelicities in the protocol underlying NFS, affecting
+amongst others
+.BR O_SYNC " and " O_NDELAY .
+
+POSIX provides for three different variants of synchronised I/O,
+corresponding to the flags \fBO_SYNC\fR, \fBO_DSYNC\fR and
+\fBO_RSYNC\fR.
+Currently (2.1.130) these are all synonymous under Linux.
+
+Note that
+.BR open ()
+can open device special files, but
+.BR creat ()
+cannot create them; use
+.BR mknod (2)
+instead.
+.LP
+On NFS file systems with UID mapping enabled,
+.BR open ()
+may
+return a file descriptor but e.g.
+.BR read (2)
+requests are denied
+with \fBEACCES\fP.
+This is because the client performs
+.BR open ()
+by checking the
+permissions, but UID mapping is performed by the server upon
+read and write requests.
+
+If the file is newly created, its
+.IR st_atime ,
+.IR st_ctime ,
+.I st_mtime
+fields
+(respectively, time of last access, time of last status change, and
+time of last modification; see
+.BR stat (2))
+are set
+to the current time, and so are the
+.I st_ctime
+and
+.I st_mtime
+fields of the
+parent directory.
+Otherwise, if the file is modified because of the
+.B O_TRUNC
+flag, its st_ctime and st_mtime fields are set to the current time.
.SH BUGS
"The thing that has always disturbed me about O_DIRECT is that the whole
interface is just stupid, and was probably designed by a deranged monkey