long keyctl(int cmd, ...);
DESCRIPTIONkeyctl() has a number of functions available:
- Ask for a keyring's ID.
- Join or start named session keyring.
- Update a key.
- Revoke a key.
- Set ownership of a key.
- Set perms on a key.
- Describe a key.
- Clear contents of a keyring.
- Link a key into a keyring.
- Unlink a key from a keyring.
- Search for a key in a keyring.
- Read a key or keyring's contents.
- Instantiate a partially constructed key.
- Negate a partially constructed key.
- Set default request-key keyring.
- Set timeout on a key.
- Assume authority to instantiate key.
These are wrapped by libkeyutils into individual functions to permit the compiler to check types. See the See Also section at the bottom.
RETURN VALUEOn success keyctl() returns the serial number of the key it found. On error, the value -1 will be returned and errno will have been set to an appropriate error.
- A key operation wasn't permitted.
- The key quota for the caller's user would be exceeded by creating a key or linking it to the keyring.
- An expired key was found or specified.
- A rejected key was found or specified.
- A revoked key was found or specified.
- No matching key was found or an invalid key was specified.
LINKINGAlthough this is a Linux system call, it is not present in libc but can be found rather in libkeyutils. When linking, -lkeyutils should be specified to the linker.
COLOPHONThis page is part of release 4.06 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.