These are wrapped by libkeyutils into individual functions to permit compiler the compiler to check types. See the See Also section at the bottom.
返回值
On success keyctl() returns the serial number of the key it found. On error, the value -1will be returned and errno will have been set to an appropriate error.
错误
标签
描述
ENOKEY
No matching key was found or an invalid key was specified.
EKEYEXPIRED
An expired key was found or specified.
EKEYREVOKED
A revoked key was found or specified.
EKEYREJECTED
A rejected key was found or specified.
EDQUOT
The key quota for the caller’s user would be exceeded by creating a key or linking it to the keyring.
EACCES
A key operation wasn’t permitted.
LINKING
Although this is a Linux system call, it is not present in libc but can be found rather inlibkeyutils. When linking, -lkeyutils should be specified to the linker.