projdbfinit Subroutine
Purpose
Sets the handle to use a local project database as specified in the dbfile pointer and opens the file with the specified mode.
Library
The libaacct.a library.
Syntax
<sys/aacct.h>
projdbfinit(void *handle, char *file, int mode)
Description
The projdbfinit subroutine sets the specified handle to use the specified project definition file. The file is opened in the specified mode. Subsequently, the project database, as represented by the handle parameter, will be referenced through file system primitives.
The project
database must be initialized before calling this subroutine. The routines projdballoc and projdbfinit are
provided for this purpose. The specified file is opened in the specified
mode. File system calls are used to operate on these types of files.
The struct projdb is filled as follows:
projdb.type = PROJ_LOCAL
projdb.fdes = value returned from open() call.
If the file parameter is NULL, then the system project database is opened.
Parameters
Item | Description |
---|---|
handle | Pointer to handle |
file | Indicate the project definition file name |
mode | Indicates the mode in which the file is opened |
Security
Only for privileged users. Privilege can be extended to nonroot users by granting the CAP_AACCT capability to a user.
Return Values
Item | Description |
---|---|
0 | Success |
-1 | Failure |
Error Codes
Item | Description |
---|---|
EINVAL | Passed handle or file is invalid |