remove csh(1)
[unleashed.git] / share / man / man3c / thr_getprio.3c
blobe695527bbdbab7aad0d46e661ac36bf688b45942
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) 1995 IEEE.  All Rights Reserved.
44 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
45 .\" Portions Copyright (c) 2001 Sun Microsystems, Inc.  All Rights Reserved
46 .\"
47 .TH THR_GETPRIO 3C "Apr 1, 2008"
48 .SH NAME
49 thr_getprio, thr_setprio \- access dynamic thread scheduling
50 .SH SYNOPSIS
51 .LP
52 .nf
53 cc -mt [ \fIflag\fR... ] \fIfile\fR...[ \fIlibrary\fR... ]
54 #include <thread.h>
56 \fBint\fR \fBthr_setprio\fR(\fBthread_t\fR \fItarget_thread\fR, \fBint\fR \fIpriority\fR);
57 .fi
59 .LP
60 .nf
61 \fBint\fR \fBthr_getprio\fR(\fBthread_t\fR \fItarget_thread\fR, \fBint *\fR\fIpriority\fR);
62 .fi
64 .SH DESCRIPTION
65 .sp
66 .LP
67 The \fBthr_setprio()\fR function sets the scheduling priority for the thread
68 specified by target_thread within the current process to the value given by
69 priority.
70 .sp
71 .LP
72 The \fBthr_getprio()\fR function stores the current priority for the thread
73 specified by \fItarget_thread\fR in the location pointed to by \fIpriority\fR.
74 .sp
75 .LP
76 If the \fBthr_setprio()\fR function fails, the scheduling priority of the
77 target thread is not changed.
78 .sp
79 .LP
80 See \fBpriocntl\fR(2), \fBpthread_setschedprio\fR(3C), and
81 \fBsched_setparam\fR(3C).
82 .SH RETURN VALUES
83 .sp
84 .LP
85 If successful, the \fBthr_getprio()\fR and \fBthr_setprio()\fR functions return
86 \fB0\fR. Otherwise, an error number is returned to indicate the error.
87 .SH ERRORS
88 .sp
89 .LP
90 The \fBthr_getprio()\fR and \fBthr_setprio()\fR functions will fail if:
91 .sp
92 .ne 2
93 .na
94 \fB\fBESRCH\fR\fR
95 .ad
96 .RS 9n
97 The value specified by \fItarget_thread\fR does not refer to an existing
98 thread.
99 .RE
103 The  \fBthr_setprio()\fR function will fail if:
105 .ne 2
107 \fB\fBEINVAL\fR\fR
109 .RS 10n
110 The value of \fIpriority\fR is invalid for the scheduling policy of the
111 specified thread.
115 .ne 2
117 \fB\fBEPERM\fR\fR
119 .RS 10n
120 The caller does not have the appropriate permission to set the priority to the
121 value specified.
124 .SH ATTRIBUTES
127 See \fBattributes\fR(5) for descriptions of the following attributes:
132 box;
133 c | c
134 l | l .
135 ATTRIBUTE TYPE  ATTRIBUTE VALUE
137 MT-Level        MT-Safe
140 .SH SEE ALSO
143 \fBpriocntl\fR(2), \fBpthread_setschedprio\fR(3C), \fBsched_setparam\fR(3C),
144 \fBthr_create\fR(3C), \fBthr_suspend\fR(3C), \fBthr_yield\fR(3C),
145 \fBattributes\fR(5), \fBstandards\fR(5)