45 lines
1.3 KiB
Groff
45 lines
1.3 KiB
Groff
.TH setprid 2
|
|
.SH NAME
|
|
setprid \- set project ID
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\f3#include <sys/types.h>\f1
|
|
\f3#include <unistd.h>\f1
|
|
.sp .8v
|
|
\f3int setprid(prid_t prid);\f1
|
|
.SH DESCRIPTION
|
|
The \f2setprid\f1 function changes the project ID for the array
|
|
session containing the current process to the value specified by
|
|
\f2prid\f1.
|
|
.PP
|
|
Ordinarily, the project ID for a new array session
|
|
is inherited from the array session of the process that created it.
|
|
However, when the array session is created as part of a new login (or
|
|
moral equivalent, such as a batch job or \f2rsh\f1(1)), it may be
|
|
appropriate to assign a new project ID, such as a default project ID
|
|
associated with the user that is logging in.
|
|
The \f2setprid\f1 function can be used to accomplish this.
|
|
.PP
|
|
The new project ID must be a positive value.
|
|
The process invoking \f2setprid\f1 must have superuser privileges.
|
|
.PP
|
|
For more information on projects and project IDs, see \f2projects\f1(5).
|
|
.SH ERRORS
|
|
\f2setprid\f1 may fail if one or more of these conditions are true:
|
|
.TP 10
|
|
\f3EINVAL\f1
|
|
\f2prid\f1 is negative
|
|
.TP
|
|
\f3EPERM\f1
|
|
The current process does not have superuser privileges.
|
|
.PP
|
|
.SH SEE ALSO
|
|
getprid(2),
|
|
newarraysess(2),
|
|
array_sessions(5),
|
|
projects(5).
|
|
.SH "DIAGNOSTICS"
|
|
Upon successful completion, \f2setprid\f1 returns a value of 0.
|
|
Otherwise, a value of -1 is returned and \f3errno\f1 is set to
|
|
indicate the error.
|