head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	97.04.28.00.54.52;	author morgan;	state Exp;
branches;
next	;


desc
@zefram's manual
@


1.1
log
@Initial revision
@
text
@.\"
.\" $Id$
.\"
.TH CAP_CLEAR 3 "26th April 1997" "" "Linux Programmer's Manual"
.SH NAME
cap_clear, cap_get_flag, cap_set_flag \- twiddle bits in capability sets
.SH SYNOPSIS
.B #include <sys/capability.h>
.sp
.BI "int cap_clear(cap_t " caps );
.sp
.BI "int cap_get_flag(cap_t " caps ", cap_value_t " capno ", cap_flag_t " set ", cap_flag_value_t *" result_p ");"
.sp
.BI "int cap_set_flag(cap_t " caps ", cap_flag_t " set ", int " numcaps ", cap_value_t *" capnos ", cap_flag_value_t " state ");"
.SH DESCRIPTION
.B cap_clear
clears all bits in the capability sets of
.IR caps .
.PP
.B cap_get_flag
extracts the state of capability number
.I capno
from capability set
.I set
in
.IR caps ,
and writes it into
.IR *result_p .
.PP
.B cap_set_flag
sets the state of capabilities.  It sets capabilities in capability set
.I set
in
.IR caps
to state
.IR state .
The capabilities to set are specified in an array pointed to by
.I capnos
of length
.IR numcaps .
.PP
A
.B cap_value_t
can be set to any capability number, such as
.BR CAP_CHOWN .
A
.B cap_flag_t
can be set to
.BR CAP_EFFECTIVE ,
.B CAP_INHERITABLE
or
.BR CAP_PERMITTED .
A
.B cap_flag_value_t
can be
.B CAP_CLEAR
(0) or
.B CAP_SET
(1).
.SH "RETURN VALUE"
.BR cap_clear ,
.B cap_get_flag
and
.B cap_set_flag
return zero on success, and \-1 on failure.
.PP
On failure,
.BR errno (3)
is set to 
.BR EINVAL ,
indicating that one of the arguments is invalid.

.SH "CONFORMING TO"
These functions are specified by POSIX.1e.
.SH "SEE ALSO"
.IR cap_copy_ext (3),
.IR cap_from_text (3),
.IR cap_get_file (3),
.IR cap_get_proc (3),
.IR cap_init (3)
@
