Commit Graph

1791 Commits

Author SHA1 Message Date
Michael Kerrisk e0d16ae5e7 wait4.2: wait3() is a library function layered on wait4().
On Linux wait3() is a library function implemented on top of wait4().
(Knowing this is useful when using strace(2), for example.)
2008-09-29 03:51:49 +02:00
Michael Kerrisk 986992f30d splice.2: note that SPLICE_F_MOVE is a no-op since kernel 2.6.21 2008-09-26 07:31:14 +02:00
Michael Kerrisk 901d59b5ce mlock.2: tweaks to Maxin John's patch 2008-09-25 11:18:08 +02:00
Michael Kerrisk 1ad3882cf8 tstamp 2008-09-25 11:11:53 +02:00
Maxin John 9fdc5b1260 mlock.2: add EAGAIN error.
Summary from mtk: recent work on mlock caused Maxin to notice that
the EAGAIN error was not documented.  KOSAKI Motohiro noted
that this behavior is longstanding.
=====
Dear Michael,

    As per the mlock(2) implementation bugfix which is present in
Linux 2.6.27-rc2 git commit,
(http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a477097d9c37c1cf289c7f0257dffcfa42d50197),
the mlock(2) man page should be modified to reflect the latest changes
in the kernel.

See the LKML thread regarding this commit :
http://www.nabble.com/mlock()-return-value-issue-in-kernel-2.6.23.17-td18751601.html

This patch modifies the mlock(2) behaviour as per the SUSv3 specification.

[ENOMEM]
    Some or all of the address range specified by the addr and
    len arguments does not correspond to valid mapped pages
    in the address space of the process.

[EAGAIN]
    Some or all of the memory identified by the operation could not
    be locked when the call was made.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Maxin B. John <maxin.john@ap.sony.com>

=====
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: "Maxin John" <maxin.john@gmail.com>
Subject: Re: mlock(2) man page modifications
Cc: kosaki.motohiro@jp.fujitsu.com,
        "Michael Kerrisk" <mtk.manpages@googlemail.com>, man@vger.kernel.org
Date: Thu, 25 Sep 2008 15:04:49 +0900 (JST)

Hi Maxin,

Thank you for your attention.
I think your point and your patch are right.

However, my patch is trivial regression fix, not behavior change.
An older kernel can return EAGAIN at memory stavation.
my patch has following hunk.

> +++ b/mm/mlock.c
> @@ -78,8 +78,6 @@ success:
>  
>         mm->locked_vm -= pages;
>  out:
> -       if (ret == -ENOMEM)
> -               ret = -EAGAIN;

In addition, 2.6.11 (oldest code of git repository) has following code.


static int mlock_fixup(struct vm_area_struct * vma, 
        unsigned long start, unsigned long end, unsigned int newflags)
{
(snip)
        vma->vm_mm->locked_vm -= pages;
out:
        if (ret == -ENOMEM)
                ret = -EAGAIN;
        return ret;
}


that behavior is linux mlock's behavior for long long time.

Thanks!
2008-09-25 11:09:31 +02:00
Sam Varshavchik 9291ce36fe ffix 2008-09-25 09:50:14 +02:00
Michael Kerrisk ee2c437cd5 update .TH timestamp 2008-09-24 22:50:11 +02:00
Michael Kerrisk c8bd05f909 Add more detail about wrapper functions
Add a few more details about work generally done by wrapper
functions.  Note that syscall(2) performs the same steps.
2008-09-24 16:10:00 +02:00
Michael Kerrisk 314c8ff41d Wording fix 2008-09-23 07:22:43 +02:00
Sam Varshavchik 33fb70ba7c s/it_interval/it_value/ when talking about TIMERFD_ABSTIME (bis). 2008-09-23 07:17:40 +02:00
Sam Varshavchik c3afed740a s/it_interval/it_value/ when talking about TIMERFD_ABSTIME. 2008-09-23 07:07:55 +02:00
Michael Kerrisk e7d807b715 Wording fix. 2008-09-23 06:58:51 +02:00
John Reiser a1d48abb60 Fine tune discussion of getpid() caching bug.
The error by getpid() in the presence of clone() occurs
only for a fork-like clone (one that omits CLONE_VM from the flags.)
This is a low-level detail, but there is no problem [known-to-me]
for thread-like clone().
2008-09-23 06:55:29 +02:00
Michael Kerrisk c60237c9b5 Clarify text describing getpid() caching bug for clone() wrapper.
See also: http://sourceware.org/bugzilla/show_bug.cgi?id=6910
and https://bugzilla.redhat.com/show_bug.cgi?id=417521
2008-09-23 05:04:49 +02:00
Michael Kerrisk 67f0f50d07 Describe getpid()'s PID caching and its consequences.
getpid() caches the PID after the first call.  This relies
on support in the glibc wrappers for fork()/vfork()/clone().
However, if syscall() is used to directly invoke fork()/vfork()/clone(),
the cache is not updated, and getpid() in the child procudes the wrong
result.
2008-09-23 04:12:27 +02:00
Michael Kerrisk 82d2be3d9d > > Additionally, you may want to make a note in the stat/lstat man page that on
> > Linux, lstat(2) will generally not trigger automounter action, whereas
> > stat(2) will.
> 
> I don't understand this last piece.  Can you say some more.  (I'm not
> familiar with automounter details.)
 
An automounter (either an explicit one, like autofs, or an implicit
one, such as are used by AFS or NFSv4) is something that triggers
a mount when something is touched.
 
However, it's undesirable to automount, say, everyone's home
directory just because someone opened up /home in their GUI
browser or typed "ls -l /home".  The early automounters simply
didn't list the contents until you accessed it by name;
this is still the case when you can't enumerate a mapping
(say, all DNS names under /net).  However, this is extremely
inconvenient, too.
 
The solution we ended up settling on is to create something
that looks like a directory (i.e. reports S_IFDIR in stat()),
but behaves somewhat like a symlink.  In particular, when it is
accessed in a way where a symlink would be dereferenced,
the automount triggers and the directory is mounted.  However,
system calls which do *not* cause a symlink to be dereferenced,
like lstat(), also do not cause the automounter to trigger.
This means that "ls -l", or a GUI file browser, can see a list
of directories without causing each one of them to be automounted.
 
        -hpa
2008-09-10 10:40:01 +00:00
Michael Kerrisk 67da52673e Start new sentence on new source line. 2008-09-10 03:45:09 +00:00
Michael Kerrisk eeeffe2d3b grfix 2008-09-10 03:41:35 +00:00
Michael Kerrisk 86d89e4c89 Add more detail in mount options that prevent updates to atime. 2008-09-09 05:25:25 +00:00
Michael Kerrisk e21a7c25fe s/filesystem/file system/ 2008-09-09 05:13:34 +00:00
Michael Kerrisk 614aae4105 Add "512B" to comment for st_blocks 2008-09-09 05:12:17 +00:00
Michael Kerrisk 5b0dc1baed s/time zone/timezone/ for consistency across pages and with POSIX.1. 2008-09-07 04:17:25 +00:00
Michael Kerrisk 057dce78b1 Move description of negative l_len from NOTES, integrating
it into the discussion of file locking.
Minor rewrites of the text on file locking.
2008-09-05 12:23:14 +00:00
Michael Kerrisk 68e0696a74 More clearly and consistently describe the whether or not the third
argument to fnctl() is required, and what its type should be.
2008-09-05 11:46:06 +00:00
Michael Kerrisk 435ecb8e42 Update kernel version numbers relating to real-time support. 2008-09-05 06:11:29 +00:00
Michael Kerrisk fca860f5c5 Remove old sentence about where to send updates for this page. 2008-09-02 09:06:49 +00:00
Michael Kerrisk ec113208a5 tfix 2008-09-02 09:05:17 +00:00
Michael Kerrisk 0f200f076c Add/fix feature test macro requirements. 2008-08-29 15:50:13 +00:00
Michael Kerrisk 0302f1019a SEE ALSO: Add clock(3), clock_gettime(3). 2008-08-28 11:16:36 +00:00
Michael Kerrisk 835363b211 NOTES: Add text mention the shell 'ulimit' (or 'limit')
built-in command for setting resource limits.
2008-08-26 04:19:07 +00:00
Michael Kerrisk 2c0cfe3ccc grfix 2008-08-26 04:11:43 +00:00
Michael Kerrisk effee74c4b Remove FIXME 2008-08-21 08:45:05 +00:00
Michael Kerrisk 491cd2f039 spfix 2008-08-21 07:00:26 +00:00
Michael Kerrisk 5144e45f51 These interfaces are specified in POSIX.1-2008. 2008-08-21 06:16:15 +00:00
Michael Kerrisk 5db9708db3 CONFORMING TO: POSIX.1-2008 specifies utimensat() and futimens(). 2008-08-21 06:05:08 +00:00
Michael Kerrisk f428c08ac0 CONFORMING TO: POSIX.1-2008 marks gettimeofday() as obsolete. 2008-08-21 06:01:46 +00:00
Michael Kerrisk e1146d332c F_DUPFD_CLOEXEC is specified in POSIX.1-2008. 2008-08-21 05:15:16 +00:00
Michael Kerrisk aaec1423d7 Add FIXME 2008-08-21 05:11:22 +00:00
Michael Kerrisk 115e8dca06 Add a reference to linkat(2) for an interface that allows
precise control of the treatment of symbolic links.
2008-08-21 04:54:14 +00:00
Michael Kerrisk 08a3addfa4 O_CLOEXEC is specified in POSIX.1-2008. 2008-08-21 04:51:54 +00:00
Michael Kerrisk 1f8f8acb44 grfix 2008-08-21 04:44:02 +00:00
Michael Kerrisk e2067e32d7 Note kernel version where Linux stopped following symbolic
links in 'oldpath'; see also http://lwn.net/Articles/294667.
POSIX.1-2008 makes it implementation-dependent whether or not
'oldpath' is dereferenced if it is a symbolic link.
2008-08-21 04:38:03 +00:00
Michael Kerrisk c368e7ca76 Add kernel version numbers for MAP_32BIT.
Add some details on MAP_32BIT (see http://lwn.net/Articles/294642).
2008-08-21 04:14:14 +00:00
Michael Kerrisk 1d0ab60002 grfix 2008-08-20 19:45:18 +00:00
Michael Kerrisk cc40d64d21 ffix 2008-08-19 18:07:03 +00:00
Michael Kerrisk 2269e87064 s/d/domain/ for name of argument.
Add reference to socket(2) for further information on
domain, type, and protocol arguments.
2008-08-19 14:34:48 +00:00
Michael Kerrisk 20e5fb78ea When an eventfd overflows, select() indicates the file as both
readable and writable (not as having an exceptional condition).
2008-08-18 11:09:15 +00:00
Michael Kerrisk 43be23955e SEE ALSO: remove duplicate entry. 2008-08-18 06:19:19 +00:00
Michael Kerrisk adfbcbebf0 Add reference to numa(7) for information on library support.
Added  a VERSIONS section.
SEE ALSO: Add numa(7).
2008-08-13 08:20:30 +00:00
Michael Kerrisk 69f06e4f98 Add reference to numa(7) for information on library support.
Added  a VERSIONS section.
SEE ALSO: Add numa(7).
2008-08-13 08:19:47 +00:00