Commit Graph

17377 Commits

Author SHA1 Message Date
Michael Kerrisk 250d41b91b posix_fadvise.2: SEE ALSO: mincore(2)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 16:21:41 +13:00
Michael Kerrisk f90b94e32c posix_fadvise.2: Note that POSIX_FADV_DONTNEED *may* try to write back dirty pages
Looking at the code in mm/fadvise.c, we have

    case POSIX_FADV_DONTNEED:
        if (!inode_write_congested(mapping->host))
            __filemap_fdatawrite_range(mapping, offset, endbyte,
                                       WB_SYNC_NONE);

This suggests that *if* the backing device is not congested, then
__filemap_fdatawrite_range() is called. The comments for that
function say:

    __filemap_fdatawrite_range - start writeback on mapping dirty pages in range

So, my reading of this is that *maybe* some dirty pages will be
written to the backing device by the time that POSIX_FADV_DONTNEED
gets to calling invalidate_mapping_pages() whose description says:

/**
 * invalidate_mapping_pages - Invalidate all the unlocked pages of one inode
 * @mapping: the address_space which holds the pages to invalidate
 * @start: the offset 'from' which to invalidate
 * @end: the offset 'to' which to invalidate (inclusive)
 *
 * This function only removes the unlocked pages, if you want to
 * remove all the pages of one inode, you must call truncate_inode_pages.
 *
 * invalidate_mapping_pages() will not block on IO activity. It will not
 * invalidate pages which are dirty, locked, under writeback or mapped into
 * pagetables.
 */

So, my reading of this is that the handling of dirty pages is an
optimization. If some pages can be written in time, they will be
freed by POSIX_MADV_DONTFREE. But there are no guarantees.

All of that said, some experimentation suggests that, in a lot
of cases, POSIX_MADV_DONTFREE does often free dirty pages.

See https://bugzilla.kernel.org/show_bug.cgi?id=95421.

Reported-by: Maik Zumstrull <maik@zumstrull.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 16:20:45 +13:00
Michael Kerrisk a6b80261c8 posix_fadvise.2: Reorganize some text
Details for various flags were hidden under NOTES.
Move them to DESCRIPTION, to make the details more
obvious.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 15:03:17 +13:00
Michael Kerrisk dfbb4842f9 write.2: Alert the reader that there is a limit on 'count'
See https://bugzilla.kernel.org/show_bug.cgi?id=86061

Reported-by: Kai NODA <nodakai@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 15:03:17 +13:00
Michael Kerrisk 6435869d7e read.2: Rework text in DESCRIPTION that talks about limits for 'count'
See https://bugzilla.kernel.org/show_bug.cgi?id=86061

Reported-by: Kai NODA <nodakai@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 15:03:11 +13:00
Michael Kerrisk 68210340d4 open.2: Clarify distinction between file creation flags and file status flags
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk 7fba006583 open.2: Restructure O_NOFOLLOW text for easier parsing
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk 6ccb7137eb open.2: Note ambiguity of ELOOP error when using O_NOFOLLOW
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk 8db11e238b open.2: Clarify that O_NOFOLLOW is now in POSIX
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk dc951c848d truncate.2: Note use of ftruncate() for POSIX shared memory objects
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk b59a4ee7bf scanf.3: Document the quote (') modifier for decimal conversions
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk 2b609f22c4 printf.3: Add references to setlocale(3) in discussions of locales
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 14:53:33 +13:00
Michael Kerrisk 5d717bda58 printf.3: As a nonstandard extension, GNU treats 'll' and 'L' as synonyms
See https://bugzilla.kernel.org/show_bug.cgi?id=190341.

Reported-by: Nadav Har'El  <nyh@math.technion.ac.il>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:41:48 +13:00
Michael Kerrisk 1b8d305469 printf.3: Document nonstandard 'Z' modifier
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:20:50 +13:00
Michael Kerrisk 74b9e29f92 printf.3: Document 'q' length modifier
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:20:50 +13:00
Jakub Wilk 2e621720d0 iconv.1: ffix
Don't embolden commas between option names.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:31 +13:00
Jakub Wilk 2081060818 iconv.1: tfix
Escape hyphens in option names and pathnames.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:31 +13:00
Jakub Wilk 908a1b280a proc.5: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:31 +13:00
Jakub Wilk 555b5c7b1b vfork.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:31 +13:00
Jakub Wilk ba71223dfb ioctl_iflags.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:30 +13:00
Michael Kerrisk e00916fdee random_r.3: tfix
Reported-by: Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:30 +13:00
Michael Kerrisk 6e9219f775 capabilities.7: Further enhance the recommendation against new uses of CAP_SYS_ADMIN
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:30 +13:00
Michael Kerrisk fa50d3d48b capabilities.7: Explicitly point from CAP_SYS_ADMIN to "Notes for kernel developers"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-26 09:10:24 +13:00
Michael Kerrisk ddb624a9e5 capabilities.7: Improvements after feedback from Casey Schaufler
Reported-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 17:04:44 +13:00
Michael Kerrisk 8de5616fd7 capabilities.7: Add subsection with notes to kernel developers
Provide some notes to kernel developers considering how to choose
which capability should govern a new kernel feature.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 17:04:07 +13:00
Michael Kerrisk 5a5bde703f proc.5: Add reference to slabinfo(5) in discussion of /proc/meminfo 'Slab' field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 16:57:08 +13:00
Tadeusz Struk 58b9f0ebb9 readdir.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 13:09:18 +13:00
Michael Kerrisk accc82d2d4 getopt.3: Correct details of use of <stdio.h> to get getopt() declaration
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 11:41:51 +13:00
Michael Kerrisk a4746c3978 getopt.3: Reword discussion of error handling and reporting
The existing description was hard to understand. Break
it into a bullet list that separates out the details
in a manner that is easier to parse.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 10:29:14 +13:00
Michael Kerrisk 797438e749 getopt.3: Remove redundant text
The same information is described in two consecutive paragraphs.
Remove the shorter paragraph, leaving the longer one that
contains more information.

Reported-by: John Wiersba <jrw32982@yahoo.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 10:04:27 +13:00
Michael Kerrisk 606b226bd2 random_r.3: Add BUGS section pointing out the weirdness of the initstate_r() API
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 09:54:36 +13:00
Michael Kerrisk 516a39595e random_r.3: Note that 'buf' records a pointer to 'statebuf'
See https://sourceware.org/bugzilla/show_bug.cgi?id=3662.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 09:49:08 +13:00
Michael Kerrisk a689fdb223 random.3: Minor improvement to wording in NOTES
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 09:38:21 +13:00
Michael Kerrisk f9a54fa1cd random.3: Relocate information of "optimal" value of initstate() 'n' argument
The information was a bit hidden in NOTES.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 09:32:21 +13:00
Michael Kerrisk 4efbcb17e9 random_r.3: Add some usage notes for setstate_r()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 09:00:12 +13:00
Michael Kerrisk 91e37268d6 random_r.3: 'buf.state' must be initialized to NULL before calling initstate_r()
See https://bugzilla.kernel.org/show_bug.cgi?id=192801.

See also the glibc source file string/strfry.c, which shows
an example of this initialization:

  if (!init)
    {
      static char state[32];
      rdata.state = NULL;
      __initstate_r (time ((time_t *) NULL) ^ getpid (),
                     state, sizeof (state), &rdata);
      init = 1;
    }

Reported-by: Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 08:43:38 +13:00
Michael Kerrisk 48ac01a782 proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 07:54:19 +13:00
Michael Kerrisk 729b84f473 strverscmp.3: Fix comparison error in example program
Reported-by: Vivenzio Pagliari <vivenzio.pagliari@nokia.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 07:41:44 +13:00
Michael Kerrisk 6284854c9d slabinfo.5: SEE ALSO: add slabtop(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk c67f5ff2f9 sem_wait.3: Remove statement that SA_RESTART does not cause restarting
This has not been true since Linux 2.6.22. The description
of EINTR maintains a reference to signal(7), which explains
the historical details.

See https://bugzilla.kernel.org/show_bug.cgi?id=192071

Reported-by: Fabjan Sukalia <fsukalia@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 700bfeba0a read.2: Remove crufty text about EINTR and partial read
Remove bogus text saying that POSIX permits partial read
to return -1/EINTR on interrupt by a signal handler.
That statement already ceased to be true in SUSv1 (1995)!

See https://bugzilla.kernel.org/show_bug.cgi?id=193111

Reported-by: Steven Luo <steven@steven676.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 1b1069ee02 getline.3: Handle null bytes in input
As reported by Kent:

    The example input/output handler in this EXAMPLE is subject
    to introducing subtle bugs if the input stream contains
    literal null bytes.

    Subsequently, there should be some warning that this occurs,
    or an alternative using fwrite(3) might be better.

Change the example program to use fwrite(3).

See https://bugzilla.kernel.org/show_bug.cgi?id=192701

Reported-by: Kent Fredic <kentfredric@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 0885f9504f getline.3: EXAMPLE: better error handling
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk cbc616e345 getline.3: EXAMPLE: specify file to be opened as command-line argument
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 71fd04a347 getline.3: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 809b6c47cc getline.3: Use better variable name in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 4c3cfc369c mbind.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk f13970357e random.7: Mention getentropy(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk d9e71757d0 getrandom.2: glibc support was added in version 2.25
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00
Michael Kerrisk 933ab9c7f6 random.7: SEE ALSO: add getentropy(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-01-25 00:14:06 +13:00