1
0
Files
irix-657m-src/eoe/man/man3c/cap_get_proc.3c
2022-09-29 17:59:04 +03:00

74 lines
2.0 KiB
Plaintext

'\"macro stdmacro
.if n .pH g3C.cap_get_proc
.nr X
.if \nX=0 .ds x} CAP_GET_PROC 3C "Capabilities Library Routines" "\&"
.if \nX=1 .ds x} CAP_GET_PROC 3C "Capabilities Library Routines"
.if \nX=2 .ds x} CAP_GET_PROC 3C "" "\&"
.if \nX=3 .ds x} CAP_GET_PROC "" "" "\&"
.TH \*(x}
.SH NAME
.upperok
cap_get_proc, cap_set_proc, cap_set_proc_flags \- get or set process capabilities
.SH SYNOPSIS
.B #include <sys/capability.h>
.PP
.B cap_t cap_get_proc();
.br
.B int cap_set_proc(cap_t cap);
.br
.B int cap_set_proc_flags(cap_value_t flags);
.SH DESCRIPTION
.I cap_get_proc
returns a pointer to an allocated \f2cap_t\fP associated with the
process.
.PP
.I cap_set_proc
sets the capabilities for the process from the
\f2cap_t cap\fP.
If any flag in \f2cap\fP is set for any
capability not currently permitted for the calling process, the function
fails, and the capability state of the process shall remain
unchanged.
.PP
.I cap_set_proc_flags
sets the capability state flags for the process from the
\f2cap_value_t flags\fP.
If the value of \f2flags\fP is \f3CAP_FLAG_PURE_RECALC\fP capabilities
will not be inherited through \f2exec\fP(2) unless the program file
has a capability set associated with it.
.SH RETURN VALUES
.I cap_get_proc
returns a pointer to an allocated \f2cap_t\fP if successful, NULL otherwise.
The storage should be freed with a call to \f2cap_free\fP with the returned
pointer as an argument when it is no longer needed.
.PP
.I cap_set_proc
and
.I cap_set_proc_flags
return 0 if successful, -1 otherwise.
.SH ERRORS
.I cap_get_proc:
.TP 16
ENOMEM
allocation of the \f2cap_t\fP failed.
.PP
.I cap_set_proc:
.TP 16
EINVAL
\f2cap\fP is not valid
.TP 16
EPERM
The caller attempted to set a capability flag of a capability that was not
permitted to the invoking process.
.TP 15
ENOMEM
The function requires more memory than is allowed
by the hardware or system-imposed memory management constraints.
.PP
.I cap_set_proc:
.TP 16
EINVAL
\f2flags\fP is not valid
.SH SEE ALSO
capabilities(4)