Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3perl / Project.3perl
blob894f62f4b8d70fc86f2351c4a722ed2671a173a5
1 '\" te
2 .\" Copyright (c) 2002, 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 PROJECT 3PERL "Dec 1, 2002"
7 .SH NAME
8 Project \- Perl interface to Projects
9 .SH SYNOPSIS
10 .LP
11 .nf
12 use Sun::Solaris::Project qw(:ALL);
13 my $projid = getprojid();
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 This module provides wrappers for the Project-related system calls and the
20 \fBlibproject\fR(3LIB) library. Also provided are constants from the various
21 Project-related headers.
22 .SS "Constants"
23 .sp
24 .LP
25 \fBMAXPROJID\fR, \fBPROJNAME_MAX\fR, \fBPROJF_PATH\fR, \fBPROJECT_BUFSZ\fR,
26 \fBSETPROJ_ERR_TASK\fR, and \fBSETPROJ_ERR_POOL\fR.
27 .SS "Functions"
28 .sp
29 .ne 2
30 .na
31 \fB\fBgetprojid()\fR\fR
32 .ad
33 .sp .6
34 .RS 4n
35 This function returns the numeric project ID of the calling process or
36 \fBundef\fR if the underlying \fBgetprojid\fR(2) system call is unsuccessful.
37 .RE
39 .sp
40 .ne 2
41 .na
42 \fB\fBsetproject($project, $user, $flags)\fR\fR
43 .ad
44 .sp .6
45 .RS 4n
46 If \fB$user\fR is a member of the project specified by \fB$project\fR,
47 \fBsetproject()\fR creates a new task and associates the appropriate resource
48 controls with the process, task, and project. This function returns 0 on
49 success. If the underlying task creation fails, \fBSETPROJ_ERR_TASK\fR is
50 returned. If pool assignment fails, \fBSETPROJ_ERR_POOL\fR is returned. If any
51 resource attribute assignments fail, an integer value corresponding to the
52 offset of the failed attribute assignment in the project database is returned.
53 See \fBsetproject\fR(3PROJECT).
54 .RE
56 .sp
57 .ne 2
58 .na
59 \fB\fBactiveprojects()\fR\fR
60 .ad
61 .sp .6
62 .RS 4n
63 This function returns a list of the currently active projects on the system.
64 Each value in the list is the numeric ID of a currently active project.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fBgetprojent()\fR\fR
71 .ad
72 .sp .6
73 .RS 4n
74 This function returns the next entry from the project database. When called in
75 a scalar context, \fBgetprojent()\fR returns only the name of the project. When
76 called in a list context, \fBgetprojent()\fR returns a 6-element list
77 consisting of:
78 .sp
79 .in +2
80 .nf
81 ($name, $projid, $comment, \e@users, \e@groups, $attr)
82 .fi
83 .in -2
85 \e@users and \e@groups are returned as arrays containing the appropriate user
86 or project lists. On end-of-file \fBundef\fR is returned.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fBsetprojent()\fR\fR
93 .ad
94 .sp .6
95 .RS 4n
96 This function rewinds the project database to the beginning of the file.
97 .RE
99 .sp
100 .ne 2
102 \fB\fBendprojent()\fR\fR
104 .sp .6
105 .RS 4n
106 This function closes the project database.
110 .ne 2
112 \fB\fBgetprojbyname($name)\fR\fR
114 .sp .6
115 .RS 4n
116 This function searches the project database for an entry with the specified
117 nam. It returns a 6-element list as returned by \fBgetprojent()\fR if the entry
118 is found and \fBundef\fR if it cannot be found.
122 .ne 2
124 \fB\fBgetprojbyid($id)\fR\fR
126 .sp .6
127 .RS 4n
128 This function searches the project database for an entry with the specified ID.
129 It returns a 6-element list as returned by \fBgetprojent()\fR if the entry is
130 found or \fBundef\fR if it cannot be found.
134 .ne 2
136 \fB\fBgetdefaultproj($user)\fR\fR
138 .sp .6
139 .RS 4n
140 This function returns the default project entry for the specified user in the
141 same format as \fBgetprojent()\fR. It returns \fBundef\fR if the user cannot be
142 found. See \fBgetdefaultproj\fR(3PROJECT) for information about the lookup
143 process.
147 .ne 2
149 \fB\fBfgetprojent($filehandle)\fR\fR
151 .sp .6
152 .RS 4n
153 This function returns the next project entry from \fB$filehandle\fR, a Perl
154 file handle that must refer to a previously opened file in \fBproject\fR(4)
155 format.  Return values are the same as for \fBgetprojent()\fR.
159 .ne 2
161 \fB\fBinproj($user, $project)\fR\fR
163 .sp .6
164 .RS 4n
165 This function checks whether the specified user is able to use the project.
166 This function returns true if the user can use the project and false otherwise.
167 See \fBinproj\fR(3PROJECT).
171 .ne 2
173 \fB\fBgetprojidbyname($project)\fR\fR
175 .sp .6
176 .RS 4n
177 This function searches the project database for the specified project. It
178 returns the project ID if the project is found and \fBundef\fR if it is not
179 found.
182 .SS "Class methods"
185 None.
186 .SS "Object methods"
189 None.
190 .SS "Exports"
193 By default nothing is exported from this module. The following tags can be used
194 to selectively import constants and functions defined in this module:
196 .ne 2
198 \fB\fB:SYSCALLS\fR\fR
200 .RS 14n
201 \fBgetprojid()\fR
205 .ne 2
207 \fB\fB:LIBCALLS\fR\fR
209 .RS 14n
210 \fBsetproject()\fR, \fBactiveprojects()\fR, \fBgetprojent()\fR,
211 \fBsetprojent()\fR, \fBendprojent()\fR, \fBgetprojbyname()\fR,
212 \fBgetprojbyid()\fR, \fBgetdefaultproj()\fR, \fBfgetprojent()\fR,
213 \fBinproj()\fR, and \fBgetprojidbyname()\fR
217 .ne 2
219 \fB\fB:CONSTANTS\fR\fR
221 .RS 14n
222 \fBMAXPROJID\fR, \fBPROJNAME_MAX\fR, \fBPROJF_PATH\fR, \fBPROJECT_BUFSZ\fR,
223 \fBSETPROJ_ERR_TASK\fR, and \fBSETPROJ_ERR_POOL\fR
227 .ne 2
229 \fB\fB:ALL\fR\fR
231 .RS 14n
232 :SYSCALLS\fB\fR, \fB:LIBCALLS\fR, and \fB:CONSTANTS\fR
235 .SH ATTRIBUTES
238 See \fBattributes\fR(5) for descriptions of the following attributes:
243 box;
244 c | c
245 l | l .
246 ATTRIBUTE TYPE  ATTRIBUTE VALUE
248 Interface Stability     Evolving
251 .SH SEE ALSO
254 \fBgetprojid\fR(2), \fBgetdefaultproj\fR(3PROJECT), \fBinproj\fR(3PROJECT),
255 \fBlibproject\fR(3LIB), \fBsetproject\fR(3PROJECT), \fBproject\fR(4),
256 \fBattributes\fR(5)