diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:54:44 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:54:44 -0400 |
| commit | a9157ce950dfe2fc30795d43b9d79b9d1bffc48b (patch) | |
| tree | 9df484304b560466d145e662c1c254ff0e9ae0ba /static/openbsd/man3/pthread_condattr_init.3 | |
| parent | 160aa82b2d39c46ad33723d7d909cb4972efbb03 (diff) | |
docs: Added All OpenBSD Manuals
Diffstat (limited to 'static/openbsd/man3/pthread_condattr_init.3')
| -rw-r--r-- | static/openbsd/man3/pthread_condattr_init.3 | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/static/openbsd/man3/pthread_condattr_init.3 b/static/openbsd/man3/pthread_condattr_init.3 new file mode 100644 index 00000000..20be1090 --- /dev/null +++ b/static/openbsd/man3/pthread_condattr_init.3 @@ -0,0 +1,120 @@ +.\" $OpenBSD: pthread_condattr_init.3,v 1.3 2025/06/07 00:16:52 schwarze Exp $ +.\" +.\" Copyright (C) 2000 Jason Evans <jasone@freebsd.org>. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD: pthread_mutexattr.3,v 1.5 2001/07/15 07:53:26 dd Exp $ +.Dd $Mdocdate: June 7 2025 $ +.Dt PTHREAD_CONDATTR_INIT 3 +.Os +.Sh NAME +.Nm pthread_condattr_init , +.Nm pthread_condattr_destroy , +.Nm pthread_condattr_setclock , +.Nm pthread_condattr_getclock +.Nd condition variable attribute operations +.Sh SYNOPSIS +.Lb libpthread +.In pthread.h +.Ft int +.Fn pthread_condattr_init "pthread_condattr_t *attr" +.Ft int +.Fn pthread_condattr_destroy "pthread_condattr_t *attr" +.Ft int +.Fn pthread_condattr_setclock "pthread_condattr_t *attr" "clockid_t clock_id" +.Ft int +.Fn pthread_condattr_getclock "pthread_condattr_t *attr" "clockid_t *clock_id" +.Sh DESCRIPTION +Condition variable attributes are used to specify parameters to +.Fn pthread_cond_init . +One attribute object can be used in multiple calls to +.Fn pthread_cond_init , +with or without modifications between calls. +.Pp +The +.Fn pthread_condattr_init +function initializes +.Fa attr +with all the default condition variable attributes. +.Pp +The +.Fn pthread_condattr_destroy +function destroys +.Fa attr . +.Pp +The +.Fn pthread_condattr_setclock +function sets the clock attribute of +.Fa attr +to the value of the +.Fa clock_id +parameter. +The +.Fn pthread_condattr_getclock +function copies the value of the clock attribute from +.Fa attr +to the location pointed to by the +.Fa clock_id +parameter. +The clock attribute is the ID of the clock against which the timeout of +.Fn pthread_cond_timedwait +is compared; +the default value of the clock attribute is +.Dv CLOCK_REALTIME . +.Sh RETURN VALUES +If successful, these functions return 0. +Otherwise, an error number is returned to indicate the error. +.Sh ERRORS +.Fn pthread_condattr_init +will fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Out of memory. +.El +.Pp +.Fn pthread_condattr_setclock +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value of +.Fa clock_id +is neither +.Dv CLOCK_REALTIME +nor +.Dv CLOCK_MONOTONIC . +.El +.Sh SEE ALSO +.Xr clock_gettime 2 , +.Xr pthread_cond_init 3 +.Sh STANDARDS +.Fn pthread_condattr_init , +.Fn pthread_condattr_destroy , +.Fn pthread_condattr_setclock , +and +.Fn pthread_condattr_getclock +conform to +.St -p1003.1-2008 |
