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, 0 is returned. πŸ₯³
  • On error, -1 is returned, and errno is 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms