1.\" $NetBSD: pthread_condattr.3,v 1.9 2012/11/03 09:20:36 wiz Exp $ 2.\" 3.\" Copyright (c) 2002 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 14.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 15.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 17.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23.\" POSSIBILITY OF SUCH DAMAGE. 24.\" 25.\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>. 26.\" All rights reserved. 27.\" 28.\" Redistribution and use in source and binary forms, with or without 29.\" modification, are permitted provided that the following conditions 30.\" are met: 31.\" 1. Redistributions of source code must retain the above copyright 32.\" notice(s), this list of conditions and the following disclaimer as 33.\" the first lines of this file unmodified other than the possible 34.\" addition of one or more copyright notices. 35.\" 2. Redistributions in binary form must reproduce the above copyright 36.\" notice(s), this list of conditions and the following disclaimer in 37.\" the documentation and/or other materials provided with the 38.\" distribution. 39.\" 40.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 41.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE 44.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 45.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 46.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 47.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 48.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 49.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 50.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" 52.\" $FreeBSD: src/lib/libpthread/man/pthread_condattr.3,v 1.10 2002/09/16 19:29:28 mini Exp $ 53.Dd November 2, 2012 54.Dt PTHREAD_CONDATTR 3 55.Os 56.Sh NAME 57.Nm pthread_condattr_init 58.Nd condition attribute operations 59.Sh LIBRARY 60.Lb libpthread 61.Sh SYNOPSIS 62.In pthread.h 63.Ft int 64.Fn pthread_condattr_init "pthread_condattr_t *attr" 65.Ft int 66.Fn pthread_condattr_setclock "pthread_condattr_t *attr" "clockid_t clock" 67.Ft int 68.Fn pthread_condattr_destroy "pthread_condattr_t *attr" 69.Sh DESCRIPTION 70Condition attribute objects are used to specify parameters to the 71.Xr pthread_cond_init 3 72function. 73The 74.Fn pthread_condattr_init 75function initializes a condition attribute object with the default attributes 76and the 77.Fn pthread_condattr_destroy 78function destroys a condition attribute object. 79The 80.Fn pthread_condattr_setclock 81function sets the system clock to be used for time comparisons to 82the one specified in 83.Fa clock . 84Valid clock values are 85.Dv CLOCK_MONOTONIC 86and 87.Dv CLOCK_REALTIME 88(the default). 89.Sh RETURN VALUES 90If successful, these functions return 0. 91Otherwise, an error number is returned to indicate the error. 92.Sh ERRORS 93No errors are defined for 94.Fn pthread_condattr_init . 95.Pp 96The 97.Fn pthread_condattr_destroy 98function may fail if: 99.Bl -tag -width Er 100.It Bq Er EINVAL 101The value specified by 102.Fa attr 103is invalid. 104.El 105.Sh SEE ALSO 106.Xr pthread_cond_init 3 107.Sh STANDARDS 108Both functions conform to 109.St -p1003.1-2001 . 110.Sh CAVEATS 111The usefulness of the functions is questionable as the 112.Nx 113implementation does not support any non-default attributes. 114These functions do not conform to the 115.St -p1003.1-2008 116revision of the standard, which mandates two additional attributes, 117the clock attribute and the process-shared attribute. 118