KEYCTL_GET_KEYRING_ID
map a special key ID to a real key ID for this process
- Provided by: manpages-dev (Version: 6.17-1)
- Source: manpages
- Report a bug
map a special key ID to a real key ID for this process
Standard C library (libc, -lc)
#include <linux/keyctl.h> /* Definition of KEY* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h>
long syscall(SYS_keyctl, KEYCTL_GET_KEYRING_ID, key_serial_t key,
int arg3);
Map a special key ID to a real key ID for this process.
This operation looks up the special key whose ID is provided in key. If the special key is found, the ID of the corresponding real key is returned as the function result. The following values may be specified in key:
The behavior if the key specified in key does not exist depends on the value of arg3. If arg3 contains a nonzero value, then —if it is appropriate to do so (e.g., when looking up the user, user-session, or session key)— a new key is created and its real key ID returned as the function result. Otherwise, the operation fails with the error ENOKEY.
If a valid key ID is specified in key, and the key exists, then this operation simply returns the key ID. If the key does not exist, the call fails with error ENOKEY.
The caller must have search permission on a keyring in order for it to be found.
On success, the ID of the requested keyring.
On error, -1 is returned, and errno is set to indicate the error.
A wrapper is provided in the libkeyutils library: keyctl_get_keyring_ID(3).
Linux.
Linux 2.6.10.