A mirror of Man pages
Go to file
Michael Kerrisk 3d335319e7 write.2: RETURN VALUE: clarify details of partial write and
As reported by Nadav Har'El in
https://bugzilla.kernel.org/show_bug.cgi?id=197961

    The write(2) manual page has this paragraph:

    "On  success,  the  number  of bytes written is returned
    (zero indicates nothing was written).  It is not an error
    if  this  number  is  smaller than the number of bytes
    requested; this may happen for example because the disk
    device was filled.  See also NOTES."

    I find a few problems with this paragraph:

    1. It's not clear what "See also NOTES." refers to (does it
       refer to anything?). What in the NOTES is relevant here?

    2. The paragraph seems to suggest that write(2) of a
       non-empty buffer may sometimes return even 0 in case of an
       error like the device being filled. I think this is wrong
       - if there was an error after already writing some number
       of bytes, this non-zero number is returned. But if there's
       an error before writing any bytes, -1 will be returned
       (and the error reason in errno) - 0 will not be returned
       unless the given count is 0 (that case is explained in the
       following paragraph).

    3. The paragraph doesn't explain what a user should do
       after a short write (i.e., write(2) returning less than
       count). How would the user know why there was an error, or
       if there even was one? I think users should be told what
       to do next because this information is part of how to use
       this API correctly. I think users should be told to retry
       the rest of the write (i.e., write(fd, buf+ret, count-ret)
       and this will either succeed in writing some more data if
       the error reason was solved, or the second write will
       return -1 and the error reason in errno.

Reported-by: Nadav Har'El <nyh@math.technion.ac.il>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-12-23 19:09:33 +01:00
man1 iconv.1: SEE ALSO: add uconv(1) 2018-11-06 21:53:21 +01:00
man2 write.2: RETURN VALUE: clarify details of partial write and 2018-12-23 19:09:33 +01:00
man3 ioctl_console.2, ctime.3: tfix 2018-11-27 18:28:31 +01:00
man4 clone.2, prctl.2, st.4, proc.5: Change references to '2.6.0-test*' series kernels to just '2.6.0' 2018-11-19 13:09:55 +01:00
man5 proc.5: Refer to mount(2) for explanation of mount vs superblock options 2018-12-14 09:11:29 +01:00
man6 intro.6: wfix 2017-08-25 21:41:03 +02:00
man7 namespaces.7: tfix 2018-12-18 21:09:16 +01:00
man8 zic.8: Sync from tzdb upstream 2018-11-01 15:09:33 +01:00
scripts scripts: mark them executable 2018-05-31 21:34:32 +02:00
Changes Start of man-pages-4.17: updating Changes and Changes.old 2018-04-30 21:34:48 +02:00
Changes.old Start of man-pages-4.17: updating Changes and Changes.old 2018-04-30 21:34:48 +02:00
Makefile Makefile: Remove a redundant comment 2017-11-20 10:38:10 +01:00
README README: tfix 2017-05-13 20:14:15 +02:00
man-pages-4.17.Announce Start of man-pages-4.17: updating .Announce and .lsm files 2018-04-30 21:34:48 +02:00
man-pages-4.17.lsm Start of man-pages-4.17: updating .Announce and .lsm files 2018-04-30 21:34:48 +02:00

README

This package contains Linux man pages for sections 1 through 8.  Some
more information is given in the 'man-pages-x.y.Announce' file.

Installing and uninstalling
===========================
"make install" will copy these man pages to /usr/share/man/man[1-8].

To install to a path different from /usr, use
"make install prefix=/install/path".

"make remove" or "make uninstall" will remove any man page in this
distribution from its destination.  Use with caution, and remember to
use "prefix" if desired, as with the "install" target.

"make" or "make all" will perform "make uninstall" followed by "make
install".

Man page overlap and duplication
================================
Note that sometimes these pages are duplicates of pages also distributed
in other packages.  This has been reported about:

man page                also found in
-------------------------------------
resolver.3              bind-utils, bind9utils
resolv.conf.5           "
passwd.5                shadow, passwd
mailaddr.7              ?

Copyrights
==========
See the 'man-pages-x.y.Announce' file.

Homepage
========
For much more about the Linux man-pages project, see
http://www.kernel.org/doc/man-pages/index.html.