Print this page
10067 Miscellaneous man page typos
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Volker A. Brandt <vab@bb-c.de>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/pthread_rwlock_timedwrlock.3c
+++ new/usr/src/man/man3c/pthread_rwlock_timedwrlock.3c
1 1 .\"
2 2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 3 .\" permission to reproduce portions of its copyrighted documentation.
4 4 .\" Original documentation from The Open Group can be obtained online at
5 5 .\" http://www.opengroup.org/bookstore/.
6 6 .\"
7 7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 8 .\" Group, have given us permission to reprint portions of their
9 9 .\" documentation.
10 10 .\"
11 11 .\" In the following statement, the phrase ``this text'' refers to portions
12 12 .\" of the system documentation.
13 13 .\"
14 14 .\" Portions of this text are reprinted and reproduced in electronic form
15 15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 16 .\" Standard for Information Technology -- Portable Operating System
17 17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 20 .\" between these versions and the original IEEE and The Open Group
21 21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 22 .\" document. The original Standard can be obtained online at
23 23 .\" http://www.opengroup.org/unix/online.html.
24 24 .\"
25 25 .\" This notice shall appear on any product containing this material.
26 26 .\"
27 27 .\" The contents of this file are subject to the terms of the
28 28 .\" Common Development and Distribution License (the "License").
29 29 .\" You may not use this file except in compliance with the License.
30 30 .\"
31 31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 32 .\" or http://www.opensolaris.org/os/licensing.
33 33 .\" See the License for the specific language governing permissions
34 34 .\" and limitations under the License.
35 35 .\"
36 36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 38 .\" If applicable, add the following below this CDDL HEADER, with the
39 39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 41 .\"
42 42 .\"
43 43 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
44 44 .\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
45 45 .\"
46 46 .TH PTHREAD_RWLOCK_TIMEDWRLOCK 3C "Jan 30, 2004"
47 47 .SH NAME
48 48 pthread_rwlock_timedwrlock, pthread_rwlock_reltimedwrlock_np \- lock a
49 49 read-write lock for writing
50 50 .SH SYNOPSIS
51 51 .LP
52 52 .nf
53 53 cc \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
54 54 #include <pthread.h>
55 55 #include <time.h>
56 56
57 57 \fBint\fR \fBpthread_rwlock_timedwrlock\fR(\fBpthread_rwlock_t *restrict\fR \fIrwlock\fR,
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
58 58 \fBconst struct timespec *restrict\fR \fIabs_timeout\fR);
59 59 .fi
60 60
61 61 .LP
62 62 .nf
63 63 \fBint\fR \fBpthread_rwlock_reltimedwrlock_np\fR(\fBpthread_rwlock_t *restrict\fR \fIrwlock\fR,
64 64 \fBconst struct timespec *restrict\fR \fIrel_timeout\fR);
65 65 .fi
66 66
67 67 .SH DESCRIPTION
68 -.sp
69 68 .LP
70 69 The \fBpthread_rwlock_timedwrlock()\fR function applies a write lock to the
71 70 read-write lock referenced by \fIrwlock\fR as in the
72 71 \fBpthread_rwlock_wrlock\fR(3C) function. If the lock cannot be acquired
73 72 without waiting for other threads to unlock the lock, this wait will be
74 73 terminated when the specified timeout expires. The timeout expires when the
75 74 absolute time specified by \fIabs_timeout\fR passes, as measured by the
76 75 \fBCLOCK_REALTIME\fR clock (that is, when the value of that clock equals or
77 76 exceeds \fIabs_timeout\fR), or if the absolute time specified by
78 77 \fIabs_timeout\fR has already been passed at the time of the call.
79 78 .sp
80 79 .LP
81 80 The \fBpthread_rwlock_reltimedwrlock_np()\fR function is identical to the
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
82 81 \fBpthread_rwlock_timedwrlock()\fR function, except that the timeout is
83 82 specified as a relative time interval. The timeout expires when the time
84 83 interval specified by \fIrel_timeout\fR passes, as measured by the
85 84 \fBCLOCK_REALTIME\fR clock, or if the time interval specified by
86 85 \fIrel_timeout\fR is negative at the time of the call.
87 86 .sp
88 87 .LP
89 88 The resolution of the timeout is the resolution of the \fBCLOCK_REALTIME\fR
90 89 clock. The \fBtimespec\fR data type is defined in the <\fBtime.h\fR> header.
91 90 Under no circumstances does either function fail with a timeout if the lock can
92 -be acquired immediately. The validity of the a\fIbs_timeout\fR parameter need
91 +be acquired immediately. The validity of the \fIabs_timeout\fR parameter need
93 92 not be checked if the lock can be immediately acquired.
94 93 .sp
95 94 .LP
96 95 If a signal that causes a signal handler to be executed is delivered to a
97 96 thread blocked on a read- write lock with a call to
98 97 \fBpthread_rwlock_timedwrlock()\fR or \fBpthread_rwlock_reltimedwrlock_np()\fR,
99 98 upon return from the signal handler the thread resumes waiting for the lock as
100 99 if it was not interrupted.
101 100 .sp
102 101 .LP
103 102 The calling thread can deadlock if at the time the call is made it holds the
104 103 read-write lock. The results are undefined if this function is called with an
105 104 uninitialized read-write lock.
106 105 .SH RETURN VALUES
107 -.sp
108 106 .LP
109 107 The \fBpthread_rwlock_timedwrlock()\fR and
110 108 \fBpthread_rwlock_reltimedwrlock_np()\fR functions return 0 if the lock for
111 109 writing on the read-write lock object referenced by \fIrwlock\fR is acquired.
112 110 Otherwise, an error number is returned to indicate the error.
113 111 .SH ERRORS
114 -.sp
115 112 .LP
116 113 The \fBpthread_rwlock_timedwrlock()\fR and
117 114 \fBpthread_rwlock_reltimedwrlock_np()\fR functions will fail if:
118 115 .sp
119 116 .ne 2
120 117 .na
121 118 \fB\fBETIMEDOUT\fR\fR
122 119 .ad
123 120 .RS 13n
124 121 The lock could not be acquired before the specified timeout expired.
125 122 .RE
126 123
127 124 .sp
128 125 .LP
129 126 The \fBpthread_rwlock_timedwrlock()\fR and
130 127 \fBpthread_rwlock_reltimedwrlock_np()\fR functions may fail if:
131 128 .sp
132 129 .ne 2
133 130 .na
134 131 \fB\fBEDEADLK\fR\fR
135 132 .ad
136 133 .RS 11n
137 134 The calling thread already holds the rwlock.
138 135 .RE
139 136
140 137 .sp
141 138 .ne 2
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
142 139 .na
143 140 \fB\fBEINVAL\fR\fR
144 141 .ad
145 142 .RS 11n
146 143 The value specified by \fIrwlock\fR does not refer to an initialized read-write
147 144 lock object, or the timeout nanosecond value is less than zero or greater than
148 145 or equal to 1,000 million.
149 146 .RE
150 147
151 148 .SH ATTRIBUTES
152 -.sp
153 149 .LP
154 150 See \fBattributes\fR(5) for descriptions of the following attributes:
155 151 .sp
156 152
157 153 .sp
158 154 .TS
159 155 box;
160 156 c | c
161 157 l | l .
162 158 ATTRIBUTE TYPE ATTRIBUTE VALUE
163 159 _
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
164 160 Interface Stability See below.
165 161 _
166 162 MT-Level MT-Safe
167 163 .TE
168 164
169 165 .sp
170 166 .LP
171 167 The \fBpthread_rwlock_timedwrlock()\fR function is Standard. The
172 168 \fBpthread_rwlock_reltimedwrlock_np()\fR function is Stable.
173 169 .SH SEE ALSO
174 -.sp
175 170 .LP
176 171 \fBpthread_rwlock_destroy\fR(3C), \fBpthread_rwlock_rdlock\fR(3C),
177 172 \fBpthread_rwlock_timedrdlock\fR(3C), \fBpthread_rwlock_trywrlock\fR(3C),
178 173 \fBpthread_rwlock_unlock\fR(3C), \fBpthread_rwlock_wrlock\fR(3C),
179 174 \fBattributes\fR(5), \fBstandards\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX