1KEYCTL_GET_KEYRING_ID(3)  Linux Key Management Calls  KEYCTL_GET_KEYRING_ID(3)
2
3
4

NAME

6       keyctl_get_keyring_ID - Get the ID of a special keyring
7

SYNOPSIS

9       #include <keyutils.h>
10
11       key_serial_t keyctl_get_keyring_ID(key_serial_t key,
12        int create);
13

DESCRIPTION

15       keyctl_get_keyring_ID()  maps a special key or keyring ID to the serial
16       number of the key actually representing that feature.  The serial  num‐
17       ber will be returned if that key exists.
18
19       If  the  key or keyring does not yet exist, then if create is non-zero,
20       the key or keyring will be created if it is appropriate to do so.
21
22       The following special key IDs may be specified as key:
23
24       KEY_SPEC_THREAD_KEYRING
25              This specifies the caller's thread-specific keyring.
26
27       KEY_SPEC_PROCESS_KEYRING
28              This specifies the caller's process-specific keyring.
29
30       KEY_SPEC_SESSION_KEYRING
31              This specifies the caller's session-specific keyring.
32
33       KEY_SPEC_USER_KEYRING
34              This specifies the caller's UID-specific keyring.
35
36       KEY_SPEC_USER_SESSION_KEYRING
37              This specifies the caller's UID-session keyring.
38
39       KEY_SPEC_REQKEY_AUTH_KEY
40              This specifies the authorisation key  created  by  request_key()
41              and passed to the process it spawns to generate a key.
42
43       If  a  valid keyring ID is passed in, then this will simply be returned
44       if the key exists; an error will be issued if it doesn't exist.
45

RETURN VALUE

47       On success keyctl_get_keyring_ID() returns the serial number of the key
48       it  found.  On error, the value -1 will be returned and errno will have
49       been set to an appropriate error.
50

ERRORS

52       ENOKEY No matching key was found.
53
54       ENOMEM Insufficient memory to create a key.
55
56       EDQUOT The key quota for this user would be exceeded by  creating  this
57              key or linking it to the keyring.
58

LINKING

60       This  is  a  library  function  that can be found in libkeyutils.  When
61       linking, -lkeyutils should be specified to the linker.
62

SEE ALSO

64       keyctl(1),
65       add_key(2),
66       keyctl(2),
67       request_key(2),
68       keyctl_join_session_keyring(3),
69       keyctl_update(3),
70       keyctl_revoke(3),
71       keyctl_chown(3),
72       keyctl_setperm(3),
73       keyctl_describe(3),
74       keyctl_clear(3),
75       keyctl_link(3),
76       keyctl_unlink(3),
77       keyctl_search(3),
78       keyctl_read(3),
79       keyctl_instantiate(3),
80       keyctl_negate(3),
81       keyctl_set_reqkey_keyring(3),
82       keyctl_set_timeout(3),
83       keyctl_assume_authority(3),
84       keyctl_describe_alloc(3),
85       keyctl_read_alloc(3),
86       request-key(8)
87
88
89
90Linux                             4 May 2006          KEYCTL_GET_KEYRING_ID(3)
Impressum