diff options
author | 2008-07-05 08:03:57 +0000 | |
---|---|---|
committer | 2008-07-05 08:03:57 +0000 | |
commit | 11ddadc0fe5e5612f4e632d77c9b84e8b35dba4d (patch) | |
tree | 9ec247d79aa38751f1816ade25e21bdb1a98fded /lib/libpthread/man/pthread_attr_setstack.3 | |
parent | ksh starting as root will refuse to import a PS1 prompt unless it (diff) | |
download | wireguard-openbsd-11ddadc0fe5e5612f4e632d77c9b84e8b35dba4d.tar.xz wireguard-openbsd-11ddadc0fe5e5612f4e632d77c9b84e8b35dba4d.zip |
Add manpage for pthread_attr_[sg]etstack(3)
Correct misnaming in STANDARDS section
ok brad@ otto@
Diffstat (limited to 'lib/libpthread/man/pthread_attr_setstack.3')
-rw-r--r-- | lib/libpthread/man/pthread_attr_setstack.3 | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/lib/libpthread/man/pthread_attr_setstack.3 b/lib/libpthread/man/pthread_attr_setstack.3 new file mode 100644 index 00000000000..f9bf37838f5 --- /dev/null +++ b/lib/libpthread/man/pthread_attr_setstack.3 @@ -0,0 +1,92 @@ +.\" $OpenBSD: pthread_attr_setstack.3,v 1.1 2008/07/05 08:03:57 guenther Exp $ +.\" Manual page derived from TOG's UNIX98 documentation. +.\" +.\" David Leonard, 2000. Public Domain. +.\" +.Dd $Mdocdate: July 5 2008 $ +.Dt PTHREAD_ATTR_SETSTACKADDR 3 +.Os +.Sh NAME +.Nm pthread_attr_setstack , +.Nm pthread_attr_getstack +.Nd set and get stack attributes +.Sh SYNOPSIS +.Fd #include <pthread.h> +.Ft int +.Fn pthread_attr_setstack "pthread_attr_t *attr" "void *stackaddr" "size_t stacksize" +.Ft int +.Fn pthread_attr_getstack "const pthread_attr_t *attr" "void **stackaddr" "size_t *stacksize" +.Sh DESCRIPTION +The functions +.Fn pthread_attr_setstack +and +.Fn pthread_attr_getstack , +respectively, set and get the thread +creation +.Va stackaddr +and +.Va stacksize +attributes in the +.Fa attr +object. +.Pp +The stack attributes specify the area of storage to be used for the +created thread's stack. +The base (lowest addressable byte) of the storage shall be +.Va stackaddr , +and the size of the storage shall be +.Va stacksize +bytes. +The stacksize shall be at least +.Dv PTHREAD_STACK_MIN . +.Sh RETURN VALUES +Upon successful completion, +.Fn pthread_attr_setstack +and +.Fn pthread_attr_getstack +return a value of 0. +Otherwise, an error number is returned to indicate the error. +.Pp +The +.Fn pthread_attr_getstack +function stores the +.Va stackaddr +attribute value in +.Fa stackaddr +and the +.Va stacksize +attribute value in +.Fa stacksize +if successful. +.Sh ERRORS +The +.Fn pthread_attr_setstack +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of +.Fa stacksize +is less than +.Dv PTHREAD_STACK_MIN +or exceeds a system-imposed limit or the value of +.Fa stackaddr +is +.Dv NULL . +.El +.Pp +These functions will not return an error code of +.Bq Er EINTR . +.Sh SEE ALSO +.Xr pthread_attr_init 3 , +.Xr pthread_attr_setdetachstate 3 , +.Xr pthread_attr_setstackaddr 3 , +.Xr pthread_attr_setstacksize 3 , +.Xr pthread_create 3 , +.Xr pthreads 3 +.Sh STANDARDS +.Fn pthread_attr_setstack +and +.Fn pthread_attr_getstack +conform to ISO/IEC 9945-1 ANSI/IEEE +.Pq Dq Tn POSIX +Std 1003.1, 2004 Edition. |