Skip Navigation Links | |
Exit Print View | |
man pages section 3: Extended Library Functions, Volume 3 Oracle Solaris 11.1 Information Library |
Extended Library Functions, Volume 3
nvlist_add_boolean_array(3NVPAIR)
nvlist_add_boolean_value(3NVPAIR)
nvlist_add_byte_array(3NVPAIR)
nvlist_add_int16_array(3NVPAIR)
nvlist_add_int32_array(3NVPAIR)
nvlist_add_int64_array(3NVPAIR)
nvlist_add_int8_array(3NVPAIR)
nvlist_add_nvlist_array(3NVPAIR)
nvlist_add_string_array(3NVPAIR)
nvlist_add_uint16_array(3NVPAIR)
nvlist_add_uint32_array(3NVPAIR)
nvlist_add_uint64_array(3NVPAIR)
nvlist_add_uint8_array(3NVPAIR)
nvlist_lookup_boolean(3NVPAIR)
nvlist_lookup_boolean_array(3NVPAIR)
nvlist_lookup_boolean_value(3NVPAIR)
nvlist_lookup_byte_array(3NVPAIR)
nvlist_lookup_int16_array(3NVPAIR)
nvlist_lookup_int32_array(3NVPAIR)
nvlist_lookup_int64_array(3NVPAIR)
nvlist_lookup_int8_array(3NVPAIR)
nvlist_lookup_nv_alloc(3NVPAIR)
nvlist_lookup_nvlist_array(3NVPAIR)
nvlist_lookup_string_array(3NVPAIR)
nvlist_lookup_uint16_array(3NVPAIR)
nvlist_lookup_uint32_array(3NVPAIR)
nvlist_lookup_uint64_array(3NVPAIR)
nvlist_lookup_uint8_array(3NVPAIR)
nvpair_value_boolean_array(3NVPAIR)
nvpair_value_boolean_value(3NVPAIR)
nvpair_value_byte_array(3NVPAIR)
nvpair_value_int16_array(3NVPAIR)
nvpair_value_int32_array(3NVPAIR)
nvpair_value_int64_array(3NVPAIR)
nvpair_value_int8_array(3NVPAIR)
nvpair_value_nvlist_array(3NVPAIR)
nvpair_value_string_array(3NVPAIR)
nvpair_value_uint16_array(3NVPAIR)
nvpair_value_uint32_array(3NVPAIR)
nvpair_value_uint64_array(3NVPAIR)
nvpair_value_uint8_array(3NVPAIR)
papiAttributeListAddBoolean(3PAPI)
papiAttributeListAddCollection(3PAPI)
papiAttributeListAddDatetime(3PAPI)
papiAttributeListAddInteger(3PAPI)
papiAttributeListAddMetadata(3PAPI)
papiAttributeListAddRange(3PAPI)
papiAttributeListAddResolution(3PAPI)
papiAttributeListAddString(3PAPI)
papiAttributeListAddValue(3PAPI)
papiAttributeListDelete(3PAPI)
papiAttributeListFromString(3PAPI)
papiAttributeListGetBoolean(3PAPI)
papiAttributeListGetCollection(3PAPI)
papiAttributeListGetDatetime(3PAPI)
papiAttributeListGetInteger(3PAPI)
papiAttributeListGetMetadata(3PAPI)
papiAttributeListGetNext(3PAPI)
papiAttributeListGetRange(3PAPI)
papiAttributeListGetResolution(3PAPI)
papiAttributeListGetString(3PAPI)
papiAttributeListGetValue(3PAPI)
papiAttributeListToString(3PAPI)
papiJobGetAttributeList(3PAPI)
papiJobSubmitByReference(3PAPI)
papiLibrarySupportedCall(3PAPI)
papiLibrarySupportedCalls(3PAPI)
papiPrinterGetAttributeList(3PAPI)
papiServiceGetAttributeList(3PAPI)
papiServiceGetEncryption(3PAPI)
papiServiceGetServiceName(3PAPI)
papiServiceGetStatusMessage(3PAPI)
papiServiceSetEncryption(3PAPI)
picld_plugin_register(3PICLTREE)
picl_get_frutree_parent(3PICL)
picl_get_propinfo_by_name(3PICL)
picl_get_propval_by_name(3PICL)
picl_set_propval_by_name(3PICL)
picl_walk_tree_by_class(3PICL)
pool_get_owning_resource(3POOL)
pool_get_resource_binding(3POOL)
pool_query_pool_resources(3POOL)
pool_query_resource_components(3POOL)
pool_resource_type_list(3POOL)
pool_resource_xtransfer(3POOL)
ptree_add_row_to_table(3PICLTREE)
ptree_create_and_add_node(3PICLTREE)
ptree_create_and_add_prop(3PICLTREE)
ptree_get_first_prop(3PICLTREE)
ptree_get_frutree_parent(3PICLTREE)
ptree_get_next_by_col(3PICLTREE)
ptree_get_next_by_row(3PICLTREE)
ptree_get_next_prop(3PICLTREE)
ptree_get_node_by_path(3PICLTREE)
ptree_get_prop_by_name(3PICLTREE)
ptree_get_propinfo_by_name(3PICLTREE)
ptree_get_propval_by_name(3PICLTREE)
ptree_init_propinfo(3PICLTREE)
ptree_register_handler(3PICLTREE)
ptree_unregister_handler(3PICLTREE)
ptree_update_propval(3PICLTREE)
ptree_update_propval_by_name(3PICLTREE)
- project database entry operations
cc [ flag... ] file... -lproject [ library... ] #include <project.h> struct project *getprojent(struct project *proj, void *buffer, size_t bufsize);
struct project *getprojbyname(const char *name, struct project *proj, void *buffer, size_t bufsize);
struct project *getprojbyid(projid_t projid, struct project *proj, void *buffer, size_t bufsize);
struct project *getdefaultproj(const char *username, struct project *proj, void *buffer, size_t bufsize);
int inproj(const char *username, const char *projname, void *buffer, size_t bufsize);
projid_t getprojidbyname(const char *name);
void setprojent(void);
void endprojent(void);
struct project *fgetprojent(FILE *f, struct project *proj, void *buffer, size_t bufsize);
These functions are used to obtain entries describing user projects. Entries can come from any of the sources for a project specified in the /etc/nsswitch.conf file (see nsswitch.conf(4)).
The setprojent(), getprojent(), and endprojent() functions are used to enumerate project entries from the database.
The setprojent() function effectively rewinds the project database to allow repeated searches. It sets (or resets) the enumeration to the beginning of the set of project entries. This function should be called before the first call to getprojent().
The getprojent() function returns a pointer to a structure containing the broken-out fields of an entry in the project database. When first called, getprojent() returns a pointer to a project structure containing the first project structure in the project database. Successive calls can be used to read the entire database.
The endprojent() function closes the project database and deallocates resources when processing is complete. It is permissible, though possibly less efficient, for the process to call more project functions after calling endprojent().
The getprojbyname() function searches the project database for an entry with the project name specified by the character string name.
The getprojbyid() function searches the project database for an entry with the (numeric) project ID specified by projid.
The getdefaultproj() function first looks up the project key word in the user_attr database used to define user attributes in restricted Solaris environments. If the database is available and the keyword is present, the function looks up the named project, returning NULL if it cannot be found or if the user is not a member of the named project. If absent, the function looks for a match in the project database for the special project user.username. If no match is found, or if the user is excluded from project user.username, the function looks at the default group entry of the passwd database for the user, and looks for a match in the project database for the special name group.groupname, where groupname is the default group associated with the password entry corresponding to the given username. If no match is found, or if the user is excluded from project group.groupname, the function returns NULL. A special project entry called 'default' can be looked up and used as a last resort, unless the user is excluded from project 'default'. On successful lookup, this function returns a pointer to the valid project structure. By convention, the user must have a default project defined on a system to be able to log on to that system.
The inproj() function checks if the user specified by username is able to use the project specified by projname. This function returns 1 if the user belongs to the list of project's users, if there is a project's group that contains the specified user, if project is a user's default project, or if project's user or group list contains “*” wildcard. In all other cases it returns 0.
The getprojidbyname() function searches the project database for an entry with the project name specified by the character string name. This function returns the project ID if the requested entry is found; otherwise it returns -1.
The fgetprojent() function, unlike the other functions described above, does not use nsswitch.conf; it reads and parses the next line from the stream f, which is assumed to have the format of the project(4) file. This function returns the same values as getprojent().
The getprojent(), getprojbyname(), getprojbyid(), getdefaultproj(), and inproj() functions are reentrant interfaces for operations with the project database. These functions use buffers supplied by the caller to store returned results and are safe for use in both single-threaded and multithreaded applications.
Reentrant interfaces require the additional arguments proj, buffer, and bufsize. The proj argument must be a pointer to a struct project structure allocated by the caller. On successful completion, the function returns the project entry in this structure. Storage referenced by the project structure is allocated from the memory provided with the buffer argument, which is bufsize bytes in size. The content of the memory buffer could be lost in cases when these functions return errors.
For enumeration in multithreaded applications, the position within the enumeration is a process-wide property shared by all threads. The setprojent() function can be used in a multithreaded application but resets the enumeration position for all threads. If multiple threads interleave calls to getprojent(), the threads will enumerate disjoint subsets of the project database. The inproj(), getprojbyname(), getprojbyid(), and getdefaultproj() functions leave the enumeration position in an indeterminate state.
Project entries are represented by the struct project structure defined in <project.h>.
struct project { char *pj_name; /* name of the project */ projid_t pj_projid; /* numerical project id */ char *pj_comment; /* project comment */ char **pj_users; /* vector of pointers to project user names */ char **pj_groups; /* vector of pointers to project group names */ char *pj_attr; /* project attributes */ };
The getprojbyname() and getprojbyid() functions each return a pointer to a struct project if they successfully locate the requested entry; otherwise they return NULL.
The getprojent() function returns a pointer to a struct project if it successfully enumerates an entry; otherwise it returns NULL, indicating the end of the enumeration.
The getprojidbyname() function returns the project ID if the requsted entry is found; otherwise it returns -1 and sets errno to indicate the error.
When the pointer returned by the reentrant functions getprojbyname(), getprojbyid(), and getprojent() is non-null, it is always equal to the proj pointer that was supplied by the caller.
Upon failure, NULL is returned and errno is set to indicate the error.
The getprojent(), getprojbyname(), getprojbyid(), inproj(), getprojidbyname(), fgetprojent(), and getdefaultproj() functions will fail if:
A signal was caught during the operation.
An I/O error has occurred.
There are OPEN_MAX file descriptors currently open in the calling process.
The maximum allowable number of files is currently open in the system.
Insufficient storage was supplied by buffer and bufsize to contain the data to be referenced by the resulting project structure.
These functions can also fail if the name service switch does not specify valid project(4) name service sources. In the case of an incompletely configurated name service switch configuration, getprojbyid() and other functions can return error values other than those documented above. These conditions usually occur when the nsswitch.conf file indicates that one or more name services is providing entries for the project database when that name service does not actually make a project table available.
When compiling multithreaded applications, see Intro(3), Notes On Multithreaded Applications.
Use of the enumeration interface getprojent() is discouraged. Enumeration is supported for the project file, NIS, and LDAP but in general is not efficient. The semantics of enumeration are discussed further in nsswitch.conf(4).
See attributes(5) for descriptions of the following attributes:
|
Intro(3), libproject(3LIB), project_walk(3PROJECT), sysconf(3C), nsswitch.conf(4), project(4), attributes(5)