Retrieves the project details from the kernel project registry.
The libaacct.a library.
<sys/aacct.h>
getprojs(struct project *, int *)
The getprojs subroutine retrieves the specified number of project definitions from the kernel project registry. The number of definitions to be retrieved is passed as an argument to this subroutine, and it is also passed with a buffer of type struct project, where the retrieved project definitions are stored.
When the getprojs subroutine is called with a NULL value passed instead of a pointer to a struct project, the getprojs subroutine returns the total number of defined projects in the kernel project registry. This number can be used by any subsequent calls to retrieve the project details.
If the integer value passed is smaller than the number of project definitions available, then the project buffer will be filled with as many entries as requested. If the value is greater than the number of available definitions, then the available records are filled in the structure and the integer value is updated with the number of records actually retrieved.
Generally, the projects are loaded from the system project definition file or LDAP, or from both. When more than one of these project repositories are used, project name and project ID collisions are possible. These projects are differentiated by the kernel using an origin flag. This origin flag designates the project repository from where the project definition is obtained. Valid project origins values that can be passed are defined in the sys/aacct.h file. The getproj subroutine also returns this origin information in the flags field of the output project structures.
Item | Description |
---|---|
pointer | Points to a project structure where the retrieved data is stored. |
int | An integer that indicates the number of elements to be retrieved. |
There are no restrictions. Any user can call this function.
Item | Description |
---|---|
0 | Success |
-1 | Failure |
Item | Description |
---|---|
EINVAL | Invalid arguments if passed int pointer is NULL |
ENOENT | No projects available. |