CAP_INIT - Online Linux Manual PageSection : 3
Updated : 2008-05-11
Source :
Note : Linux Programmer's Manual

NAMEcap_init, cap_free, cap_dup − capability data object storage management

SYNOPSIS#include <sys/capability.h> cap_t cap_init(void); int cap_free(void *obj_d); cap_t cap_dup(cap_t cap_p); Link with −lcap.

DESCRIPTIONThe 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 returns 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. When the duplicated capability state in working storage is no longer required, the caller should free any releasable memory by calling cap_free() with the cap_t as an argument.

RETURN VALUEcap_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 is set to EINVAL or ENOMEM.

CONFORMING TOThese functions are specified in the withdrawn POSIX.1e draft specification.

SEE ALSOlibcap(3), cap_clear(3), cap_copy_ext(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3), capabilities(7)
0
Johanes Gumabo
Data Size   :   7,225 byte
man-cap_free.3Build   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   5 / 259,933
Visitor ID   :     :  
Visitor IP   :   3.15.144.162   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.