pthread_create manpage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Attached is a manpage for pthread_create(3).

--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
troff on top of XML: http://crustytoothpaste.ath.cx/~bmc/code/thwack
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
.\"-
.\" Copyright © 2008 brian m. carlson
.\" 
.\" This is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation: version 2 of the License, dated June
.\" 1991.
.\" 
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\" 
.\" This software is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
.\" General Public License for more details.
.\" 
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, see
.\" <http://creativecommons.org/licenses/GPL/2.0/>
.\"
.\" References:
.\"   SUSv3; FreeBSD 7.0 manpages
.TH PTHREAD_CREATE 3 2008-08-23 "GNU" "Linux Programmer's Manual"
.SH NAME
pthread_create \- create a thread
.SH SYNOPSIS
.B "#include <pthread.h>"

.BI "int pthread_create(pthread_t *" "thread" ", const pthread_attr_t"
.BI "*" "attr" ", void *(*" function ")(void *), void *" arg ");"
.SH DESCRIPTION
.PP
The
.BR pthread_create ()
function creates a new thread using the attributes specified by
.IR attr ,
or, if 
.I attr
is NULL, a default set of attributes.
If
.BR pthread_create ()
completes successfully, the new thread will start executing
.IR function ,
using
.IR arg
as its argument.
It will also store the thread ID in
.IR *thread .
If
.BR pthread_create ()
fails, no thread will be created (and therefore
.IR function
will not be executed), and the value of
.IR *thread
is undefined.
.PP
If
.IR function
returns, it will be as if
.BR pthread_exit (3)
were called with
.IR function 's
return value used as its argument.
This does not apply to the thread in which
.BR main ()
was run; if that thread returns from
.BR main (),
it will be as if
.BR exit (2)
were called with
.BR main ()'s
return value as its argument (in other words, this is the standard occurrence
for returning from
.BR main ()).
.PP
The signal mask and floating-point environment are inherited from the thread
which called this function, although the alternate stack is not.
When it is created, the new thread will have no signals pending.
.SH "RETURN VALUE"
.PP
Upon successful completion,
.BR pthread_create ()
will return 0.
If it fails, it will return an error code.
.SH ERRORS
.TP
.B EAGAIN
There are not enough resources to create a thread, or a system-specific limit on
the number of threads per process would be exceeded.
.TP
.B EINVAL
The attributes in
.IR attr
are invalid.
.TP 
.B EPERM
The process does not have privileges to set scheduling parameters or policy.
.SH "CONFORMING TO"
.PP
POSIX.1-2001.
.SH NOTES
.PP
Error codes are returned, not placed in
.IR errno .
.PP
.BR pthread_create ()
is guaranteed never to return
.IR EINTR .
.SH "SEE ALSO"
.PP
.BR exit (2),
.BR pthread_exit (3),
.BR pthreads (7)

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux