Commit Graph

4975 Commits

Author SHA1 Message Date
Michael Kerrisk d0cb7cc649 grfix: s/null terminated string/null-terminated string/ 2008-09-26 07:13:25 +02:00
Michael Kerrisk f9db4400fd ctime.3: clarify mktime()'s use of tm_isdst
Describe use of tm_isdst for input to mktime();
explain how mktime() modifies this field.
(This field is left unchanged in case of error.)

Reported-by: Eugene V. Lyubimkin <jackyf.devel@gmail.com>
Debian bug 500178
2008-09-26 06:48:22 +02:00
Michael Kerrisk ef38dda012 ctime.3 Minor rewording
Clarify wording for ctime_r() and asctime_r() to indicate that
the bffer must be at least 26 *bytes*.
2008-09-26 06:05:54 +02:00
Michael Kerrisk 9ef659a9a8 ctime.3: minor rewording of mktime() description. 2008-09-26 06:02:10 +02:00
Michael Kerrisk 8fe528b35b ffix 2008-09-26 05:02:12 +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
Michael Kerrisk 63e3731b2c tstamp 2008-09-25 11:11:08 +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
André Goddard Rosa 7b80ee9bff strcpy.3: Avoid redundantly filling the position 'n - 1' two times in strncpy() example code
When we use 'strncpy(buf, str, n)', strncpy() will fill chars from 0..(n - 1).
As we force the character at position 'n - 1' to be '\0' anyway, don't fill
it in strncpy() before.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-09-25 10:12:33 +02:00
André Goddard Rosa ed7bbec7a5 hsearch.3: Call hdestroy() after using hash table created by hcreate(), for the sake of completeness
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-09-25 10:02:19 +02:00
Sam Varshavchik 9291ce36fe ffix 2008-09-25 09:50:14 +02:00
Michael Kerrisk 3fb3dc3c07 Fix line-wrapped URLs
Some long URLs were line wrapped, preventing scripts that
produce HTML versions of the changelog from turning
them into proper hyperlinks.
2008-09-24 23:40:28 +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 c892873d1a Delete old versions of .Announce and .lsm 2008-09-24 16:08:28 +02:00
Michael Kerrisk 6fcbd98a98 Start of man-pages-3.11: updating Changes and Changes.old 2008-09-24 15:44:24 +02:00
Michael Kerrisk f0463c342b Start of man-pages-3.11: updating .Announce and .lsm files 2008-09-24 15:44:24 +02:00
Michael Kerrisk 116227e960 Start of man-pages-3.11: renaming .Announce and .lsm files 2008-09-24 15:44:23 +02:00
Michael Kerrisk da36d65be4 Ready for 3.10 2008-09-23 15:52:08 +02:00
Michael Kerrisk 71c48553a1 Removed trailing white space at end of lines 2008-09-23 15:51:25 +02:00
Michael Kerrisk 0e22ac924e Expanded tabs 2008-09-23 15:51:17 +02:00
Michael Kerrisk 3fe44d51dd Tweak check of 'val' after tsearch() call. 2008-09-23 15:38:33 +02:00
Michael Kerrisk 12a29fd650 Remove unused sections 2008-09-23 15:06:28 +02:00
Michael Kerrisk cf21356ddf Update timestamp 2008-09-23 15:05:49 +02:00
Michael Kerrisk 7b1f4b14ba Wording fix. 2008-09-23 11:45:57 +02:00
Michael Kerrisk c3ea9f2ded Can't use comma instead of slash to separate port and protocol.
Remove crufty text about use of comma instead of slash to separate
port and protocol.  It's not true as at glibc 2.8, and it's not
clear if/when it was ever true.
2008-09-23 11:20:21 +02:00
Michael Kerrisk afeb98dc09 Update changes to protocols.5 and services.5 2008-09-23 10:59:20 +02:00
Michael Kerrisk d394fbfcd7 Remove refs to noonexisent docs.
Remove SEE ALSO references to nonexistent Guides to Yellow Pages
and Bind/Hesiod docs.
2008-09-23 10:56:51 +02:00
Michael Kerrisk 91924ca616 Minor wording and orthography fixes. 2008-09-23 10:51:43 +02:00
Michael Kerrisk a2610398b8 Remove some bugs, that no longer seen to be true in glibc 2.8. 2008-09-23 10:46:24 +02:00
Michael Kerrisk 837f7a82d3 Wording and grammar fixes 2008-09-23 10:19:32 +02:00
George Spelvin 7134d7e62c Clarify closedir()'s treatment of underlying file descriptor.
At the end of the paragraph in opendir(3) describing fdopendir(), I
think it's worth adding "The file descriptor will be closed when
closedir() is called."  It's a bit ambiguous if the file descriptor
is closed or "given back" at closedir time.

(I've tested this and verified that it's true, BTW.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-09-23 08:55:50 +02:00
Michael Kerrisk 6dea120e68 Fix 'dir' argument name: should be 'dirp'.
POSIX.1-2008 and glibc call this argument 'dirp' (consistent
with the fact that it is a *pointer* to a DIR structure).
2008-09-23 08:45:52 +02:00
Michael Kerrisk 998ad4a620 Note changes to tsearch.3 in changelog. 2008-09-23 08:26:05 +02:00
Michael Kerrisk 2390bfe8fd Add feature test macro to example program
tdestroy() needs _GNU_SOURCE.
2008-09-23 08:22:22 +02:00
André Goddard Rosa 6fa5dff6b4 tsearch.3: dispose properly of allocated resources in example code
As there are many users who base their own code on these examples,
we should avoid leaking memory when using functions of tsearch() family.
In the provided example, tsearch() leaks memory whenever it tries to
insert a number which was already inserted before.

Also: include use of tdestroy() in example program.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2008-09-23 08:20:29 +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 3e7a52936d Fix 'dir' argument name: should be 'dirp'.
The page formerly used both 'dir' and 'dirp'(!).
POSIX.1-2008 and glibc call this argument 'dirp' (consistent
with the fact that it is a *pointer* to a DIR structure).
2008-09-23 04:25:35 +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
Timothy S. Nelson 59bf85dffc Fix Timothy's name in changelog 2008-09-23 02:10:15 +02:00
Michael Kerrisk 83f25499d3 Set up for start of 3.10 2008-09-23 01:47:28 +02:00
Michael Kerrisk 5071e2eba3 Set up changelogs for start of 3.10 2008-09-23 01:44:36 +02:00
Michael Kerrisk 0743fbdae3 spelling fix 2008-09-23 01:42:50 +02:00
Michael Kerrisk 9ab1bf07fd Rename lsm and Announce file for start of 3.10. 2008-09-23 01:40:42 +02:00