On Wed, Sep 21, 2016 at 6:23 PM, Michael McConville <mm...@mykolab.com> wrote:
> The current version is somewhat awkward and forgets to mention that
> errno is set. I adapted the paragraph found in most other system call
> man pages.

There are six syscalls that return an fd on success...and their
manpages all have totally different wording for the return value.

     The call returns -1 on error.  If it succeeds, it returns a non-negative
     integer that is a descriptor for the accepted socket.

     Upon successful completion, fhopen() returns the file descriptor for the
     opened file, while fhstat() and fhstatfs() return 0.  Otherwise, -1 is
     returned and errno is set to indicate the error.

     kqueue() creates a new kernel event queue and returns a file descriptor.
     If there was an error creating the kernel event queue, a value of -1 is
     returned and errno set.

     If successful, open() returns a non-negative integer, termed a file
     descriptor.  Otherwise, a value of -1 is returned and errno is set to
     indicate the error.

openat: same manpage as open but totally unmentioned in the RETURN
VALUES section

     A -1 is returned if an error occurs, otherwise the return value is a
     descriptor referencing the socket.

<sigh>  Some consistency that doesn't sacrifice clarity would be nice...

Reply via email to