Test for stack alignment.
[glibc.git] / linuxthreads / man / pthread_create.man
bloba94004767a66f23f2d32bc0fbf80f78c02f55290
1 .TH PTHREAD_CREATE 3 LinuxThreads
3 .SH NAME
4 pthread_create \- create a new thread
6 .SH SYNOPSIS
7 #include <pthread.h>
9 int pthread_create(pthread_t * thread, pthread_attr_t * attr, void * (*start_routine)(void *), void * arg);
11 .SH DESCRIPTION
12 !pthread_create! creates a new thread of control that executes
13 concurrently with the calling thread. The new thread applies the
14 function |start_routine| passing it |arg| as first argument. The new
15 thread terminates either explicitly, by calling !pthread_exit!(3),
16 or implicitly, by returning from the |start_routine| function. The
17 latter case is equivalent to calling !pthread_exit!(3) with the result
18 returned by |start_routine| as exit code.
20 The |attr| argument specifies thread attributes to be applied to the
21 new thread. See !pthread_attr_init!(3) for a complete list of thread
22 attributes. The |attr| argument can also be !NULL!, in which case
23 default attributes are used: the created thread is joinable (not
24 detached) and has default (non real-time) scheduling policy.
26 .SH "RETURN VALUE"
27 On success, the identifier of the newly created thread is stored in
28 the location pointed by the |thread| argument, and a 0 is returned. On
29 error, a non-zero error code is returned.
31 .SH ERRORS
32 .TP
33 !EAGAIN!
34 not enough system resources to create a process for the new thread.
35 .TP
36 !EAGAIN!
37 more than !PTHREAD_THREADS_MAX! threads are already active.
39 .SH AUTHOR
40 Xavier Leroy <Xavier.Leroy@inria.fr>
42 .SH "SEE ALSO"
43 !pthread_exit!(3),
44 !pthread_join!(3),
45 !pthread_detach!(3),
46 !pthread_attr_init!(3).