This page contains material moved out of sched_setscheduler(2).
It overwrites a previously existing link file with the same name.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Masanari notes that this is an FAQ for logger(1) and that
Solaris and FreeBSD document this point in syslog(3).
The glibc info page also hides this comment in its source:
Internally, there is also LOG_KERN, but LOG_KERN == 0,
which means if you try to use it here, just selects default.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
(After a suggestion by Vegard Nossum.)
Also made a few other small rewordings to in the initial
paragraph.
Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Many older pages use a handle_error() macro to do simple
error handling from system and library function calls.
Switch these pages to do similar.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Glibc switched to using a POSIX-specified error code for
this error case.
http://bugs.linuxbase.org/show_bug.cgi?id=2375
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Stew Benedict <stewb@linux-foundation.org>
Passing pointer arguments to makecontext() is possible,
but only on some architectures, and with no guarantees
of portability.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504699
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Paul Evans <leonerd@leonerd.org.uk>
The page was a bit fuzzy in describing the return values for
various cases. In particular, it needed to be more explicit
in describing what happens for the "not found" case.
This is an analogous change to the previous change for
getpwnam.3, made after Andreas Henriksson's report.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504787
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The page was a bit fuzzy in describing the return values for
various cases. In particular, it needed to be more explicit
in describing what happens for the "not found" case.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504787
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Andreas Henriksson <andreas@fatal.se>
The page was a bit fuzzy in describing the return values for
various cases. In particular, it needed to be more explicit
in describing what happens for the "not found" case.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504708
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Andreas Henriksson <andreas@fatal.se>
According to POSIX.1-2001, the CLOCK_PROCESS_CPUTIME_ID and
CLOCK_THREAD_CPUTIME_ID clocks should be settable, but
currently they are not.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Rework the text that refers to sched_setscheduler(2) for
a description of the permissions required to change
the scheduling policy and priority.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
On MacOS X at least, pthread_attr_setstacksize(3) can fail
with EINVAL if 'stacksize' is not a multiple of the system
page size. Best to mention this so as to aid people writing
portable programs.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Karsten Weiss <knweiss@gmail.com>
==
From: Karsten Weiss <knweiss@gmail.com>
Date: Fri, Oct 31, 2008 at 3:46 PM
Subject: pthread_create(3) - example bug + problems
[...]
A look in the pthread_set_stacksize man page on Mac revealed that on
Mac the stack size must not only be at least PTHREAD_STACK_MIN...
[...]
...but the new stack size must also be a multiple of the system page
size!
From pthread_attr_setstacksize(3):
pthread_attr_setstacksize() will fail if:
[EINVAL] Invalid value for attr.
[EINVAL] stacksize is less than PTHREAD_STACK_MIN.
!!! [EINVAL] stacksize is not a multiple of the system page size.
See for yourself (PTHREAD_STACK_MIN==8192 on Mac OS X):
$ ./pthread_test -s $((8192*10-1)) a
pthread_attr_setstacksize: Invalid argument
$ ./pthread_test -s $((8192*10)) a
Thread 1: top of stack near 0xb0014f6c; argv_string=a
Joined with thread 1; returned value was A
$ ./pthread_test -s $((8192*10+1)) a
pthread_attr_setstacksize: Invalid argument
The bug is in this part of the code:
/* Allocate memory for pthread_create() arguments */
tinfo = calloc(num_threads, num_threads);
if (tinfo == NULL)
errExit("calloc");
The calloc() line should read like this instead:
tinfo = calloc(num_threads, sizeof(struct thread_info));
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>