sgetmask(2)
β¨ sgetmask β manipulation of signal mask (obsolete) β¨
okay bestie, welcome to the sgetmask(2) page, aka the System Calls Manual's most "grandma keeps emailing me" era entry π it's the sgetmask and ssetmask duo and they are, and I cannot stress this enough, obsolete.
π LIBRARY π
Standard C library (libc, -lc) π«Ά
π¦ SYNOPSIS π¦
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
[[deprecated]] long syscall(SYS_sgetmask, void);
[[deprecated]] long syscall(SYS_ssetmask, long newmask);
πΈ DESCRIPTION πΈ
So here's the tea, and the tea is piping hot: these system calls are obsolete. Do not use them. Use sigprocmask(2) instead, no cap. π
βοΈ
sgetmask() returns the signal mask of the calling process. that's it, that's the whole vibe. β¨
ssetmask() sets the signal mask of the calling process to the value given in newmask. and it hands you back the previous signal mask, like a little souvenir π
the signal masks these two deal with are just plain bit masks β unlike the sigset_t that sigprocmask(2) uses. if you wanna create and inspect these masks, use sigmask(3). that's the whole toolset, bestie π§
π RETURN VALUE π
sgetmask() always successfully returns the signal mask. always. it has never known failure. it simply returns. π
ssetmask() always succeeds too, and returns the previous signal mask. iconic behaviour, honestly.
π ERRORS π
the errors section is empty because these system calls always succeed. yes literally. they have zero toxic traits and zero failure modes. not one error in the building. πβ¨
β STANDARDS β
Linux. periodt. π§
π°οΈ HISTORY π°οΈ
since Linux 3.16, support for these system calls is optional, and whether you get them depends on whether the kernel was built with the CONFIG_SGETMASK_SYSCALL option. so it's giving "available, but only if the kernel said yes" π
π NOTES π
- these system calls are unaware of signal numbers greater than 31 (i.e., real-time signals). they simply do not perceive them. not their department. π«
- these system calls do not exist on x86-64. nope. gone. not invited to the party. π
- it is not possible to block
SIGSTOPorSIGKILL. some things just cannot be stopped, and those two are them. π₯
π SEE ALSO π
real talk bestie: if you're here looking for a cute signal-mask solution, you're in the wrong aisle. go to sigprocmask(2). this page is a museum exhibit. ποΈ
okay that's the whole page!! mwah π this was Linux man-pages 6.20, dated 2026-02-08, and yes, the sgetmask(2) girlies ate, even if the kernel devs have been trying to retire them since forever π«Άβ¨
π¦ 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 2007, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms