8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / thr_getprio.3c
blobeaf054ae328cee9343e27552243ebc89f6b9345c
1 '\" te
2 .\" Copyright (c) 1995 IEEE  All Rights Reserved.
3 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
4 .\" Portions Copyright (c) 2001 Sun Microsystems, Inc.  All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH THR_GETPRIO 3C "Apr 1, 2008"
13 .SH NAME
14 thr_getprio, thr_setprio \- access dynamic thread scheduling
15 .SH SYNOPSIS
16 .LP
17 .nf
18 cc -mt [ \fIflag\fR... ] \fIfile\fR...[ \fIlibrary\fR... ]
19 #include <thread.h>
21 \fBint\fR \fBthr_setprio\fR(\fBthread_t\fR \fItarget_thread\fR, \fBint\fR \fIpriority\fR);
22 .fi
24 .LP
25 .nf
26 \fBint\fR \fBthr_getprio\fR(\fBthread_t\fR \fItarget_thread\fR, \fBint *\fR\fIpriority\fR);
27 .fi
29 .SH DESCRIPTION
30 .sp
31 .LP
32 The \fBthr_setprio()\fR function sets the scheduling priority for the thread
33 specified by target_thread within the current process to the value given by
34 priority.
35 .sp
36 .LP
37 The \fBthr_getprio()\fR function stores the current priority for the thread
38 specified by \fItarget_thread\fR in the location pointed to by \fIpriority\fR.
39 .sp
40 .LP
41 If the \fBthr_setprio()\fR function fails, the scheduling priority of the
42 target thread is not changed.
43 .sp
44 .LP
45 See \fBpriocntl\fR(2), \fBpthread_setschedprio\fR(3C), and
46 \fBsched_setparam\fR(3C).
47 .SH RETURN VALUES
48 .sp
49 .LP
50 If successful, the \fBthr_getprio()\fR and \fBthr_setprio()\fR functions return
51 \fB0\fR. Otherwise, an error number is returned to indicate the error.
52 .SH ERRORS
53 .sp
54 .LP
55 The \fBthr_getprio()\fR and \fBthr_setprio()\fR functions will fail if:
56 .sp
57 .ne 2
58 .na
59 \fB\fBESRCH\fR\fR
60 .ad
61 .RS 9n
62 The value specified by \fItarget_thread\fR does not refer to an existing
63 thread.
64 .RE
66 .sp
67 .LP
68 The  \fBthr_setprio()\fR function will fail if:
69 .sp
70 .ne 2
71 .na
72 \fB\fBEINVAL\fR\fR
73 .ad
74 .RS 10n
75 The value of \fIpriority\fR is invalid for the scheduling policy of the
76 specified thread.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBEPERM\fR\fR
83 .ad
84 .RS 10n
85 The caller does not have the appropriate permission to set the priority to the
86 value specified.
87 .RE
89 .SH ATTRIBUTES
90 .sp
91 .LP
92 See \fBattributes\fR(5) for descriptions of the following attributes:
93 .sp
95 .sp
96 .TS
97 box;
98 c | c
99 l | l .
100 ATTRIBUTE TYPE  ATTRIBUTE VALUE
102 MT-Level        MT-Safe
105 .SH SEE ALSO
108 \fBpriocntl\fR(2), \fBpthread_setschedprio\fR(3C), \fBsched_setparam\fR(3C),
109 \fBthr_create\fR(3C), \fBthr_suspend\fR(3C), \fBthr_yield\fR(3C),
110 \fBattributes\fR(5), \fBstandards\fR(5)