1Project(3PERL) Perl Library Functions Project(3PERL)
2
3
4
6 Project - Perl interface to Projects
7
9 use Sun::Solaris::Project qw(:ALL);
10 my $projid = getprojid();
11
12
14 This module provides wrappers for the Project-related system calls and
15 the libproject(3LIB) library. Also provided are constants from the var‐
16 ious Project-related headers.
17
18 Constants
19 MAXPROJID, PROJNAME_MAX, PROJF_PATH, PROJECT_BUFSZ, SETPROJ_ERR_TASK,
20 and SETPROJ_ERR_POOL.
21
22 Functions
23 getprojid()
24
25 This function returns the numeric project ID of the calling process
26 or undef if the underlying getprojid(2) system call is unsuccess‐
27 ful.
28
29
30 setproject($project, $user, $flags)
31
32 If $user is a member of the project specified by $project, setpro‐
33 ject() creates a new task and associates the appropriate resource
34 controls with the process, task, and project. This function returns
35 0 on success. If the underlying task creation fails, SET‐
36 PROJ_ERR_TASK is returned. If pool assignment fails, SET‐
37 PROJ_ERR_POOL is returned. If any resource attribute assignments
38 fail, an integer value corresponding to the offset of the failed
39 attribute assignment in the project database is returned. See set‐
40 project(3PROJECT).
41
42
43 activeprojects()
44
45 This function returns a list of the currently active projects on
46 the system. Each value in the list is the numeric ID of a currently
47 active project.
48
49
50 getprojent()
51
52 This function returns the next entry from the project database.
53 When called in a scalar context, getprojent() returns only the name
54 of the project. When called in a list context, getprojent() returns
55 a 6-element list consisting of:
56
57 ($name, $projid, $comment, \@users, \@groups, $attr)
58
59 \@users and \@groups are returned as arrays containing the appro‐
60 priate user or project lists. On end-of-file undef is returned.
61
62
63 setprojent()
64
65 This function rewinds the project database to the beginning of the
66 file.
67
68
69 endprojent()
70
71 This function closes the project database.
72
73
74 getprojbyname($name)
75
76 This function searches the project database for an entry with the
77 specified nam. It returns a 6-element list as returned by getpro‐
78 jent() if the entry is found and undef if it cannot be found.
79
80
81 getprojbyid($id)
82
83 This function searches the project database for an entry with the
84 specified ID. It returns a 6-element list as returned by getpro‐
85 jent() if the entry is found or undef if it cannot be found.
86
87
88 getdefaultproj($user)
89
90 This function returns the default project entry for the specified
91 user in the same format as getprojent(). It returns undef if the
92 user cannot be found. See getdefaultproj(3PROJECT) for information
93 about the lookup process.
94
95
96 fgetprojent($filehandle)
97
98 This function returns the next project entry from $filehandle, a
99 Perl file handle that must refer to a previously opened file in
100 project(4) format. Return values are the same as for getprojent().
101
102
103 inproj($user, $project)
104
105 This function checks whether the specified user is able to use the
106 project. This function returns true if the user can use the project
107 and false otherwise. See inproj(3PROJECT).
108
109
110 getprojidbyname($project)
111
112 This function searches the project database for the specified
113 project. It returns the project ID if the project is found and
114 undef if it is not found.
115
116
117 Class methods
118 None.
119
120 Object methods
121 None.
122
123 Exports
124 By default nothing is exported from this module. The following tags can
125 be used to selectively import constants and functions defined in this
126 module:
127
128 :SYSCALLS getprojid()
129
130
131 :LIBCALLS setproject(), activeprojects(), getprojent(), setpro‐
132 jent(), endprojent(), getprojbyname(), getprojbyid(),
133 getdefaultproj(), fgetprojent(), inproj(), and getprojid‐
134 byname()
135
136
137 :CONSTANTS MAXPROJID, PROJNAME_MAX, PROJF_PATH, PROJECT_BUFSZ, SET‐
138 PROJ_ERR_TASK, and SETPROJ_ERR_POOL
139
140
141 :ALL :SYSCALLS, :LIBCALLS, and :CONSTANTS
142
143
145 See attributes(5) for descriptions of the following attributes:
146
147
148
149
150 ┌─────────────────────────────┬─────────────────────────────┐
151 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
152 ├─────────────────────────────┼─────────────────────────────┤
153 │Availability │SUNWpl5u │
154 ├─────────────────────────────┼─────────────────────────────┤
155 │Interface Stability │Evolving │
156 └─────────────────────────────┴─────────────────────────────┘
157
159 getprojid(2), getdefaultproj(3PROJECT), inproj(3PROJECT), libpro‐
160 ject(3LIB), setproject(3PROJECT), project(4), attributes(5)
161
162
163
164SunOS 5.11 1 Dec 2002 Project(3PERL)