cap_init   Début   Suivant   Sommaire   Préc.page.lue   Accueil
Section: Linux Programmer's Manual (3)
Updated: 26th May 1997
Sommaire  



NAME   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
cap_init, cap_free, cap_dup - capability data object storage management  



SYNOPSIS   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
#include <sys/capability.h>

cap_t cap_init(void);

int cap_free(void *obj_d);

cap_t cap_dup(cap_t cap_p);  




USAGE   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

cc ... -lcap  



DESCRIPTION   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
The capabilities associated with a file or process are never edited directly. Instead, working storage is allocated to contain a representation of the capability state. Capabilities are edited and manipulated only within this working storage area. Once editing of the capability state is complete, the updated capability state is used to replace the capability state associated with the file or process.

cap_init creates a capability state in working storage and return a pointer to the capability state. The initial value of all flags are cleared. The caller should free any releasable memory, when the capability state in working storage is no longer required, by calling cap_free with the cap_t as an argument.

cap_free liberates any releasable memory that has been allocated to the capability state identified by obj_d. The obj_d argument may identify either a cap_t entity, or a char * entity allocated by the cap_to_text function.

cap_dup returns a duplicate capability state in working storage given by the source object cap_p, allocating any memory necessary, and returning a pointer to the newly created capability state. Once duplicated, no operation on either capability state affects the other in any way.  




RETURN VALUE   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
cap_init and cap_dup return a non-NULL value on success, and NULL on failure.

cap_free returns zero on success, and -1 on failure.

On failure, errno(3) is set to EINVAL, or ENOMEM.  




CONFORMING TO   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
These functions are specified by POSIX.1e.  



SEE ALSO   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
cap_clear(3), cap_copy_ext(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3)


 



Sommaire   Début   Suivant   Sommaire   Préc.page.lue   Accueil
NAME
SYNOPSIS
USAGE
DESCRIPTION
RETURN VALUE
CONFORMING TO
SEE ALSO

Ce document a été créé par man2html suivi de man2html.pl, le 17/10/2008 17:52:04, en utilisant les pages de 'man'.
 

Valid HTML 4.01 Transitional