PR_GET_TID_ADDRESS(2const)
π PR_GET_TID_ADDRESS π
okay bestie, welcome to PR_GET_TID_ADDRESS(2const) β yes that's the manual name, it's giving "const page" energy, and we're about to get into the clear_child_tid address situation. buckle up π
β¨ NAME β¨
PR_GET_TID_ADDRESS β get the clear_child_tid address π§
π LIBRARY π
Standard C library (libc, -lc)
πΈ SYNOPSIS πΈ
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_GET_TID_ADDRESS, int **addrp);
π DESCRIPTION π
so like. this returns the clear_child_tid address β the one that got set by set_tid_address(2) and the clone(2) CLONE_CHILD_CLEARTID flag β and it drops it right into the location that addrp points to. π
heads up bestie: this feature is ONLY available if the kernel was built with the CONFIG_CHECKPOINT_RESTORE option enabled. no config, no vibes. π
π₯ RETURN VALUE π₯
- On success, 0 is returned. slay β¨
- On error, -1 is returned, and errno is set to indicate the error. tragic π
π ERRORS π
- EFAULT β addrp is an invalid address. not her finest moment π
π STANDARDS π
Linux.
π¦ HISTORY π¦
Linux 3.5. old money, lowkey iconic β
β οΈ CAVEATS β οΈ
okay so pay attention here because this one is a whole thing. since the prctl() system call does not have a compat implementation for the AMD64 x32 and MIPS n32 ABIs, and the kernel writes out a pointer using the kernel's pointer size, this operation expects a user-space buffer of 8 (not 4) bytes on these ABIs. yes. eight. not four. do not come to me with four bytes on those ABIs, I will know. π
π SEE ALSO π
and that's the whole page bestie, no cap, every flag and caveat accounted for π«Ά
this little adventure was brought to you by Linux man-pages 6.20, dated 2026-02-08, and the letters PR_GET_TID_ADDRESS(2const). mwah πβ¨
π¦ 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 2013-2015, 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