KEYCTL_CLEAR(3)

πŸ“¦
version 1.6.3 Β· 2 versions
  • 1.6.3 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.6.1 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ KEYCTL_CLEAR(3) ✨

okay so bestie, welcome to the Linux Key Management Calls corner of the manual, where we talk about keyctl_clear β€” the girl whose whole job is clearing a keyring. that's it. that's the gig. πŸ’…


🌸 NAME 🌸

keyctl_clear β€” clear a keyring πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <keyutils.h>

long keyctl_clear(key_serial_t keyring);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically keyctl_clear() clears the contents of a keyring. boom. empty. gone. iconic ✨

but hold up β€” the caller must have write permission on a keyring to be able to clear it. no write permission, no clearing, no exceptions, no cap. πŸ”’


πŸ’œ RETURN VALUE πŸ’œ

  • on success, keyctl_clear() returns 0 🫢
  • on error, the value -1 will be returned and errno will have been set to an appropriate error 😭

πŸ’€ ERRORS πŸ’€

  • ENOKEY β€” the keyring specified is invalid. it's giving "who? never heard of her" πŸ™ˆ
  • EKEYEXPIRED β€” the keyring specified has expired. she's done, she's moved on ⏳
  • EKEYREVOKED β€” the keyring specified had been revoked. cancelled, fr fr 🚫
  • EACCES β€” the keyring exists, but is not writable by the calling process. she's real, she's just not letting you in πŸ’…

πŸ”— LINKING πŸ”—

this is a library function that can be found in libkeyutils. when linking, -lkeyutils should be specified to the linker. don't forget it bestie, or the linker will simply not know her 😀


πŸ‘€ SEE ALSO πŸ‘€

keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3), keyrings(7), keyutils(7)


and that's the whole page, babe πŸ§šπŸ’– this one's from the Linux crew, dated 4 May 2006 β€” yeah she's vintage, and she still ate. periodt. πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from