Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc Various minor improvements.



details:   https://anonhg.NetBSD.org/src/rev/37eb81bdc48d
branches:  trunk
changeset: 766549:37eb81bdc48d
user:      wiz <wiz%NetBSD.org@localhost>
date:      Mon Jun 27 08:21:07 2011 +0000

description:
Various minor improvements.

diffstat:

 lib/libc/gen/popen.3      |   4 +-
 lib/libc/stdio/fopen.3    |  10 ++++----
 lib/libc/sys/accept.2     |  11 ++++++---
 lib/libc/sys/dup.2        |   6 ++--
 lib/libc/sys/fcntl.2      |  51 +++++++++++++++++++++++-----------------------
 lib/libc/sys/pipe.2       |  12 +++++-----
 lib/libc/sys/recv.2       |  30 +++++++++++++-------------
 lib/libc/sys/socketpair.2 |   6 ++--
 8 files changed, 67 insertions(+), 63 deletions(-)

diffs (truncated from 305 to 300 lines):

diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/gen/popen.3
--- a/lib/libc/gen/popen.3      Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/gen/popen.3      Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: popen.3,v 1.17 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: popen.3,v 1.18 2011/06/27 08:21:07 wiz Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -81,7 +81,7 @@
 is present in the
 .Fa type
 string, the file descriptor used internally is set to be closed on
-.Xr exec 2 .
+.Xr exec 3 .
 .Pp
 The
 .Fa command
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/stdio/fopen.3
--- a/lib/libc/stdio/fopen.3    Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/stdio/fopen.3    Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: fopen.3,v 1.25 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: fopen.3,v 1.26 2011/06/27 08:21:07 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -105,7 +105,7 @@
 .St -ansiC
 extension.
 .Pp
-the letter
+The letter
 .Dq e
 in the mode string sets the close-on-exec flag in the file descriptors of
 the newly opened file files; if the operation fails,
@@ -202,6 +202,9 @@
 is set to indicate the error.
 .Sh ERRORS
 .Bl -tag -width Er
+.It Bq Er EFTYPE
+The file is not a regular file and the character ``f'' is specified
+in the mode.
 .It Bq Er EINVAL
 The
 .Fa mode
@@ -211,9 +214,6 @@
 or
 .Fn freopen
 was invalid.
-.It Bq Er EFTYPE
-The file is not a regular file and the character ``f'' is specified
-in the mode.
 .El
 .Pp
 The
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/accept.2
--- a/lib/libc/sys/accept.2     Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/accept.2     Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: accept.2,v 1.27 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: accept.2,v 1.28 2011/06/27 08:21:07 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -151,7 +151,9 @@
 .Pp
 It can also temporarily replace the signal mask of the calling thread if
 .Fa sigmask
-is a non-null pointer, then the
+is a
+.Pf non- Dv NULL
+pointer, then the
 .Fn paccept
 function shall replace the signal mask of the caller by the set of
 signals pointed to by
@@ -159,10 +161,11 @@
 before waiting for a connection, and shall restore the signal mask
 of the calling thread before returning.
 .Sh RETURN VALUES
-The 
+The
 .Fn accept
 and
-.Fn paccept calls return \-1 on error.
+.Fn paccept
+calls return \-1 on error.
 If they succeed, they return a non-negative
 integer that is a descriptor for the accepted socket.
 .Sh COMPATIBILITY
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/dup.2
--- a/lib/libc/sys/dup.2        Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/dup.2        Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: dup.2,v 1.22 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: dup.2,v 1.23 2011/06/27 08:21:08 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -123,8 +123,8 @@
 .Va errno
 indicates the cause of the error.
 .Sh ERRORS
-.Fn dup
-.Fn dup2
+.Fn dup ,
+.Fn dup2 ,
 and
 .Fn dup3
 fail if:
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/fcntl.2
--- a/lib/libc/sys/fcntl.2      Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/fcntl.2      Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: fcntl.2,v 1.38 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: fcntl.2,v 1.39 2011/06/27 08:21:08 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -81,8 +81,9 @@
 system calls.
 .El
 .It Dv F_DUPFD_CLOEXEC
-Same as F_DUPFD, but sets the close-on-exec property on the file descriptor
-created.
+Same as
+.Dv F_DUPFD ,
+but sets the close-on-exec property on the file descriptor created.
 .It Dv F_GETFD
 Get the close-on-exec flag associated with the file descriptor
 .Fa fd
@@ -318,6 +319,28 @@
 request fails or blocks respectively when another process has existing
 locks on bytes in the specified region and the type of any of those
 locks conflicts with the type specified in the request.
+.Sh RETURN VALUES
+Upon successful completion, the value returned depends on
+.Fa cmd
+as follows:
+.Bl -tag -width F_GETOWNX -offset indent
+.It Dv F_DUPFD
+A new file descriptor.
+.It Dv F_GETFD
+Value of flag (only the low-order bit is defined).
+.It Dv F_GETFL
+Value of flags.
+.It Dv F_GETOWN
+Value of file descriptor owner.
+.It Dv F_MAXFD
+Value of the highest file descriptor open by the process.
+.It other
+Value other than \-1.
+.El
+.Pp
+Otherwise, a value of \-1 is returned and
+.Va errno
+is set to indicate the error.
 .Sh COMPATIBILITY
 This interface follows the completely stupid semantics of
 .At V
@@ -366,28 +389,6 @@
 would cause a deadlock and fails with an
 .Er EDEADLK
 error.
-.Sh RETURN VALUES
-Upon successful completion, the value returned depends on
-.Fa cmd
-as follows:
-.Bl -tag -width F_GETOWNX -offset indent
-.It Dv F_DUPFD
-A new file descriptor.
-.It Dv F_GETFD
-Value of flag (only the low-order bit is defined).
-.It Dv F_GETFL
-Value of flags.
-.It Dv F_GETOWN
-Value of file descriptor owner.
-.It Dv F_MAXFD
-Value of the highest file descriptor open by the process.
-.It other
-Value other than \-1.
-.El
-.Pp
-Otherwise, a value of \-1 is returned and
-.Va errno
-is set to indicate the error.
 .Sh ERRORS
 .Fn fcntl
 will fail if:
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/pipe.2
--- a/lib/libc/sys/pipe.2       Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/pipe.2       Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pipe.2,v 1.23 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: pipe.2,v 1.24 2011/06/27 08:21:08 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -82,7 +82,7 @@
 returns a zero count.
 .Pp
 The
-.Fn pipe2 
+.Fn pipe2
 function
 behaves exactly like
 .Fn pipe
@@ -109,10 +109,6 @@
 .Fn pipe2
 calls will fail if:
 .Bl -tag -width Er
-.It Bq Er EMFILE
-Too many descriptors are active.
-.It Bq Er ENFILE
-The system file table is full.
 .It Bq Er EFAULT
 The
 .Fa fildes
@@ -120,6 +116,10 @@
 The reliable detection of this error cannot be guaranteed; when not
 detected, a signal may be delivered to the process, indicating an
 address violation.
+.It Bq Er EMFILE
+Too many descriptors are active.
+.It Bq Er ENFILE
+The system file table is full.
 .El
 .Sh SEE ALSO
 .Xr sh 1 ,
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/recv.2
--- a/lib/libc/sys/recv.2       Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/recv.2       Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: recv.2,v 1.28 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: recv.2,v 1.29 2011/06/27 08:21:08 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -234,10 +234,24 @@
 .Sh ERRORS
 The calls fail if:
 .Bl -tag -width Er
+.It Bq Er EAGAIN
+The socket is marked non-blocking, and the receive operation
+would block, or
+a receive timeout had been set,
+and the timeout expired before data were received.
 .It Bq Er EBADF
 The argument
 .Fa s
 is an invalid descriptor.
+.It Bq Er EFAULT
+The receive buffer pointer(s) point outside the process's
+address space.
+.It Bq Er EINTR
+The receive was interrupted by delivery of a signal before
+any data were available.
+.It Bq Er EINVAL
+The total length of the I/O is more than can be expressed by the ssize_t
+return value.
 .It Bq Er ENOTCONN
 The socket is associated with a connection-oriented protocol
 and has not been connected (see
@@ -248,20 +262,6 @@
 The argument
 .Fa s
 does not refer to a socket.
-.It Bq Er EAGAIN
-The socket is marked non-blocking, and the receive operation
-would block, or
-a receive timeout had been set,
-and the timeout expired before data were received.
-.It Bq Er EINTR
-The receive was interrupted by delivery of a signal before
-any data were available.
-.It Bq Er EFAULT
-The receive buffer pointer(s) point outside the process's
-address space.
-.It Bq Er EINVAL
-The total length of the I/O is more than can be expressed by the ssize_t
-return value.
 .El
 .Pp
 .Fn recvmsg
diff -r 767d8eb5e88b -r 37eb81bdc48d lib/libc/sys/socketpair.2
--- a/lib/libc/sys/socketpair.2 Mon Jun 27 07:05:31 2011 +0000
+++ b/lib/libc/sys/socketpair.2 Mon Jun 27 08:21:07 2011 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: socketpair.2,v 1.22 2011/06/26 16:42:41 christos Exp $
+.\"    $NetBSD: socketpair.2,v 1.23 2011/06/27 08:21:08 wiz Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -53,9 +53,9 @@
 .Fa protocol .
 The descriptors used in referencing the new sockets
 are returned in
-.Fa sv Ns [0]
+.Fa sv[0]
 and



Home | Main Index | Thread Index | Old Index