Debian Codegraph @

upstream/fedora-44/man2const/KEYCTL_UNLINK.2const

raw
1 .\" Copyright 2016, Michael Kerrisk <[email protected]>
2 .\" Copyright 2016, Eugene Syromyatnikov <[email protected]>
3 .\" A very few fragments remain from an earlier version of this page
4 .\" written by David Howells ([email protected])
5 .\" Copyright 2024, Alejandro Colomar <[email protected]>
6 .\"
7 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\"
9 .TH KEYCTL_UNLINK 2const 2024-08-21 "Linux man-pages 6.13"
10 .SH NAME
11 KEYCTL_UNLINK
12 \-
13 unlink a key from a keyring
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ,\~ \-lc )
17 .SH SYNOPSIS
18 .nf
19 .BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */"
20 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
21 .B #include <unistd.h>
22 .P
23 .BI "long syscall(SYS_keyctl, KEYCTL_UNLINK, key_serial_t " key ,
24 .BI " key_serial_t " keyring );
25 .fi
26 .SH DESCRIPTION
27 Unlink a key from a keyring.
28 .P
29 The ID of the key to be unlinked is specified in
30 .IR key ;
31 the ID of the keyring from which it is to be unlinked is specified in
32 .IR keyring .
33 .P
34 If the key is not currently linked into the keyring, an error results.
35 .P
36 The caller must have
37 .I write
38 permission on the keyring from which the key is being removed.
39 .P
40 If the last link to a key is removed,
41 then that key will be scheduled for destruction.
42 .SH RETURN VALUE
43 On success,
44 0 is returned.
45 .P
46 On error, \-1 is returned, and
47 .I errno
48 is set to indicate the error.
49 .SH ERRORS
50 .TP
51 .B ENOENT
52 The key to be unlinked isn't linked to the keyring.
53 .SH VERSIONS
54 A wrapper is provided in the
55 .I libkeyutils
56 library:
57 .BR keyctl_unlink (3).
58 .SH STANDARDS
59 Linux.
60 .SH HISTORY
61 Linux 2.6.10.
62 .SH SEE ALSO
63 .BR keyctl (2),
64 .BR keyctl_unlink (3),
65 .BR KEYCTL_LINK (2const)