Index Index for
Section 9r
Index Alphabetical
listing for P
Bottom of page Bottom of
page

privileged(9r)

NAME

privileged - General: Checks for proper privileges

SYNOPSIS

int privileged( int privilege, int error_code );

ARGUMENTS

privilege Specifies the privilege to check against. This privilege must be one of the constants defined in /usr/sys/include/sys/security.h. For example, you would specify SEC_FILESYS for disk drivers that must manipulate partition tables on disk drives. error_code Specifies the value used to control auditing. You can pass one of the system's error codes or one of the following values: -1, 0, 1. An example of an error code is the constant EPERM.

DESCRIPTION

The privileged routine checks for an appropriate privilege when the security feature is enabled. Use privileged with a privilege number and with the error_code argument set to the constant EPERM to emulate the traditional behavior of the suser routine. Set error_code to a value of 0 (zero) if you want to check the privilege but not fail the operation if the user does not have the proper privilege. A value of -1 turns off all auditing as well.

RETURN VALUES

The privileged routine returns the value 0 (zero) if the process does not have privilege. It returns the value 1 if the process does have privilege.

FILES

<errno.h> <security.h>

SEE ALSO

Routines: suser(9r)

Index Index for
Section 9r
Index Alphabetical
listing for P
Top of page Top of
page