9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / pthread_mutex_getprioceiling.3c
blob805ec5da50ef091b42b401bcafabec0d48d44629
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 1991, 1992, 1994, The X/Open Company Ltd.
44 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
45 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH PTHREAD_MUTEX_GETPRIOCEILING 3C "Apr 1, 2008"
48 .SH NAME
49 pthread_mutex_getprioceiling, pthread_mutex_setprioceiling \- change priority
50 ceiling of a mutex
51 .SH SYNOPSIS
52 .LP
53 .nf
54 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
55 #include <pthread.h>
57 \fBint\fR \fBpthread_mutex_getprioceiling\fR(\fBconst pthread_mutex_t *restrict\fR \fImutex\fR,
58      \fBint *restrict\fR \fIprioceiling\fR);
59 .fi
61 .LP
62 .nf
63 \fBint\fR \fBpthread_mutex_setprioceiling\fR(\fBpthread_mutex_t *restrict\fR \fImutex\fR,
64      \fBint\fR \fIprioceiling\fR, \fBint *restrict\fR \fIold_ceiling\fR);
65 .fi
67 .SH DESCRIPTION
68 .sp
69 .LP
70 The \fBpthread_mutex_getprioceiling()\fR function returns the current priority
71 ceiling of the mutex.
72 .sp
73 .LP
74 The \fBpthread_mutex_setprioceiling()\fR function either locks the mutex if it
75 is unlocked, or blocks until it can successfully lock the mutex, then it
76 changes the mutex's priority ceiling and releases the mutex. When the change is
77 successful, the previous value of the priority ceiling is returned in
78 \fIold_ceiling\fR. The process of locking the mutex need not adhere to the
79 priority protect protocol.
80 .sp
81 .LP
82 If the \fBpthread_mutex_setprioceiling()\fR function fails, the mutex priority
83 ceiling is not changed.
84 .sp
85 .LP
86 The ceiling value should be drawn from the range of priorities for the
87 \fBSCHED_FIFO\fR policy. When a thread acquires such a mutex, the policy of the
88 thread at mutex acquisition should match that from which the ceiling value was
89 derived (\fBSCHED_FIFO\fR, in this case).    If a thread changes its scheduling
90 policy while holding a ceiling mutex, the  behavior of
91 \fBpthread_mutex_lock()\fR and \fBpthread_mutex_unlock()\fR on this mutex is
92 undefined. See \fBpthread_mutex_lock\fR(3C).
93 .sp
94 .LP
95 The ceiling value should not be treated as a persistent value resident in a
96 \fBpthread_mutex_t\fR that is valid across upgrades of Solaris. The semantics
97 of the actual ceiling value are determined by the existing priority range for
98 the \fBSCHED_FIFO\fR policy, as returned  by the \fBsched_get_priority_min()\fR
99 and \fBsched_get_priority_max()\fR functions (see
100 \fBsched_get_priority_min\fR(3C)) when called on the version of Solaris on
101 which the ceiling value is being utilized.
102 .SH RETURN VALUES
105 Upon successful completion, the \fBpthread_mutex_getprioceiling()\fR and
106 \fBpthread_mutex_setprioceiling()\fR functions return  \fB0\fR. Otherwise, an
107 error number is returned to indicate the error.
108 .SH ERRORS
111 The  \fBpthread_mutex_getprioceiling()\fR and
112 \fBpthread_mutex_setprioceiling()\fR functions may fail if:
114 .ne 2
116 \fB\fBEINVAL\fR\fR
118 .RS 10n
119 The value specified by \fImutex\fR does not refer to a currently existing
120 mutex.
125 The \fBpthread_mutex_setprioceiling()\fR function will fail if:
127 .ne 2
129 \fB\fBEINVAL\fR\fR
131 .RS 10n
132 The mutex was not initialized with its \fIprotocol\fR attribute having the
133 value of \fBPTHREAD_PRIO_PROTECT\fR.
137 .ne 2
139 \fB\fBEINVAL\fR\fR
141 .RS 10n
142 The priority requested by \fIprioceiling\fR is out of range.
146 .ne 2
148 \fB\fBEPERM\fR\fR
150 .RS 10n
151 The caller does not have the privilege to perform the operation.
154 .SH ATTRIBUTES
157 See \fBattributes\fR(5) for descriptions of the following attributes:
162 box;
163 c | c
164 l | l .
165 ATTRIBUTE TYPE  ATTRIBUTE VALUE
167 Interface Stability     Committed
169 MT-Level        MT-Safe
171 Standard        See \fBstandards\fR(5).
174 .SH SEE ALSO
177 \fBpthread_mutex_init\fR(3C), \fBpthread_mutex_lock\fR(3C),
178 \fBsched_get_priority_min\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)