vhangup(2)
โจ vhangup(2) โ virtually hangup the current terminal โจ
okay bestie, so this is vhangup, from section 2 of the Linux manual (that's the system calls girlies ๐
). Buckle up, it's a short one but it's iconic.
๐ NAME ๐
vhangup โ virtually hangup the current terminal
๐ธ LIBRARY ๐ธ
Standard C library (libc, -lc). yes queen, you just link it like normal ๐ซถ
โจ SYNOPSIS โจ
#include <unistd.h>
int vhangup(void);
๐ Feature Test Macro Requirements for glibc ๐
(peep feature_test_macros(7) if you wanna know the whole lore)
For vhangup():
- Since glibc 2.21:
_DEFAULT_SOURCE
- In glibc 2.19 and 2.20:
_DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
- Up to and including glibc 2.19:
_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
like, the vibes of these macros changed over the glibc eras, okay? don't @ me, just define the right one ๐ฅ
๐ DESCRIPTION ๐
vhangup() simulates a hangup on the current terminal. basically it's giving "you don't get to linger here" energy ๐
This call arranges for other users to have a "clean" terminal at login time. so when the next person logs in, they get a fresh, untouched tty โ no leftover nonsense from whoever was there before. immaculate. pristine. main character terminal ๐โจ
๐ฆ RETURN VALUE ๐ฆ
- On success, zero is returned. slay ๐
- On error, -1 is returned, and
errnois set to indicate the error. not slay ๐ญ
๐ ERRORS ๐
EPERMโ The calling process has insufficient privilege to callvhangup(); theCAP_SYS_TTY_CONFIGcapability is required. so likeโฆ you need the keys to the kingdom, bestie. no cap, this one's a privileged move ๐
๐ STANDARDS ๐
Linux. periodt. ๐
๐ฅ SEE ALSO ๐ฅ
ngl this syscall is short but she is powerful โ messing with terminals at login means you better know exactly what you're doing, so double-check that CAP_SYS_TTY_CONFIG before you go feral ๐
and that's the whole page, bestie ๐ this one came straight from the Linux man-pages 6.20, dated 2026-02-08. go forth and hang up those terminals (virtually). bye ilysm ๐ซถโจ
๐ฆ 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 1993, Rickard E. Faith <faith@cs.unc.edu>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms