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

NAMEcap_copy_ext, cap_size, cap_copy_int − capability state external representation translation

SYNOPSIS#include <sys/capability.h> ssize_t cap_size(cap_t cap_p); ssize_t cap_copy_ext(void *ext_p, cap_t cap_p, ssize_t size); cap_t cap_copy_int(const void *ext_p); Link with −lcap.

DESCRIPTIONThese functions translate between internal and external representations of a capability state. The external representation is an exportable, contiguous, persistent representation of a capability state in user-managed space. The internal representation is managed by the capability functions in working storage. cap_size() returns the total length (in bytes) that the capability state in working storage identified by cap_p would require when converted by cap_copy_ext(). This function is used primarily to determine the amount of buffer space that must be provided to the cap_copy_ext() function in order to hold the capability data record created from cap_p. cap_copy_ext() copies a capability state in working storage, identified by cap_p, from system-managed space to user-managed space (pointed to by ext_p) and returns the length of the resulting data record. The size parameter represents the maximum size, in bytes, of the resulting data record. The cap_copy_ext() function will do any conversions necessary to convert the capability state from the undefined internal format to an exportable, contiguous, persistent data record. It is the responsibility of the user to allocate a buffer large enough to hold the copied data. The buffer length required to hold the copied data may be obtained by a call to the cap_size() function. cap_copy_int() copies a capability state from a capability data record in user-managed space to a new capability state in working storage, allocating any memory necessary, and returning a pointer to the newly created capability state. The function initializes the capability state and then copies the capability state from the record pointed to by ext_p into the capability state, converting, if necessary, the data from a contiguous, persistent format to an undefined, internal format. Once copied into internal format, the object can be manipulated by the capability state manipulation functions (see cap_clear(3)). Note that the record pointed to by ext_p must have been obtained from a previous, successful call to cap_copy_ext() for this function to work successfully. 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.

RETURN VALUEcap_size() returns the length required to hold a capability data record on success, and −1 on failure. cap_copy_ext() returns the number of bytes placed in the user managed space pointed to by ext_p on success, and −1 on failure. cap_copy_int() returns a pointer to the newly created capability state in working storage on success, and NULL on failure. On failure, errno is set to EINVAL, ENOMEM, or ERANGE.

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

SEE ALSOlibcap(3), cap_clear(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3), cap_init(3), capabilities(7)
0
Johanes Gumabo
Data Size   :   9,329 byte
man-cap_copy_ext.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 184,583
Visitor ID   :     :  
Visitor IP   :   3.142.195.79   :  
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.05
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.