KEYCTL_REVOKE(2const)

πŸ’… KEYCTL_REVOKE β€” revoke a key

okay bestie, so this is a page from the Linux man-pages (that's the manual name, mwah) and it's all about KEYCTL_REVOKE. yes it's a keyctl thing. yes it's iconic. let's go πŸ¦‹


✨ LIBRARY ✨

Standard C library (libc, -lc) β€” the moment you link -lc, she's there for you 🫢


🌸 SYNOPSIS 🌸

#include <linux/keyctl.h>  /* Definition of KEY* constants */
#include <sys/syscall.h>   /* Definition of SYS_* constants */
#include <unistd.h>

long syscall(SYS_keyctl, KEYCTL_REVOKE, key_serial_t key);

like… that's the whole vibe. one syscall, one key_serial_t key, and the deed is done πŸ”₯


πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea: KEYCTL_REVOKE revokes the key with the ID you hand over in key. That key is getting scheduled for garbage collection β€” it is no longer findable, bestie, it's unavailable for further operations, it said "I'm leaving and I'm not coming back" πŸ’€

And if anybody tries to use that key afterwards? They get hit with the error EKEYREVOKED. that's the vibe check failing fr fr 😭

Also, lowkey important: the caller must have write or setattr permission on the key. no permission, no revoke, no cap.

🌈 RETURN VALUE 🌈

  • On success, 0 is returned. slay ✨
  • On error, -1 is returned, and errno is set to indicate the error. (check errno, she tells you everything πŸ‘€)

πŸŽ€ VERSIONS πŸŽ€

A wrapper is provided in the libkeyutils library: keyctl_revoke(3). so if you don't wanna do the raw syscall() thing, that's your girly 🫢


⭐ STANDARDS ⭐

Linux. that's it, that's the standard πŸ’…


🧚 HISTORY 🧚

Linux 2.6.10 β€” she's been around, she's a legacy icon πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


πŸ’– okay that's the whole page! go forth and revoke responsibly, bestie β€” and remember: the key will not come back. periodt.

this was brought to you by Linux man-pages 6.20, dated 2026-02-08 🌸 mwah, bye!! πŸ¦‹

πŸ“¦ 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