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


1.2
date	97.05.24.19.45.28;	author morgan;	state Exp;
branches;
next	1.1;

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


desc
@zefram's manual
@


1.2
log
@corrections from Aleph1
@
text
@.\"
.\" $Id: cap_get_proc.3,v 1.1 1997/04/28 00:54:52 morgan Exp morgan $
.\"
.TH CAP_GET_PROC 3 "26th May 1997" "" "Linux Programmer's Manual"
.SH NAME
cap_get_proc, cap_set_proc \- capability manipulation on processes
.SH SYNOPSIS
.B #include <sys/capability.h>
.sp
.B cap_t cap_get_proc(void);
.sp
.BI "int cap_set_proc(cap_t " cap_p );
.SH USAGE
.br
.B cc ... -lcap
.SH DESCRIPTION
.B cap_get_proc
allocates a capability state in working storage, sets its state to
that of the calling process, and returns a pointer to this newly
created capability state.  The caller should free any releasable
memory, when the capability state in working storage is no longer
required, by calling
.B cap_free
with the
.I cap_t
as an argument.
.PP
.B cap_set_proc
sets the values for all capability flags for all capabilities with the
capability state identified by
.IR cap_p .
The new capability state of the process will be completely determined by
the contents of
.I cap_p
upon successful return from this function.  If any flag in
.I cap_p
is set for any capability not currently permitted for the calling process,
the function will fail, and the capability state of the process will remain
unchanged.
.SH "RETURN VALUE"
.B cap_get_proc
returns a non-NULL value on success, and NULL on failure.
.PP
.B cap_set_proc
returns zero on success, and \-1 on failure.
.PP
On failure,
.BR errno (3)
is set to
.BR EINVAL ,
.BR EPERM,
or
.BR ENOMEM .
.SH "CONFORMING TO"
These functions are specified by POSIX.1e.
.SH "SEE ALSO"
.IR cap_clear (3),
.IR cap_copy_ext (3),
.IR cap_from_text (3),
.IR cap_get_file (3),
.IR cap_init (3)
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
.\" $Id$
d4 1
a4 1
.TH CAP_GET_PROC 3 "26th April 1997" "" "Linux Programmer's Manual"
d6 1
a6 1
cap_get_proc, cap_set_proc \- get/set capabilities of the process
d12 4
a15 1
.BI "int cap_set_proc(cap_t " caps );
d18 9
a26 3
returns the capability sets of the process.
The returned value must later be disposed of by passing it to
.BR cap_free .
d29 11
a39 2
sets the capabilities of the process to
.IR caps .
d46 8
@
