Commit Graph

18590 Commits

Author SHA1 Message Date
Michael Kerrisk 4ba17a6deb clone.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-18 08:45:32 +02:00
Michael Kerrisk 1c6ebc4b4c clone.2: Warn that the clone() wrapper modifies child_stack in the parent
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-17 22:24:49 +02:00
Michael Kerrisk 1874193ebf clone.2: Add NOTES heading
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-17 22:17:26 +02:00
Michael Kerrisk d35f5c3402 clone.2: Note that child_stack can be NULL when using the raw system call
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-17 15:52:54 +02:00
Michael Kerrisk 161fce30ef clone.2: Minor wording fix (in preparation for subsequent patch)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-17 15:51:43 +02:00
Michael Kerrisk 35bf8cb47f clone.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-17 14:47:11 +02:00
Michael Kerrisk ed44de1f5e ld.so.8: Simplify language around conferring capabilities
The statement "conferring permitted or effective capabilities"
to the process is somewhat redundant. Binaries with capabilities
confer capabilities only to those process capability sets, so it's
simpler to just say"confers capabilities to the process".

Reported-by: Yubin Ruan <ablacktshirt@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-13 12:57:09 +02:00
Michael Kerrisk 6e3b05feb5 core.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-12 21:08:37 +02:00
Michael Kerrisk 7629685cc3 core.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-12 21:08:37 +02:00
Michael Kerrisk 03c871367c core.5: Adds some notes on systemd and core dumps
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-12 21:08:37 +02:00
Michael Kerrisk 6c3d8859e6 core.5: Dumps are not produced if core_pattern is empty and core_uses_pid is 0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-11 22:00:09 +02:00
Michael Kerrisk cb1b16309e core.5: SEE ALSO: add coredumpctl(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-11 18:04:42 +02:00
Michael Kerrisk 97839a765d core.5: RLIMIT_CORE is not enforced when piping core dump to a program
Reported-by: Per Böhlin <Per.Bohlin@zenterio.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 22:25:05 +02:00
Michael Kerrisk dca5d444b3 madvise.2: Note fork() and execve() semantics for wipe-on-fork setting
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 21:43:00 +02:00
Michael Kerrisk 292e6c071c fork.2: The MADV_WIPEONFORK setting is preserved in child of fork()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 21:26:53 +02:00
Michael Kerrisk 64f89da83f fork.2: Minor reworking of MADV_WIPEONFORK text
The wipe-on-fork setting is specified on address ranges,
not mappings.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 21:24:06 +02:00
Michael Kerrisk da06433e6d getrlimit.2: Make it clear RLIMIT_NPROC is a limit on current number of processes
https://twitter.com/silentbicycle/status/893849097903505409

Reported-by: Scott Vokes <vokes.s@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 15:48:47 +02:00
Michael Kerrisk 63345f2229 getrlimit.2: Minor rewording
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 15:35:47 +02:00
Jakub Wilk 86be2c9292 proc.5: tfix
Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 15:24:20 +02:00
Michael Kerrisk b8dd62acb3 epoll.7: Note existence of kcmp() KCMP_EPOLL_TFD operation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 11:45:13 +02:00
Yubin Ruan fe03cbd88e shmop.2: Note that return value of shmat() is page-aligned
At the current man page for shmat(2)[1], there is no mentioning
whether the returned memory address of shmat(2) will be page size
aligned or not. As that is quite important to many applications(e.g.,
those that use locks heavily and would like to avoid some locks by
some atomic guarantees provided by the CPU), it would be great to
specify that for Linux.

I walked down the current implementation of shmat(2) in the latest
kernel src and found that shmat(2) does return a page size aligned
memory address:

SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
 -> do_shmat(...)
 -> do_mmap_pgoff(...)
 -> do_mmap(...)
 -> get_unmapped_area(...)
 -> get_area(...) -> offset_in_page(addr)

there is a `offset_in_page(addr)' assertion at the end and if that is
true a -EINVAL would be returned, by which we can be sure that
shmat(2) will return a page size aligned memory address on success[2].

[1]: http://man7.org/linux/man-pages/man2/shmat.2.html
[2]: there is also a `offset_in_page(2)' in get_unmapped_area(...),
but that doesn't lead to -EINVAL...I am not sure whether the logic of
that code is right.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-09 10:26:10 +02:00
Michael Kerrisk b739c378ff shmop.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 23:36:56 +02:00
Michael Kerrisk 98f24fc65c abort.3: SEE ALSO: add assert(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 16:19:58 +02:00
Michael Kerrisk 46dc471b8d abort.3: Starting with glibc 2.27, abort() does not attempt to flush streams
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 16:19:47 +02:00
Michael Kerrisk be98c938b5 sigaction.2: Mention that libc sets the act.sa_restorer field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 14:48:40 +02:00
Michael Kerrisk 3ddb841ebb sigaction.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 14:48:40 +02:00
Michael Kerrisk 7276186d6c sigaction.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 14:48:40 +02:00
Michael Kerrisk 89559e3c1c sigreturn.2: Minor fixes to description of sa_restorer field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 14:48:34 +02:00
Michael Kerrisk cc158fa3ac sigreturn.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 14:30:05 +02:00
Michael Kerrisk d03e0ad324 sigreturn.2: glibc has a simple wrapper for sigreturn() that returns ENOSYS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 13:05:56 +02:00
Fangrui Song 8a3f19c369 pow10.3: tfix
Signed-off-by: Fangrui Song <i@maskray.me>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 10:52:25 +02:00
Michael Kerrisk 56f3b63bea sigaction.2: Rework discussion of SA_SIGINFO handler arguments
Expand and rework the text a little, in particular adding
a reference to sigreturn(2) as a source of further
information about the ucontext argument.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 10:49:36 +02:00
Michael Kerrisk dea3ec0c24 sigreturn.2: Make it a little clearer that a stack frame is created by the kernel
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-08 10:00:26 +02:00
Jakub Wilk e8b9e9a236 sysfs.5: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-05 20:37:09 +02:00
Jakub Wilk e1846db58e statfs.2: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-05 20:36:40 +02:00
Jakub Wilk e40be343f7 mallinfo.3: Fix the example
Remove reference to non-standard "tlpi_hdr.h" and replace calls to
functions that were declared in this header.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-05 20:34:40 +02:00
Michael Kerrisk ff8bc61434 flock.2: Placing an exclusive lock over NFS requires the file is open for writing
Reported-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 15:28:59 +02:00
Michael Kerrisk 3b53a603c4 flock.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 15:28:30 +02:00
Michael Kerrisk 657a14bfa0 flock.2: Break NFS details int two separate paragraphs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 15:23:53 +02:00
Michael Kerrisk 50bfd0b3e2 flock.2: Move NFS details to a headed subsection
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 15:23:37 +02:00
Michael Kerrisk 2050975ecc setlocale.3: The standards do not specify all of the locale categories
Reported-by: Křištof Želechovski <giecrilj@stegny.2a.pl>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 15:23:37 +02:00
Michael Kerrisk b0ea1ea30d prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 14:25:47 +02:00
Michael Kerrisk 4c3e123384 splice.2: Since Linux 2.6.31,'fd_in' and 'fd_out' may both refer to pipes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-10-03 14:13:56 +02:00
Michael Kerrisk bf3e64ce7c mremap.2: Update timestamp: review of new BUGS by Michal Hocko and Mike Kravetz
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 23:38:35 +02:00
Michael Kerrisk 46f2cf80f4 pthread_yield.3: pthread_yield() is intended for use with real-time scheduling policies
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 22:46:28 +02:00
Michael Kerrisk 9ce1d9202d sched_yield.2: sched_yield() is intended for use with real-time scheduling policies
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 22:43:30 +02:00
Michael Kerrisk 454f90d7b7 backtrace.3: Minor tweaks to Stefan Puiu's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 20:36:55 +02:00
Stefan Puiu ca5d5169cb backtrace_symbols_fd() can trigger a call to malloc()
Currently, the backtrace(3) manual page says this about backtrace_symbols_fd():

back‐
       trace_symbols_fd() does not call malloc(3), and so can be
employed in situations where the latter function might fail.

However, I watched a video of a presentation about signal handling and
the speaker was saying that calling backtrace() can trigger a call to
malloc - indirectly. That happens because the backtrace*() functions
are part of libgcc, which gets dynamically loaded whenever needed;
dynamic loading would, in turn, trigger a malloc. The talk can be
found here: http://free-electrons.com/pub/video/2008/ols/ols2008-gilad-ben-yossef-fault-handlers.ogg

I decided to test it out, and it seems that this is still true (at
least on Ubuntu 12.04). I compiled the attached program (I used
CXXFLAGS = '-Wall -g -std=c++0x', the -std= part is not really needed)
and ran it through gdb, putting a breakpoint on the line where
backtrace is called. When that breakpoint is hit, I set a breakpoint
on malloc, continued and voila:

Breakpoint 2, __GI___libc_malloc (bytes=36) at malloc.c:2910
2910    malloc.c: No such file or directory.
(gdb) bt
"/lib/x86_64-linux-gnu/libgcc_s.so.1") at dl-load.c:162
"libgcc_s.so.1", type=2, trace_mode=0, mode=-1879048191,
nsid=<optimized out>) at dl-load.c:2473
errstring=0x7fffffffdd00, mallocedp=0x7fffffffdd0f,
operate=0x7ffff7ded700 <dl_open_worker>, args=0x7fffffffdcb0) at
dl-error.c:178
"libgcc_s.so.1", mode=-2147483647, caller_dlopen=0x7ffff7b260a9,
nsid=-2, argc=1, argv=<optimized out>, env=0x7fffffffe068) at
dl-open.c:639
errstring=0x7fffffffded0, mallocedp=0x7fffffffdeef,
operate=0x7ffff7b4bc20 <do_dlopen>, args=0x7fffffffdeb0) at
dl-error.c:178
operate=0x7ffff7b4bc20 <do_dlopen>) at dl-libc.c:48
out>) at dl-libc.c:165
../sysdeps/x86_64/../ia64/backtrace.c:104

Reviewed-by: Walter Harms <wharms@bfs.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 20:32:23 +02:00
Michael Kerrisk 76f23c9448 pthread_detach.3: Improve sentence describing freeing of resources on process termination
As reported by Rahul, the existing sentence could be read as
meaning that resources of joined and terminated detached
threads are freed at only at process termination. Eliminate
that possible misreading.

Reported-by: Rahul Bedarkar <rpal143@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 18:24:22 +02:00
Michael Kerrisk 5c6f8de052 open.2: ERRORS: document EINVAL error for invalid filename
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-29 11:40:03 +02:00