Go to main content

Resource Management and Oracle® Solaris Zones Developer's Guide

Exit Print View

Updated: February 2021
 
 

Project and Task API Functions

The following functions are provided to assist developers in working with projects. The functions use entries that describe user projects in the project database.

See man pages section 3: Extended Library Functions, Volume 3 for additional information on these functions.

endprojent(3PROJECT)

Close the project database and deallocate resources when processing is complete.

fgetprojent(3PROJECT)

Returns a pointer to a structure containing an entry in the project database. Rather than using nsswitch.conf, fgetprojent reads a line from a stream.

getdefaultproj(3PROJECT)

Check the validity of the project keyword, look up the project, and return a pointer to the project structure if found.

getprojbyid(3PROJECT)

Search the project database for an entry with the number that specifies the project ID.

getprojbyname(3PROJECT)

Search the project database for an entry with the string that specifies project name.

getprojent(3PROJECT)

Returns a pointer to a structure containing an entry in the project database.

getprojidbyname(3PROJECT)

Searches the project database for an entry with the project name specified by the character string name.

inproj(3PROJECT)

Check whether the specified user is permitted to use the specified project.

setproject(3PROJECT)

Calling process joins the target project by creating a new task in the target project.

setprojent(3PROJECT)

Rewind the project database to allow repeated searches.

The reentrant functions getprojent, getprojbyname, getprojbyid, getdefaultproj, and inproj use buffers supplied by the caller to store returned results. These functions are safe for use in both single-threaded applications and multithreaded applications.

    Reentrant functions require three additional arguments:

  • buffer

  • bufsize

  • proj

The proj argument must be a pointer to a project structure allocated by the caller. On successful completion, these functions return the project entry in this structure. Storage referenced by the project structure is allocated from the memory specified by the buffer argument. The bufsize argument specifies the size in number of bytes.

If an incorrect buffer size is used, the getprojent function returns NULL and sets errno to ERANGE.