Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > P

priv_getbyname(3)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

priv_getbyname() — convert privilege name to privilege ID

SYNOPSIS

#include <sys/privileges.h> #include <sys/types.h>

priv_t priv_getbyname(const char *priv_name);

Parameters

priv_name

char pointer to the string containing the privilege name.

DESCRIPTION

priv_getbyname() converts the external (string) representation of the privilege name to the internal (numeric) privilege representation.

RETURN VALUE

priv_getbyname() returns the following values:

>=0

Successful completion. The value of the privilege ID is returned.

-1

Function failed. errno is set to indicate the error.

ERRORS

priv_getbyname() sets errno to the following value if the corresponding condition occurs.

EINVAL

Invalid privilege name.

EXAMPLES

#include <sys/privileges.h> #include <sys/types.h> main() { priv_t privid; char *privname = "SYSNFS"; privid = priv_getbyname(privname); if (privid == -1) { printf("\nError getting privilege ID\n"); } else { printf("\nPrivilege ID : %d\n",privid); } }

SEE ALSO

priv_getbynum(3), priv_set_to_str(3), priv_str_to_set(3), privileges(5).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.