KEYCTL_SET_TIMEOUT(3)
π KEYCTL_SET_TIMEOUT(3) π
okay bestie, welcome to section 3 of the Linux Key Management Calls β this one's all about giving your keys a lil expiration timer β°β¨
πΈ NAME πΈ
keyctl_set_timeout β set the expiration timer on a key π
β¨ SYNOPSIS β¨
#include <keyutils.h>
long keyctl_set_timeout(key_serial_t key, unsigned timeout);
π DESCRIPTION π
so basically, keyctl_set_timeout() sets the expiration timer on a key to timeout seconds into the future. like, you're picking a countdown for it π°οΈ
and if you set timeout to zero? that cancels the expiration entirely β assuming the key hasn't already expired, bestie. no takebacks if it's already gone π
once the key expires, any further attempts to access it will be met with error EKEYEXPIRED. it's giving locked out of your own notes app π
also important: the caller must have setattr permission on the key to be able to change its permissions mask. no permission, no party π«
β RETURN VALUE β
on success, keyctl_set_timeout() returns 0. slay β¨
on error, the value -1 will be returned and errno will have been set to an appropriate error. not slay π
π₯ ERRORS π₯
ENOKEYβ the specified key does not exist. it's not there, girl, it never was πEKEYEXPIREDβ the specified key has already expired. too late bestie, the timer already ran out β³EKEYREVOKEDβ the specified key has been revoked. it's been cancelled, we don't talk to it anymore πEACCESβ the named key exists, but does not grantsetattrpermission to the calling process. it's there but it said no π
π¦ LINKING π¦
this is a library function that can be found in libkeyutils. so when you're linking, you gotta pass -lkeyutils to the linker, periodt π
π SEE ALSO π
keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3), keyrings(7), keyutils(7)
and that's the whole page, bestie π«Ά this one came from the Linux key management crew, version dated 4 May 2006, filed under KEYCTL_SET_TIMEOUT(3) β go set some timeouts, ily, mwah πππ¦
π¦ where this page comes from
- alpine 3.22: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.23: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.24: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- arch rolling: keyutils 1.6.3-4 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: keyutils-libs-devel 1.6.3-5.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- debian bookworm: libkeyutils-dev 1.6.3-2 Β· GPL-2.0-or-later
- debian trixie: libkeyutils-dev 1.6.3-6 Β· GPL-2.0-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: keyutils 1.6.3
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu noble: libkeyutils-dev 1.6.3-3build1 Β· GPL-2.0-or-later
- ubuntu questing: libkeyutils-dev 1.6.3-6ubuntu2
- ubuntu resolute: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- ubuntu stonking: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- Copyright (C) 2006 Red Hat, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms