1settaskid(2)                     System Calls                     settaskid(2)
2
3
4

NAME

6       settaskid, gettaskid, getprojid - set or get task or project IDs
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <sys/task.h>
11       #include <unistd.h>
12
13       taskid_t settaskid(projid_t project, int flags);
14
15
16       taskid_t gettaskid(void);
17
18
19       #include <sys/types.h>
20       #include <sys/task.h>
21       #include <unistd.h>
22       #include <project.h>
23
24       projid_t getprojid(void);
25
26

DESCRIPTION

28       The  settaskid() function makes a request of the system to assign a new
29       task ID to the calling process, changing the associated project  ID  to
30       that  specified. The calling process must have sufficient privileges to
31       perform this operation. The flags argument should be either TASK_NORMAL
32       for  a  regular  task,  or  TASK_FINAL, which disallows subsequent set‐
33       taskid() calls by the created task.
34
35
36       The gettaskid() function returns the task ID of the calling process.
37
38
39       The getprojid() function returns the project ID of the calling process.
40

RETURN VALUES

42       Upon successful completion, these functions return the appropriate task
43       or  project  ID. Otherwise, −1 is returned and errno is set to indicate
44       the error.
45

ERRORS

47       The settaskid() function will fail if:
48
49       EACCES    The invoking task was created with the TASK_FINAL flag.
50
51
52       EAGAIN    A resource control limiting the number of tasks  or  LWPs  in
53                 the current project or zone has been exceeded.
54
55                 A resource control on the given project would be exceeded.
56
57
58       EINVAL    The  given  project  ID  is  not  within the valid project ID
59                 range.
60
61
62       EPERM     The {PRIV_PROC_TASKID}  privilege  is  not  asserted  in  the
63                 effective set of the calling process.
64
65

ATTRIBUTES

67       See attributes(5)  for descriptions of the following attributes:
68
69
70
71
72       ┌─────────────────────────────┬─────────────────────────────┐
73       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
74       ├─────────────────────────────┼─────────────────────────────┤
75       │MT-Level                     │Async-Signal-Safe            │
76       └─────────────────────────────┴─────────────────────────────┘
77

SEE ALSO

79       setsid(2), project(4), attributes(5), privileges(5)
80
81
82
83SunOS 5.11                        10 Apr 2007                     settaskid(2)
Impressum