keyctl_get_persistent() gets the persistent keyring for the specified
user ID. Unlike the session and user keyrings, this keyring will
persist once all login sessions have been deleted and can thus be
used to carry authentication tokens for processes that run without
user interaction, such as programs started by cron.
The persistent keyring will be created by the kernel if it does not
yet exist. Each time this function is called, the persistent keyring
will have its expiration timeout reset to the value in:
(by default three days). Should the timeout be reached, the
persistent keyring will be removed and everything it pins can then be
If uid is -1 then the calling process's real user ID will be used.
If uid is not -1 then error EPERM will be given if the user ID
requested does not match either the caller's real or effective user
IDs or if the calling process does not have SetUid capability.
If successful, a link to the persistent keyring will be added into
EPERM Not permitted to access the persistent keyring for the
ENOMEM Insufficient memory to create the persistent keyring or to
ENOKEY keyring does not exist.
EKEYEXPIREDkeyring has expired.
EKEYREVOKEDkeyring has been revoked.
EDQUOT The user does not have sufficient quota to extend keyring.
EACCES keyring exists, but does not grant write permission to the
This page is part of the keyutils (key management utilities) project.
Information about the project can be found at [unknown -- if you
know, please contact email@example.com] If you have a bug report for
this manual page, send it to firstname.lastname@example.org. This page was
obtained from the project's upstream Git repository
on 2017-03-13. If you discover any rendering problems in this HTML
version of the page, or you believe there is a better or more up-to-
date source for the page, or you have corrections or improvements to
the information in this COLOPHON (which is not part of the original
manual page), send a mail to email@example.com
Linux 20 Feb 2014 KEYCTL_GET_PERSISTENT(3)