From 6f8b45b15a94afedefe401d9bd01083a63d5da34 Mon Sep 17 00:00:00 2001 From: Marco S Hyman Date: Thu, 15 Jan 2004 23:17:20 +0000 Subject: man pages for thread_yield and pthread_stackseg_np jmc asked for them, now he can make them look pretty --- lib/libpthread/man/Makefile.inc | 4 ++- lib/libpthread/man/pthread_stackseg_np.3 | 50 ++++++++++++++++++++++++++++++++ lib/libpthread/man/pthread_yield.3 | 27 +++++++++++++++++ lib/libpthread/man/pthreads.3 | 10 +++++-- 4 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 lib/libpthread/man/pthread_stackseg_np.3 create mode 100644 lib/libpthread/man/pthread_yield.3 (limited to 'lib/libpthread') diff --git a/lib/libpthread/man/Makefile.inc b/lib/libpthread/man/Makefile.inc index 7aca8757226..5c8773f20f9 100644 --- a/lib/libpthread/man/Makefile.inc +++ b/lib/libpthread/man/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.17 2003/12/23 22:37:03 brad Exp $ +# $OpenBSD: Makefile.inc,v 1.18 2004/01/15 23:17:19 marc Exp $ # $FreeBSD: Makefile.inc,v 1.6 1999/08/28 00:03:02 peter Exp $ # POSIX thread man files @@ -52,8 +52,10 @@ MAN+= \ pthread_setspecific.3 \ pthread_sigmask.3 \ pthread_single_np.3 \ + pthread_stackseg_np.3 \ pthread_suspend_np.3 \ pthread_testcancel.3 \ + pthread_yield.3 \ sem_destroy.3 \ sem_getvalue.3 \ sem_init.3 \ diff --git a/lib/libpthread/man/pthread_stackseg_np.3 b/lib/libpthread/man/pthread_stackseg_np.3 new file mode 100644 index 00000000000..91db0474326 --- /dev/null +++ b/lib/libpthread/man/pthread_stackseg_np.3 @@ -0,0 +1,50 @@ +.\" $OpenBSD: pthread_stackseg_np.3,v 1.1 2004/01/15 23:17:19 marc Exp $ +.\" +.\" PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman +.\" +.Dd January 15, 2004 +.Dt PTHREAD_STACKSEG_NP 3 +.Os +.Sh NAME +.Nm pthread_stackseg_np +.Nd return stack size and location +.Sh SYNOPSIS +.Fd #include +.Fd #include +.Ft int +.Fn pthread_stackseg_np "stack_t *sinfo" +.Sh DESCRIPTION +The +.Fn pthread_stackseg_np +function returns information about the current thread's stack. +A +.Fa stack_t +is the same as a +.Fa struct sigaltstack +[see +.Xr sigaltstack 3 ] +except the +.Fa ss_sp +variable points to the top of the stack instead of the base. +.Sh RETURN VALUES +If successful, the +.Fn pthread_stackseg_np +function will return 0. +Otherwise an error number will be returned to indicate the error. +.Sh ERRORS +The +.Fn pthread_stackseg_np +function will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +Stack information for the current thread is not currently available. +There is no guarantee that the current thread's stack information will ever +become available. +.El +.Sh SEE ALSO +.Xr pthreads 3 , +.Xr sigaltstack 3 +.Sh STANDARDS +.Fn pthread_stackseg_np +is a non-portable extension to +.St -p1003.1-01 . diff --git a/lib/libpthread/man/pthread_yield.3 b/lib/libpthread/man/pthread_yield.3 new file mode 100644 index 00000000000..87803b17d97 --- /dev/null +++ b/lib/libpthread/man/pthread_yield.3 @@ -0,0 +1,27 @@ +.\" $OpenBSD: pthread_yield.3,v 1.1 2004/01/15 23:17:19 marc Exp $ +.\" +.\" PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman +.\" +.Dd January 15, 2004 +.Dt PTHREAD_YIELD 3 +.Os +.Sh NAME +.Nm pthread_yield +.Nd yield control of the current thread +.Sh SYNOPSIS +.Fd #include +.Ft void +.Fn pthread_yield "void" +.Sh DESCRIPTION +The +.Fn pthread_yield +function resets the accumulated time slice of the current thread and then +enters the thread scheduler which resumes execution of the next thread ready +to run. +If no other thread is ready to run control returns to the current thread. +.Sh SEE ALSO +.Xr pthreads 3 +.Sh STANDARDS +.Fn pthread_yield +is a non-portable (but quite common) extension to +.St -p1003.1-01 . diff --git a/lib/libpthread/man/pthreads.3 b/lib/libpthread/man/pthreads.3 index db1011387dd..9061868300a 100644 --- a/lib/libpthread/man/pthreads.3 +++ b/lib/libpthread/man/pthreads.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthreads.3,v 1.22 2004/01/15 11:27:04 jmc Exp $ +.\" $OpenBSD: pthreads.3,v 1.23 2004/01/15 23:17:19 marc Exp $ .\" David Leonard , 1998. Public domain. .Dd August 17, 1998 .Dt PTHREADS 3 @@ -171,6 +171,10 @@ Set the name of a thread. Switch thread scheduling mode. .It Fn pthread_multi_np Switch thread scheduling mode. +.It Fn pthread_stackseg_np +Return stack size and location. +.It Fn pthread_yield +Yield control of the current thread. .El .Ss Read/Write Lock Routines The functions available are as follows: @@ -513,8 +517,10 @@ environment variable. .Xr pthread_setspecific 3 , .Xr pthread_sigmask 3 , .Xr pthread_single_np 3 , +.Xr pthread_stackseg_np 3 , .Xr pthread_suspend_np 3 , -.Xr pthread_testcancel 3 +.Xr pthread_testcancel 3 , +.Xr pthread_yield 3 .Sh STANDARDS The user-level thread library provides functions that conform to ISO/IEC 9945-1 ANSI/IEEE -- cgit v1.2.3