Standard C Library Functions privaddset(3C)
NAME
privaddset, privallocset, privcopyset, privdelset,
privemptyset, privfillset, privfreeset, privintersect,
privinverse, privisemptyset, privisequalset,
privisfullset, privismember, privissubset, privunion -
privilege set manipulation functions
SYNOPSIS
#include
int privaddset(privsett *sp, const char *priv);
privsett *privallocset(void);
void privcopyset(const privsett *src, privsett *dst);
int privdelset(privsett *sp, const char *priv);
void privemptyset(privsett *sp);
void privfillset(privsett *sp);
void privfreeset(privsett *sp);
void privintersect(const privsett *src, privsett *dst);
void privinverse(privsett *sp);
booleant privisemptyset(const privsett *sp);
booleant privisequalset(const privsett *src, const privsett *dst);
booleant privisfullset(const privsett *sp);
booleant privismember(const privsett *sp, const char *priv);
booleant privissubset(const privsett *src, const privsett *dst);
SunOS 5.11 Last change: 28 Jan 2005 1
Standard C Library Functions privaddset(3C)
void privunion(const privsett *src, privsett *dst);
DESCRIPTION
The sp, src, and dst arguments point to privilege sets. The
priv argument points to a named privilege.
The privaddset() function adds the named privilege priv to
sp.
The privallocset() function allocates sufficient memory to
contain a privilege set. The value of the returned privilege
set is indeterminate. The function returns NUL and sets
errno when it fails to allocate memory.
The privcopyset() function copies the set src to dst.
The privdelset() function removes the named privilege priv
from sp.
The privemptyset() function clears all privileges from sp.
The privfillset() function asserts all privileges in sp,
including the privileges not currently defined in the sys-
tem.
The privfreeset() function frees the storage allocated by
privallocset().
The privintersect() function intersects src with dst and
places the results in dst.
The privinverse() function inverts the privilege set given
as argument in place.
The privisemptyset() function checks whether the argument
is an empty set.
The privisequalset() function checks whether the privilege
set src is equal to dst.
SunOS 5.11 Last change: 28 Jan 2005 2
Standard C Library Functions privaddset(3C)
The privisfullset() function checks whether the argument is
a full set. A full set is a set with all bits set, regard-
less of whether the privilege is currently defined in the
system.
The privismember() function checks whether the named
privilege priv is a member of sp.
The privissubset() function checks whether src is a subset
of dst.
The privunion() function takes the union of src and dst and
places the result in dst.
RETURN VALUES
Upon successful completion, privallocset() returns a
pointer to an opaque data structure. It returns NUL if
memory allocation fails and sets errno to indicate the
error.
Upon successful completion, privisemptyset(),
privisfullset(), privisequalset(), privissubset(), and
privismember() return BTRUE. Otherwise, they return
BFALSE.
Upon successful completion, privdelset() and privaddset()
return 0. Otherwise, they return -1 and set errno to indi-
cate the error.
ERORS
The privallocset() function will fail if:
ENOMEM The physical limits of the system are exceeded by
the memory allocation needed to hold a privilege
set.
EAGAIN There is insufficient memory for allocation to
hold a privilege set. The application can try
again later.
The privdelset() and privaddset() functions will fail if:
EINVAL The privilege argument is not a valid privilege
name.
SunOS 5.11 Last change: 28 Jan 2005 3
Standard C Library Functions privaddset(3C)
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO
setppriv(2), malloc(3C), privstrtoset(3C), attributes(5),
privileges(5)
NOTES
The functions that compare sets operate on all bits of the
set, regardless of whether the specific privileges are
currently defined in the system.
SunOS 5.11 Last change: 28 Jan 2005 4
|