summaryrefslogtreecommitdiff
path: root/usr/src/man/man3project
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man3project')
-rw-r--r--usr/src/man/man3project/Makefile47
-rw-r--r--usr/src/man/man3project/getprojent.3project320
-rw-r--r--usr/src/man/man3project/project_walk.3project114
-rw-r--r--usr/src/man/man3project/setproject.3project277
4 files changed, 758 insertions, 0 deletions
diff --git a/usr/src/man/man3project/Makefile b/usr/src/man/man3project/Makefile
new file mode 100644
index 0000000000..b163ca689e
--- /dev/null
+++ b/usr/src/man/man3project/Makefile
@@ -0,0 +1,47 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet
+# at http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2011, Richard Lowe
+
+include ../../Makefile.master
+
+MANSECT = 3project
+
+MANFILES = getprojent.3project \
+ project_walk.3project \
+ setproject.3project
+
+
+MANSOFILES = endprojent.3project \
+ fgetprojent.3project \
+ getdefaultproj.3project \
+ getprojbyid.3project \
+ getprojbyname.3project \
+ getprojidbyname.3project \
+ inproj.3project \
+ setprojent.3project
+
+MANFILES += $(MANSOFILES)
+
+endprojent.3project := SOSRC = man3project/getprojent.3project
+fgetprojent.3project := SOSRC = man3project/getprojent.3project
+getdefaultproj.3project := SOSRC = man3project/getprojent.3project
+getprojbyid.3project := SOSRC = man3project/getprojent.3project
+getprojbyname.3project := SOSRC = man3project/getprojent.3project
+getprojidbyname.3project := SOSRC = man3project/getprojent.3project
+inproj.3project := SOSRC = man3project/getprojent.3project
+setprojent.3project := SOSRC = man3project/getprojent.3project
+
+.KEEP_STATE:
+
+include ../Makefile.man
+
+install: $(ROOTMANFILES)
diff --git a/usr/src/man/man3project/getprojent.3project b/usr/src/man/man3project/getprojent.3project
new file mode 100644
index 0000000000..88e36300fb
--- /dev/null
+++ b/usr/src/man/man3project/getprojent.3project
@@ -0,0 +1,320 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getprojent 3PROJECT "5 Apr 2004" "SunOS 5.11" "Project Database Access Library Functions"
+.SH NAME
+getprojent, getprojbyname, getprojbyid, getdefaultproj, inproj,
+getprojidbyname, setprojent, endprojent, fgetprojent \- project database entry
+operations
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag\fR... ] \fIfile\fR... \(milproject [ \fIlibrary\fR... ]
+#include <project.h>
+
+\fBstruct project *\fR\fBgetprojent\fR(\fBstruct project *\fR\fIproj\fR, \fBvoid *\fR\fIbuffer\fR,
+ \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBstruct project *\fR\fBgetprojbyname\fR(\fBconst char *\fR\fIname\fR,
+ \fBstruct project *\fR\fIproj\fR, \fBvoid *\fR\fIbuffer\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBstruct project *\fR\fBgetprojbyid\fR(\fBprojid_t\fR \fIprojid\fR,
+ \fBstruct project *\fR\fIproj\fR, \fBvoid *\fR\fIbuffer\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBstruct project *\fR\fBgetdefaultproj\fR(\fBconst char *\fR\fIusername\fR,
+ \fBstruct project *\fR\fIproj\fR, \fBvoid *\fR\fIbuffer\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBinproj\fR(\fBconst char *\fR\fIusername\fR, \fBconst char *\fR\fIprojname\fR,
+ \fBvoid *\fR\fIbuffer\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBprojid_t\fR \fBgetprojidbyname\fR(\fBconst char *\fR\fIname\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBsetprojent\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBendprojent\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBstruct project *\fR\fBfgetprojent\fR(\fBFILE *\fR\fIf\fR, \fBstruct project *\fR\fIproj\fR,
+ \fBvoid *\fR\fIbuffer\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+These functions are used to obtain entries describing user projects. Entries
+can come from any of the sources for a project specified in the
+\fB/etc/nsswitch.conf\fR file (see \fBnsswitch.conf\fR(4)).
+.sp
+.LP
+The \fBsetprojent()\fR, \fBgetprojent()\fR, and \fBendprojent()\fR functions
+are used to enumerate project entries from the database.
+.sp
+.LP
+The \fBsetprojent()\fR function effectively rewinds the project database to
+allow repeated searches. It sets (or resets) the enumeration to the beginning
+of the set of project entries. This function should be called before the first
+call to \fBgetprojent()\fR.
+.sp
+.LP
+The \fBgetprojent()\fR function returns a pointer to a structure containing the
+broken-out fields of an entry in the project database. When first called,
+\fBgetprojent()\fR returns a pointer to a project structure containing the
+first project structure in the project database. Successive calls can be used
+to read the entire database.
+.sp
+.LP
+The \fBendprojent()\fR function closes the project database and deallocates
+resources when processing is complete. It is permissible, though possibly less
+efficient, for the process to call more project functions after calling
+\fBendprojent()\fR.
+.sp
+.LP
+The \fBgetprojbyname()\fR function searches the project database for an entry
+with the project name specified by the character string \fIname\fR.
+.sp
+.LP
+The \fBgetprojbyid()\fR function searches the project database for an entry
+with the (numeric) project \fBID\fR specified by \fIprojid\fR.
+.sp
+.LP
+The \fBgetdefaultproj()\fR function first looks up the project key word in the
+\fBuser_attr\fR database used to define user attributes in restricted Solaris
+environments. If the database is available and the keyword is present, the
+function looks up the named project, returning \fINULL\fR if it cannot be found
+or if the user is not a member of the named project. If absent, the function
+looks for a match in the project database for the special project
+\fBuser\fR.\fIusername\fR. If no match is found, or if the user is excluded
+from project \fBuser\fR.\fIusername\fR, the function looks at the default group
+entry of the \fBpasswd\fR database for the user, and looks for a match in the
+project database for the special name \fBgroup\fR.\fIgroupname\fR, where
+\fIgroupname\fR is the default group associated with the password entry
+corresponding to the given \fIusername\fR. If no match is found, or if the user
+is excluded from project \fBgroup\fR.\fIgroupname\fR, the function returns
+\fINULL\fR. A special project entry called 'default' can be looked up and used
+as a last resort, unless the user is excluded from project 'default'. On
+successful lookup, this function returns a pointer to the valid \fBproject\fR
+structure. By convention, the user must have a default project defined on a
+system to be able to log on to that system.
+.sp
+.LP
+The \fBinproj()\fR function checks if the user specified by \fIusername\fR is
+able to use the project specified by \fIprojname\fR. This function returns 1 if
+the user belongs to the list of project's users, if there is a project's group
+that contains the specified user, if project is a user's default project, or if
+project's user or group list contains "*" wildcard. In all other cases it
+returns 0.
+.sp
+.LP
+The \fBgetprojidbyname()\fR function searches the project database for an entry
+with the project name specified by the character string name. This function
+returns the project ID if the requested entry is found; otherwise it returns
+\(mi1.
+.sp
+.LP
+The \fBfgetprojent()\fR function, unlike the other functions described above,
+does not use \fBnsswitch.conf\fR; it reads and parses the next line from the
+stream \fIf\fR, which is assumed to have the format of the \fBproject\fR(4)
+file. This function returns the same values as \fBgetprojent()\fR.
+.sp
+.LP
+The \fBgetprojent()\fR, \fBgetprojbyname()\fR, \fBgetprojbyid()\fR,
+\fBgetdefaultproj()\fR, and \fBinproj()\fR functions are reentrant interfaces
+for operations with the \fBproject\fR database. These functions use buffers
+supplied by the caller to store returned results and are safe for use in both
+single-threaded and multithreaded applications.
+.sp
+.LP
+Reentrant interfaces require the additional arguments \fIproj\fR, \fIbuffer\fR,
+and \fIbufsize\fR. The \fIproj\fR argument must be a pointer to a \fBstruct
+project\fR structure allocated by the caller. On successful completion, the
+function returns the project entry in this structure. Storage referenced by the
+\fBproject\fR structure is allocated from the memory provided with the
+\fIbuffer\fR argument, which is \fIbufsize\fR bytes in size. The content of
+the memory buffer could be lost in cases when these functions return errors.
+.sp
+.LP
+For enumeration in multithreaded applications, the position within the
+enumeration is a process-wide property shared by all threads. The
+\fBsetprojent()\fR function can be used in a multithreaded application but
+resets the enumeration position for all threads. If multiple threads interleave
+calls to \fBgetprojent()\fR, the threads will enumerate disjoint subsets of the
+project database. The \fBinproj()\fR, \fBgetprojbyname()\fR,
+\fBgetprojbyid()\fR, and \fBgetdefaultproj()\fR functions leave the enumeration
+position in an indeterminate state.
+.SH RETURN VALUES
+.sp
+.LP
+Project entries are represented by the \fBstruct project\fR structure defined
+in <\fBproject.h\fR>.
+.sp
+.in +2
+.nf
+struct project {
+ char *pj_name; /* name of the project */
+ projid_t pj_projid; /* numerical project id */
+ char *pj_comment; /* project comment */
+ char **pj_users; /* vector of pointers to
+ project user names */
+ char **pj_groups; /* vector of pointers to
+ project group names */
+ char *pj_attr; /* project attributes */
+};
+.fi
+.in -2
+
+.sp
+.LP
+The \fBgetprojbyname()\fR and \fBgetprojbyid()\fR functions each return a
+pointer to a \fBstruct project\fR if they successfully locate the requested
+entry; otherwise they return \fINULL\fR.
+.sp
+.LP
+The \fBgetprojent()\fR function returns a pointer to a \fBstruct project\fR if
+it successfully enumerates an entry; otherwise it returns \fINULL\fR,
+indicating the end of the enumeration.
+.sp
+.LP
+The \fBgetprojidbyname()\fR function returns the project ID if the requsted
+entry is found; otherwise it returns \(mi1 and sets errno to indicate the
+error.
+.sp
+.LP
+When the pointer returned by the reentrant functions \fBgetprojbyname()\fR,
+\fBgetprojbyid()\fR, and \fBgetprojent()\fR is non-null, it is always equal to
+the \fIproj\fR pointer that was supplied by the caller.
+.sp
+.LP
+Upon failure, \fBNULL\fR is returned and errno is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetprojent()\fR, \fBgetprojbyname()\fR, \fBgetprojbyid()\fR,
+\fBinproj()\fR, \fBgetprojidbyname()\fR, \fBfgetprojent()\fR, and
+\fBgetdefaultproj()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was caught during the operation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 10n
+.rt
+An I/O error has occurred.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 10n
+.rt
+There are \fBOPEN_MAX\fR file descriptors currently open in the calling
+process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENFILE\fR\fR
+.ad
+.RS 10n
+.rt
+The maximum allowable number of files is currently open in the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 10n
+.rt
+Insufficient storage was supplied by \fIbuffer\fR and \fIbufsize\fR to contain
+the data to be referenced by the resulting \fBproject\fR structure.
+.RE
+
+.sp
+.LP
+These functions can also fail if the name service switch does not specify valid
+\fBproject\fR(4) name service sources. In the case of an incompletely
+configurated name service switch configuration, \fBgetprojbyid()\fR and other
+functions can return error values other than those documented above. These
+conditions usually occur when the \fBnsswitch.conf\fR file indicates that one
+or more name services is providing entries for the project database when that
+name service does not actually make a project table available.
+.SH USAGE
+.sp
+.LP
+When compiling multithreaded applications, see \fBIntro\fR(3), Notes On
+Multithreaded Applications.
+.sp
+.LP
+Use of the enumeration interface \fBgetprojent()\fR is discouraged. Enumeration
+is supported for the project file, NIS, and LDAP but in general is not
+efficient. The semantics of enumeration are discussed further in
+\fBnsswitch.conf\fR(4).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.64i) |cw(2.86i)
+lw(2.64i) |lw(2.86i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelSee Description.
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(3), \fBlibproject\fR(3LIB), \fBproject_walk\fR(3PROJECT),
+\fBsysconf\fR(3C), \fBnsswitch.conf\fR(4), \fBproject\fR(4),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man3project/project_walk.3project b/usr/src/man/man3project/project_walk.3project
new file mode 100644
index 0000000000..51f1dd7d44
--- /dev/null
+++ b/usr/src/man/man3project/project_walk.3project
@@ -0,0 +1,114 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH project_walk 3PROJECT "7 Oct 2003" "SunOS 5.11" "Project Database Access Library Functions"
+.SH NAME
+project_walk \- visit active project IDs on current system
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lproject\fR [ \fIlibrary \&.\|.\|.\fR ]
+#include <project.h>
+
+\fBint\fR \fBproject_walk\fR(\fBint (*\fR\fIcallback\fR)(\fBconst projid_t\fR \fIproject\fR,
+ \fBvoid *\fR\fIwalk_data\fR), \fBvoid *\fR\fIinit_data\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBproject_walk()\fR function provides a mechanism for the application
+author to examine all active projects on the current system. The
+\fIcallback\fR function provided by the application is given the ID of an
+active project at each invocation and can use the \fIwalk_data\fR to record its
+own state. The callback function should return non-zero if it encounters an
+error condition or attempts to terminate the walk prematurely; otherwise the
+callback function should return 0.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBproject_walk()\fR returns 0. It returns \(mi1 if
+the \fIcallback\fR function returned a non-zero value or if the walk
+encountered an error, in which case \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBproject_walk()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+There is insufficient memory available to set up the initial data for the walk.
+.RE
+
+.sp
+.LP
+Other returned error values are presumably caused by the \fIcallback\fR
+function.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRCount the number of projects available on the system.
+.sp
+.LP
+The following example counts the number of projects available on the system.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <project.h>
+#include <stdio.h>
+
+typedef struct wdata {
+ uint_t count;
+} wdata_t;
+
+wdata_t total_count;
+
+int
+simple_callback(const projid_t p, void *pvt)
+{
+ wdata_t *w = (wdata_t *)pvt;
+ w->count++;
+ return (0);
+}
+
+\&...
+
+total_count.count = 0;
+errno = 0;
+if ((n = project_walk(simple_callback, &total_count)) >= 0)
+ (void) printf("count = %u\en", total_count.count);
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgetprojid\fR(2), \fBlibproject\fR(3LIB), \fBsettaskid\fR(2),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man3project/setproject.3project b/usr/src/man/man3project/setproject.3project
new file mode 100644
index 0000000000..521a435eaa
--- /dev/null
+++ b/usr/src/man/man3project/setproject.3project
@@ -0,0 +1,277 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setproject 3PROJECT "10 Apr 2007" "SunOS 5.11" "Project Database Access Library Functions"
+.SH NAME
+setproject \- associate a user process with a project
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag \&.\|.\|.\fR ] \fIfile\fR\&.\|.\|. \fB-lproject\fR [ \fIlibrary \&.\|.\|.\fR ]
+#include <project.h>
+
+\fBint\fR \fBsetproject\fR(\fBconst char *\fR\fIproject_name\fR, \fBconst char *\fR\fIuser_name\fR,
+ \fBuint_t\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetproject()\fR function provides a simplified method for the
+association of a user process with a project and its various resource
+management attributes, as stored in the \fBproject\fR(4) name service database.
+These attributes include resource control settings, resource pool membership,
+and third party attributes (which are ignored by \fBsetproject()\fR.)
+.sp
+.LP
+If \fIuser_name\fR is a valid member of the project specified by
+\fIproject_name\fR, as determined by \fBinproj\fR(3PROJECT), \fBsetproject()\fR
+will create a new task with \fBsettaskid\fR(2) using task flags specified by
+\fIflags\fR, use \fBsetrctl\fR(2) to associate various resource controls with
+the process, task, and project, and bind the calling process to the appropriate
+resource pool with \fBpool_set_binding\fR(3POOL). Resource controls not
+explicitly specified in the project entry will be preserved. If \fIuser_name\fR
+is a name of the superuser (user with UID equal to 0), the \fBsetproject()\fR
+function skips the \fBinproj\fR(3PROJECT) check described above and allows the
+superuser to join any project.
+.sp
+.LP
+The current process will not be bound to a resource pool if the resource pools
+facility (see \fBpooladm\fR(1M)) is inactive. The \fBsetproject()\fR function
+will succeed whether or not the project specified by \fIproject_name\fR
+specifies a \fBproject.pool\fR attribute. If the resource pools facility is
+active, \fBsetproject()\fR will fail if the project does not specify a
+\fBproject.pool\fR attribute and there is no designated pool accepting default
+assignments. The \fBsetproject()\fR function will also fail if there is a
+specified \fBproject.pool\fR attribute for a nonexistent pool.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBsetproject()\fR returns 0. If any of the
+resource control assignments failed but the project assignment, pool binding,
+and task creation succeeded, an integer value corresponding to the offset into
+the key-value pair list of the failed attribute assignment is returned. If the
+project assignment or task creation was not successful, \fBsetproject()\fR
+returns \fBSETPROJ_ERR_TASK\fR and sets \fBerrno\fR to indicate the error. In
+the event of a pool binding failure, \fBsetproject()\fR returns
+\fBSETPROJ_ERR_POOL\fR and sets \fBerrno\fR to indicate the error. Additional
+error information can be retrieved from \fBpool_error\fR(3POOL).
+.SH ERRORS
+.sp
+.LP
+The \fBsetproject()\fR function will fail during project assignment or task
+creation if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+The invoking task was created with the \fBTASK_FINAL\fR flag.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+A resource control limiting the number of LWPs or tasks in the target project
+or zone has been exceeded.
+.sp
+A resource control on the given project would be exceeded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The project ID associated with the given project is not within the range of
+valid project IDs, invalid flags were specified, or \fIuser_name\fR is
+\fINULL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The effective user of the calling process is not superuser.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+The specified user is not a valid user of the given project, \fIuser_name\fR is
+not valid user name, or \fIproject_name\fR is not valid project name.
+.RE
+
+.sp
+.LP
+The \fBsetproject()\fR function will fail during pool binding if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+No resource pool accepting default bindings exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The effective user of the calling process is not superuser.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+The specified resource pool is unknown
+.RE
+
+.sp
+.LP
+If \fBsetproject()\fR returns an offset into the key-value pair list, the
+returned error value is associated with \fBsetrctl\fR(2) for resource control
+attributes.
+.SH USAGE
+.sp
+.LP
+The \fBsetproject()\fR function recognizes a name-structured value pair for the
+attributes in the \fBproject\fR(4) database with the following format:
+.sp
+.in +2
+.nf
+entity.control=(\fIprivilege\fR,\fIvalue\fR,\fIaction\fR,\fIaction\fR,\&.\|.\|.),\&.\|.\|.
+.fi
+.in -2
+
+.sp
+.LP
+where \fIprivilege\fR is one of \fBBASIC\fR or \fBPRIVILEGED\fR, \fIvalue\fR is
+a numeric value with optional units, and \fIaction\fR is one of \fBnone\fR,
+\fBdeny\fR, and \fBsignal\fR=\fIsignum\fR or \fBsignal\fR=\fISIGNAME\fR. For
+instance, to set a series of progressively more assertive control values on a
+project's per-process CPU time, specify
+.sp
+.in +2
+.nf
+process.max-cpu-time=(PRIVILEGED,1000s,signal=SIGXRES), \e
+(PRIVILEGED,1250, signal=SIGTERM),(PRIVILEGED,1500,
+ signal=SIGKILL)
+.fi
+.in -2
+
+.sp
+.LP
+To prevent a task from exceeding a total of 128 LWPs, specify a resource
+control with
+.sp
+.in +2
+.nf
+task.max-lwps=(PRIVILEGED,128,deny)
+.fi
+.in -2
+
+.sp
+.LP
+Specifying a resource control name with no values causes all resource control
+values for that name to be cleared on the given project, leaving only the
+system resource control value on the specified resource control name.
+.sp
+.LP
+For example, to remove all resource control values on shared memory, specify:
+.sp
+.in +2
+.nf
+project.max-shm-memory
+.fi
+.in -2
+
+.sp
+.LP
+The project attribute, \fBproject.pool\fR, specifies the pool to which
+processes associated with the project entry should be bound. Its format is:
+.sp
+.in +2
+.nf
+project.pool=pool_name
+.fi
+.in -2
+
+.sp
+.LP
+where \fBpool_name\fR is a valid resource pool within the active configuration
+enabled with \fBpooladm\fR(1M).
+.sp
+.LP
+The final attribute is used to finalize the task created by \fBsetproject()\fR.
+See\fBsettaskid\fR(2).
+.sp
+.in +2
+.nf
+task.final
+.fi
+.in -2
+
+.sp
+.LP
+All further attempts to create new tasks, such as using \fBnewtask\fR(1) and
+\fBsu\fR(1M), will fail.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBsetrctl\fR(2), \fBsettaskid\fR(2),
+\fBinproj\fR(3PROJECT), \fBlibproject\fR(3LIB), \fBpool_error\fR(3POOL),
+\fBpool_set_binding\fR(3POOL), \fBpasswd\fR(4), \fBproject\fR(4),
+\fBattributes\fR(5)