nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / pthread_condattr_getclock.3c
blobd29a1074cbfa3529b162afba5f2267d0d88a5d3b
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
45 .\"
46 .TH PTHREAD_CONDATTR_GETCLOCK 3C "Jan 30, 2004"
47 .SH NAME
48 pthread_condattr_getclock, pthread_condattr_setclock \- get and set the clock
49 selection condition variable attribute
50 .SH SYNOPSIS
51 .LP
52 .nf
53 cc \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
54 #include <pthread.h>
56 \fBint\fR \fBpthread_condattr_getclock\fR(
57      \fBconst pthread_condattr_t *restrict\fR \fIattr\fR,
58      \fBclockid_t *restrict\fR \fIclock_id\fR);
59 .fi
61 .LP
62 .nf
63 \fBint\fR \fBpthread_condattr_setclock\fR(\fBpthread_condattr_t *\fR\fIattr\fR
64       \fBclockid_t\fR \fIclock_id\fR);
65 .fi
67 .SH DESCRIPTION
68 .sp
69 .LP
70 The \fBpthread_condattr_getclock()\fR function obtains the value of the clock
71 attribute from the attributes object referenced by \fIattr\fR. The
72 \fBpthread_condattr_setclock()\fR function sets the clock attribute in an
73 initialized attributes object referenced by \fIattr\fR. If
74 \fBpthread_condattr_setclock()\fR is called with a \fIclock_id\fR argument that
75 refers to a CPU-time clock, the call fails.
76 .sp
77 .LP
78 The clock attribute is the clock ID of the clock that is used to measure the
79 timeout service of \fBpthread_cond_timedwait\fR(3C). The default value of the
80 clock attribute refers to the system clock.
81 .SH RETURN VALUES
82 .sp
83 .LP
84 Upon successful completion, the \fBpthread_condattr_getclock()\fR function
85 returns 0 and stores the value of the clock attribute of \fIattr\fR into the
86 object referenced by the \fIclock_id\fR argument. Otherwise, an error number is
87 returned to indicate the error.
88 .sp
89 .LP
90 Upon successful completion, the \fBpthread_condattr_setclock()\fR function
91 returns 0. Otherwise, an error number is returned to indicate the error.
92 .SH ERRORS
93 .sp
94 .LP
95 These functions may fail if:
96 .sp
97 .ne 2
98 .na
99 \fB\fBEINVAL\fR\fR
101 .RS 10n
102 The value specified by \fIattr\fR is invalid.
107 The \fBpthread_condattr_setclock()\fR function may fail if:
109 .ne 2
111 \fB\fBEINVAL\fR\fR
113 .RS 10n
114 The value specified by \fIclock_id\fR does not refer to a known clock, or is a
115 CPU-time clock.
118 .SH ATTRIBUTES
121 See \fBattributes\fR(5) for descriptions of the following attributes:
126 box;
127 c | c
128 l | l .
129 ATTRIBUTE TYPE  ATTRIBUTE VALUE
131 Interface Stability     Standard
133 MT-Level        MT-Safe
136 .SH SEE ALSO
139 \fBpthread_cond_init\fR(3C), \fBpthread_cond_timedwait\fR(3C),
140 \fBpthread_condattr_destroy\fR(3C), \fBpthread_condattr_getpshared\fR(3C),
141 \fBpthread_create\fR(3C), \fBpthread_mutex_init\fR(3C), \fBattributes\fR(5),
142 \fBstandards\fR(5)