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>
s/2.6.20/2.6.30/ to fix an earlier typo in the description
of the likely kernel version that will have fully fledged
real-time features.
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>
In particular, note that in each pthreads function that takes
a thread ID argument, that ID by definition refers to a thread
in the same process as the caller.
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>
Add text to CONFORMING TO explaining that the "_np"
suffix is because these functions are non-portable.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Karsten Weiss <K.Weiss@science-computing.de>
EFAULT can't occur for these functions. EINVAL can occur
for invalid 'attr' or 'cpuset' arguments.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
s/\.R " "/\\\&/ as a way of getting a blank line after a .SS heading.
(Suggested by Sam Varshavchik <mrsam@courier-mta.com>)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
For sched_setaffinity(), the EINVAL error that occurs
if 'cpusetsize' is smaller than the kernel CPU set size only
occurs with kernels before 2.6.9.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
So on a direct syscall, the EINVAL could also occur for bufsiz < 0.
But at the moment, the error text is sufficiently vague
("bufsiz is not positive") that a change to the man page text
is probably not needed.
Simply continuing after an error is in most cases wrong,
and can lead to infinite loops (e.g., for EMFILE).
So handle an error by terminating.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504202
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Reported-by: Olaf van der Spek <olafvdspek@gmail.com>