wait.2: Add ESRCH for when pid == INT_MIN
[man-pages.git] / man7 / process-keyring.7
blobb586e495493817fb9a4b8c8740a60cd393c22783
1 .\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
2 .\" Written by David Howells (dhowells@redhat.com)
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License
7 .\" as published by the Free Software Foundation; either version
8 .\" 2 of the License, or (at your option) any later version.
9 .\" %%%LICENSE_END
10 .\"
11 .TH PROCESS-KEYRING 7 2020-08-13 Linux "Linux Programmer's Manual"
12 .SH NAME
13 process-keyring \- per-process shared keyring
14 .SH DESCRIPTION
15 The process keyring is a keyring used to anchor keys on behalf of a process.
16 It is created only when a process requests it.
17 The process keyring has the name (description)
18 .IR _pid .
19 .PP
20 A special serial number value,
21 .BR KEY_SPEC_PROCESS_KEYRING ,
22 is defined that can be used in lieu of the actual serial number of
23 the calling process's process keyring.
24 .PP
25 From the
26 .BR keyctl (1)
27 utility, '\fB@p\fP' can be used instead of a numeric key ID in
28 much the same way, but since
29 .BR keyctl (1)
30 is a program run after forking, this is of no utility.
31 .PP
32 A thread created using the
33 .BR clone (2)
34 .B CLONE_THREAD
35 flag has the same process keyring as the caller of
36 .BR clone (2).
37 When a new process is created using
38 .BR fork ()
39 it initially has no process keyring.
40 A process's process keyring is cleared on
41 .BR execve (2).
42 The process keyring is destroyed when the last
43 thread that refers to it terminates.
44 .PP
45 If a process doesn't have a process keyring when it is accessed,
46 then the process keyring will be created if the keyring is to be modified;
47 otherwise, the error
48 .B ENOKEY
49 results.
50 .SH SEE ALSO
51 .ad l
52 .nh
53 .BR keyctl (1),
54 .BR keyctl (3),
55 .BR keyrings (7),
56 .BR persistent\-keyring (7),
57 .BR session\-keyring (7),
58 .BR thread\-keyring (7),
59 .BR user\-keyring (7),
60 .BR user\-session\-keyring (7)