2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH SETTASKID 2 "Apr 10, 2007"
8 settaskid, gettaskid, getprojid \- set or get task or project IDs
12 #include <sys/types.h>
16 \fBtaskid_t\fR \fBsettaskid\fR(\fBprojid_t\fR \fIproject\fR, \fBint\fR \fIflags\fR);
21 \fBtaskid_t\fR \fBgettaskid\fR(\fBvoid\fR);
26 #include <sys/types.h>
31 \fBprojid_t\fR \fBgetprojid\fR(\fBvoid\fR);
37 The \fBsettaskid()\fR function makes a request of the system to assign a new
38 task \fBID\fR to the calling process, changing the associated project \fBID\fR
39 to that specified. The calling process must have sufficient privileges to
40 perform this operation. The \fIflags\fR argument should be either
41 \fBTASK_NORMAL\fR for a regular task, or \fBTASK_FINAL\fR, which disallows
42 subsequent \fBsettaskid()\fR calls by the created task.
45 The \fBgettaskid()\fR function returns the task \fBID\fR of the calling
49 The \fBgetprojid()\fR function returns the project \fBID\fR of the calling
54 Upon successful completion, these functions return the appropriate task or
55 project \fBID\fR. Otherwise, \(mi1 is returned and \fBerrno\fR is set to
60 The \fBsettaskid()\fR function will fail if:
67 The invoking task was created with the \fBTASK_FINAL\fR flag.
76 A resource control limiting the number of tasks or LWPs in the current project
77 or zone has been exceeded.
79 A resource control on the given project would be exceeded.
88 The given project \fBID\fR is not within the valid project \fBID\fR range.
97 The {\fBPRIV_PROC_TASKID\fR} privilege is not asserted in the effective set of
104 See \fBattributes\fR(5) for descriptions of the following attributes:
112 ATTRIBUTE TYPE ATTRIBUTE VALUE
114 MT-Level Async-Signal-Safe
120 \fBsetsid\fR(2), \fBproject\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)