Query: priv_getbyname
OS: opensolaris
Section: 9f
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
priv_getbyname(9F) Kernel Functions for Drivers priv_getbyname(9F)NAMEpriv_getbyname - map a privilege name to a numberSYNOPSIS#include <sys/cred.h> int priv_getbyname(const char *priv, int flags);INTERFACE LEVELSolaris DDI specific (Solaris DDI).PARAMETERSpriv name of the privilege flags flags, must be zero or PRIV_ALLOCDESCRIPTIONThe priv_getbyname() function maps a privilege name to a privilege number for use with the priv_*() kernel interfaces. If PRIV_ALLOC is passed as a flag parameter, an attempt is made to allocate a privilege if it is not yet defined. The newly allocated priv- ilege number is returned. Privilege names can be specified with an optional priv_ prefix, which is stripped. Privilege names are case insensitive but allocated privileges preserve case. Allocated privileges can be at most {PRIVNAME_MAX} characters long and can contain only alphanumeric characters and the underscore charac- ter.RETURN VALUESThis function returns the privilege number, which is greater than or equal to 0, if it succeeds. It returns a negative error number if an error occurs.ERRORSEINVAL This might be caused by any of the following o The flags parameter is invalid. o The specified privilege does not exist. o The priv parameter contains invalid characters. ENOMEM There is no room to allocate another privilege. ENAMETOOLONG An attempt was made to allocate a privilege that was longer than {PRIVNAME_MAX} characters.CONTEXTThis functions can be called from user and kernel contexts.ATTRIBUTESSee attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |All | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+SEE ALSOattributes(5), privileges(5) Writing Device Drivers SunOS 5.11 11 Mar 2004 priv_getbyname(9F)
Related Man Pages |
---|
priv_policy(9f) - opensolaris |
priv_policy(9f) - sunos |
priv_policy_choice(9f) - opensolaris |
priv_policy_choice(9f) - x11r4 |
priv_policy_choice(9f) - v7 |
Similar Topics in the Unix Linux Community |
---|
Shutdown Privilege |
User Privilege |
Create user with different privilege |