Debian Codegraph @

upstream/debian-unstable/man2/KEYCTL_UPDATE.2const

raw
1 .\" Copyright 2016, Michael Kerrisk <[email protected]>
2 .\" Copyright 2016, Eugene Syromyatnikov <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH KEYCTL_UPDATE 2const 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 KEYCTL_UPDATE
10 \-
11 update a key's data payload
12 .SH LIBRARY
13 Standard C library
14 .RI ( libc ,\~ \-lc )
15 .SH SYNOPSIS
16 .nf
17 .BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */"
18 .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
19 .B #include <unistd.h>
20 .P
21 .BR "long syscall(" "size_t size;"
22 .BI " SYS_keyctl, KEYCTL_UPDATE, key_serial_t " key ,
23 .BI " void " payload [ size "], size_t " size );
24 .fi
25 .SH DESCRIPTION
26 Update a key's data payload.
27 .P
28 .I key
29 specifies the ID of the key to be updated.
30 .I payload
31 points to the new payload and
32 .I size
33 contains the new payload size in bytes.
34 .P
35 The caller must have
36 .I write
37 permission on the key specified and the key type must support updating.
38 .P
39 A negatively instantiated key
40 (see
41 .BR KEYCTL_REJECT (2const))
42 can be positively instantiated with this operation.
43 .SH RETURN VALUE
44 On success,
45 0 is returned.
46 .P
47 On error, \-1 is returned, and
48 .I errno
49 is set to indicate the error.
50 .SH ERRORS
51 .TP
52 The key type does not support updating.
53 .SH VERSIONS
54 A wrapper is provided in the
55 .I libkeyutils
56 library:
57 .BR keyctl_update (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_update (3)