Copyright (c) 2002, 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]
use Sun::Solaris::Project qw(:ALL); my $projid = getprojid();
This module provides wrappers for the Project-related system calls and the libproject(3LIB) library. Also provided are constants from the various Project-related headers.
MAXPROJID, PROJNAME_MAX, PROJF_PATH, PROJECT_BUFSZ, SETPROJ_ERR_TASK, and SETPROJ_ERR_POOL.
This function returns the numeric project ID of the calling process or undef if the underlying getprojid(2) system call is unsuccessful.
If $user is a member of the project specified by $project, setproject() creates a new task and associates the appropriate resource controls with the process, task, and project. This function returns 0 on success. If the underlying task creation fails, SETPROJ_ERR_TASK is returned. If pool assignment fails, SETPROJ_ERR_POOL is returned. If any resource attribute assignments fail, an integer value corresponding to the offset of the failed attribute assignment in the project database is returned. See setproject(3PROJECT).
This function returns a list of the currently active projects on the system. Each value in the list is the numeric ID of a currently active project.
This function returns the next entry from the project database. When called in a scalar context, getprojent() returns only the name of the project. When called in a list context, getprojent() returns a 6-element list consisting of:
($name, $projid, $comment, \e@users, \e@groups, $attr)\e@users and \e@groups are returned as arrays containing the appropriate user or project lists. On end-of-file undef is returned.
This function rewinds the project database to the beginning of the file.
This function closes the project database.
This function searches the project database for an entry with the specified nam. It returns a 6-element list as returned by getprojent() if the entry is found and undef if it cannot be found.
This function searches the project database for an entry with the specified ID. It returns a 6-element list as returned by getprojent() if the entry is found or undef if it cannot be found.
This function returns the default project entry for the specified user in the same format as getprojent(). It returns undef if the user cannot be found. See getdefaultproj(3PROJECT) for information about the lookup process.
This function returns the next project entry from $filehandle, a Perl file handle that must refer to a previously opened file in project(5) format. Return values are the same as for getprojent().
This function checks whether the specified user is able to use the project. This function returns true if the user can use the project and false otherwise. See inproj(3PROJECT).
This function searches the project database for the specified project. It returns the project ID if the project is found and undef if it is not found.
None.
None.
By default nothing is exported from this module. The following tags can be used to selectively import constants and functions defined in this module: :SYSCALLS
getprojid()
setproject(), activeprojects(), getprojent(), setprojent(), endprojent(), getprojbyname(), getprojbyid(), getdefaultproj(), fgetprojent(), inproj(), and getprojidbyname()
MAXPROJID, PROJNAME_MAX, PROJF_PATH, PROJECT_BUFSZ, SETPROJ_ERR_TASK, and SETPROJ_ERR_POOL
:SYSCALLS, :LIBCALLS, and :CONSTANTS
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Evolving |
getprojid (2), libproject (3LIB), getdefaultproj (3PROJECT), inproj (3PROJECT), setproject (3PROJECT), project (5), attributes (7)