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 SIGSTOP or SIGKILL. 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms