2 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
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.
10 .TH KEYCTL_GET_KEYRING_ID 3 "4 May 2006" Linux "Linux Key Management Calls"
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
13 keyctl_get_keyring_ID \- Get the ID of a special keyring
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
17 .B #include <keyutils.h>
19 .BI "key_serial_t keyctl_get_keyring_ID(key_serial_t " key ","
20 .BI " int " create ");"
21 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
23 .BR keyctl_get_keyring_ID ()
26 or keyring ID to the serial number of the key actually representing that
27 feature. The serial number will be returned if that key exists.
29 If the key or keyring does not yet exist, then if
31 is non-zero, the key or keyring will be created if it is appropriate to do so.
33 The following special key IDs may be specified as
36 .B KEY_SPEC_THREAD_KEYRING
37 This specifies the caller's thread-specific keyring.
39 .B KEY_SPEC_PROCESS_KEYRING
40 This specifies the caller's process-specific keyring.
42 .B KEY_SPEC_SESSION_KEYRING
43 This specifies the caller's session-specific keyring.
45 .B KEY_SPEC_USER_KEYRING
46 This specifies the caller's UID-specific keyring.
48 .B KEY_SPEC_USER_SESSION_KEYRING
49 This specifies the caller's UID-session keyring.
51 .B KEY_SPEC_REQKEY_AUTH_KEY
52 This specifies the authorisation key created by
54 and passed to the process it spawns to generate a key.
56 If a valid keyring ID is passed in, then this will simply be returned if the
57 key exists; an error will be issued if it doesn't exist.
58 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
61 .BR keyctl_get_keyring_ID ()
62 returns the serial number of the key it found. On error, the value
64 will be returned and errno will have been set to an appropriate error.
65 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
69 No matching key was found.
72 Insufficient memory to create a key.
75 The key quota for this user would be exceeded by creating this key or linking
77 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
79 This is a library function that can be found in
83 should be specified to the linker.
84 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""