Add PIE compilation flags
[platform/upstream/keyutils.git] / keyctl_set_reqkey_keyring.3
1 .\"
2 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
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 .\"
10 .TH KEYCTL_SET_REQKEY_KEYRING 3 "4 May 2006" Linux "Linux Key Management Calls"
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
12 .SH NAME
13 keyctl_set_reqkey_keyring \- Set the implicit destination keyring
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 .SH SYNOPSIS
16 .nf
17 .B #include <keyutils.h>
18 .sp
19 .BI "long keyctl_set_reqkey_keyring(int " reqkey_defl ");"
20 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
21 .SH DESCRIPTION
22 .BR keyctl_set_reqkey_keyring ()
23 sets the default destination for implicit key requests for the current thread
24 and returns the old setting.
25 .P
26 After this operation has been issued, keys acquired by implicit key requests,
27 such as might be performed by open() on an AFS or NFS filesystem, will be
28 linked by default to the specified keyring by this function.
29 .P
30 The valid values of
31 .I reqkey_defl
32 are:
33 .TP
34 .B KEY_REQKEY_DEFL_NO_CHANGE
35 This makes no change to the current setting.
36 .TP
37 .B KEY_REQKEY_DEFL_THREAD_KEYRING
38 This makes the thread-specific keyring the default destination.
39 .TP
40 .B KEY_REQKEY_DEFL_PROCESS_KEYRING
41 This makes the process-specific keyring the default destination.
42 .TP
43 .B KEY_REQKEY_DEFL_SESSION_KEYRING
44 This makes the session keyring the default destination.
45 .TP
46 .B KEY_REQKEY_DEFL_USER_KEYRING
47 This makes the UID-specific keyring the default destination.
48 .TP
49 .B KEY_REQKEY_DEFL_USER_SESSION_KEYRING
50 This makes the UID-specific session keyring the default destination.
51 .TP
52 .B KEY_REQKEY_DEFL_DEFAULT
53 This selects the default behaviour which is to use the thread-specific keyring
54 if there is one, otherwise the process-specific keyring if there is one,
55 otherwise the session keyring if there is one, otherwise the UID-specific
56 session keyring.
57 .P
58 This setting is inherited across
59 .BR fork ()
60 and
61 .BR exec ().
62
63 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
64 .SH RETURN VALUE
65 On success
66 .BR keyctl_set_reqkey_keyring ()
67 returns
68 .BR 0 .
69 On error, the value
70 .B -1
71 will be returned and errno will have been set to an appropriate error.
72 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
73 .SH ERRORS
74 .TP
75 .B EINVAL
76 The value of
77 .I reqkey_defl
78 is invalid.
79 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
80 .SH LINKING
81 This is a library function that can be found in
82 .IR libkeyutils .
83 When linking,
84 .B -lkeyutils
85 should be specified to the linker.
86 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
87 .SH SEE ALSO
88 .BR keyctl (1),
89 .br
90 .BR add_key (2),
91 .br
92 .BR keyctl (2),
93 .br
94 .BR request_key (2),
95 .br
96 .BR keyctl (3),
97 .br
98 .BR request-key (8)