KEYCTL_UPDATE(2const)
β¨ KEYCTL_UPDATE π
okay bestie, so this whole page is from the Linux man-pages set, and it's a 2const page β that means it's not its own syscall, it's one of the constants you shove into the keyctl syscall to tell it what to do. This one is KEYCTL_UPDATE, and fr fr it's giving "change the contents of a key". Let's get into it. π
πΈ NAME πΈ
KEYCTL_UPDATE β update a key's data payload
Like, you've got a key, it's got some data in it, and you want to swap that data out. That's the whole vibe. π¦
π LIBRARY π
Standard C library (libc, -lc)
π SYNOPSIS π
#include <linux/keyctl.h> /* Definition of KEY* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
long syscall(size_t size;
SYS_keyctl, KEYCTL_UPDATE, key_serial_t key,
void payload[size], size_t size);
no cap, that's exactly how you call it. SYS_keyctl + KEYCTL_UPDATE + your args, and the libc syscall() wrapper does the rest. β¨
π DESCRIPTION π
Update a key's data payload. Simple as that. π«Ά
keyβ the ID of the key you're updating. This is your target, your main character.payloadβ points to the new payload you want to put in there.sizeβ the new payload size, in bytes.
The caller must have write permission on the key specified, okay? Like you can't just go editing other people's keys. Rude. π And the key type must support updating β some types literally do not, and they will not be taking notes.
Also super important cutie: a negatively instantiated key (aka the sad rejected kind, see KEYCTL_REJECT(2const)) can be positively instantiated with this operation. Glow-up arc, honestly. π
π RETURN VALUE π
- On success,
0is returned. π₯³ - On error,
-1is returned, anderrnois set to indicate the error. π
π ERRORS π
- The key type does not support updating.
That's it. That's the list. If your key type is one of the no-update-allowed ones, this is the wall you hit. π§±
β VERSIONS β
A wrapper is provided in the libkeyutils library: keyctl_update(3). So like, if you don't wanna rawdog the syscall, use that. π
πΈ STANDARDS πΈ
Linux.
π¦ HISTORY π¦
Linux 2.6.10.
π SEE ALSO π
okay that's the whole page bestie, go forth and update those payloads responsibly. And just so you know where all this lore came from: it's Linux man-pages 6.20, dated 2026-02-08, and the page title is KEYCTL_UPDATE(2const). slay πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2016, Michael Kerrisk <mtk.manpages@gmail.com>
- Copyright 2016, Eugene Syromyatnikov <evgsyr@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms