# phpman > man > THREAD-KEYRING(7)

[THREAD-KEYRING(7)](https://www.chedong.com/phpMan.php/man/THREAD-KEYRING/7/markdown)                     Linux Programmer's Manual                    [THREAD-KEYRING(7)](https://www.chedong.com/phpMan.php/man/THREAD-KEYRING/7/markdown)



## NAME
       thread-keyring - per-thread keyring

## DESCRIPTION
       The  thread  keyring  is a keyring used to anchor keys on behalf of a process.  It is created
       only when a thread requests it.  The thread keyring has the name (description) __tid_.

       A special serial number value, **KEY**___**SPEC**___**THREAD**___**KEYRING**, is defined that can be used  in  lieu
       of the actual serial number of the calling thread's thread keyring.

       From  the  [**keyctl**(1)](https://www.chedong.com/phpMan.php/man/keyctl/1/markdown)  utility,  '**@t**' can be used instead of a numeric key ID in much the same
       way, but as [**keyctl**(1)](https://www.chedong.com/phpMan.php/man/keyctl/1/markdown) is a program run after forking, this is of no utility.

       Thread keyrings are not inherited across [**clone**(2)](https://www.chedong.com/phpMan.php/man/clone/2/markdown) and [**fork**(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown) and are cleared  by  [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown).
       A thread keyring is destroyed when the thread that refers to it terminates.

       Initially,  a  thread  does  not  have  a  thread keyring.  If a thread doesn't have a thread
       keyring when it is accessed, then it will be created if it is to be modified;  otherwise  the
       operation fails with the error **ENOKEY**.

## SEE ALSO
       [**keyctl**(1)](https://www.chedong.com/phpMan.php/man/keyctl/1/markdown), [**keyctl**(3)](https://www.chedong.com/phpMan.php/man/keyctl/3/markdown), [**keyrings**(7)](https://www.chedong.com/phpMan.php/man/keyrings/7/markdown), [**persistent-keyring**(7)](https://www.chedong.com/phpMan.php/man/persistent-keyring/7/markdown), [**process-keyring**(7)](https://www.chedong.com/phpMan.php/man/process-keyring/7/markdown),
       [**session-keyring**(7)](https://www.chedong.com/phpMan.php/man/session-keyring/7/markdown), [**user-keyring**(7)](https://www.chedong.com/phpMan.php/man/user-keyring/7/markdown), [**user-session-keyring**(7)](https://www.chedong.com/phpMan.php/man/user-session-keyring/7/markdown)

## COLOPHON
       This page is part of release 5.10 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/>.



Linux                                        2020-08-13                            [THREAD-KEYRING(7)](https://www.chedong.com/phpMan.php/man/THREAD-KEYRING/7/markdown)
