procprivl(3C) procprivl(3C)
NAME
procprivl - add, remove, count, or put privileges associated
with the calling process
SYNOPSIS
#include <priv.h>
int procprivl(int cmd, priv_t priv1, . . .);
DESCRIPTION
The procprivl function is used to add, remove, count, or put
the privileges associated with the calling process. privN is
a list of privilege descriptors, each of which contains the
privilege set and identity of the requested privilege. The
list is terminated with a (priv_t)0 value.
The recognized cmds and their functions are described below:
SETPRV the working privilege set for the current process is
set based on the privilege descriptor(s) contained in
privN. All requested privileges not contained in the
current maximum privilege set are ignored. All
requested working privileges that are in the current
maximum set are added to the working set. If any
argument is invalid, none of the process privileges is
changed.
CLRPRV the working and maximum privilege sets for the current
process are cleared based on the privilege
descriptor(s) contained in privN. All requested
privileges are removed from their respective sets. The
working set is adjusted to be a subset of the resulting
maximum set. If any argument is invalid, none of the
process privileges is changed.
PUTPRV the working and maximum privilege sets for the current
process are set based on the privilege descriptor(s)
contained in privN. The setting is absolute. The
working set is adjusted to be a subset of the resulting
maximum set. Privileges contained in either privilege
set that are not in the maximum set of the calling
process are ignored. If any argument is invalid, none
of the process privileges is changed.
CNTPRV returns the number of privileges associated with the
current process. The privN arguments are ignored.
None of the process privileges is changed.
Copyright 1994 Novell, Inc. Page 1
procprivl(3C) procprivl(3C)
Return Values
A value of -1 is returned and errno is set to indicate the
error if procprivl is unsuccessful. If successful, procprivl
returns the number of privileges associated with the current
process (SETPRV, CLRPRV, and PUTPRV or CNTPRV).
Errors
procprivl fails if the following is true:
EINVAL cmd or privilege specified is invalid.
REFERENCES
intro(2), filepriv(2), procpriv(2), priv(5), privilege(5)
Copyright 1994 Novell, Inc. Page 2