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,
0is returned. slay β¨ - On error,
-1is returned, anderrnois set to indicate the error. (checkerrno, 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
- 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