From c2bd9d60a1428fb886200dcba46a26be9871c5f6 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 2 Nov 2016 15:19:22 +0100 Subject: [PATCH] thread-keyring.7: Various rewordings and additions Signed-off-by: Michael Kerrisk --- man7/thread-keyring.7 | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/man7/thread-keyring.7 b/man7/thread-keyring.7 index 24eccd6c6..a82dae024 100644 --- a/man7/thread-keyring.7 +++ b/man7/thread-keyring.7 @@ -15,27 +15,32 @@ thread-keyring \- per-thread keyring .SH 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. -.P + A special serial number value, .BR KEY_SPEC_THREAD_KEYRING , -is defined that -can be used in lieu of the calling thread's thread keyring's actual serial -number. -.P -From the keyctl utility, '\fB@t\fP' can be used instead of a numeric key ID in -much the same way, but as keyctl is a program run after forking, this is of no -utility. -.P +is defined that can be used in lieu of the actual serial number of +the calling thread's thread keyring. + +From the +.BR keyctl (1) +utility, '\fB@t\fP' can be used instead of a numeric key ID in +much the same way, but as +.BR keyctl (1) +is a program run after forking, this is of no utility. + Thread keyrings are not inherited across .BR clone (2) +and +.BR fork (2) and are cleared by .BR execve (2). -A thread keyring is destroyed when the thread that refers to it exits. -.P -If a thread doesn't have a thread keyring when it is accessed, then the thread -keyring will be created if the keyring is to be modified, otherwise error -.B ENOKEY -will be issued. +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 will fail with the error +.BR ENOKEY . .SH SEE ALSO .ad l .nh