previous: >>108786358
#define __NR_set_tid_address 218
https://man7.org/linux/man-pages/man2/set_tid_address.2.html
tl;dr:
manage a thread's tid
kind of a weird/niche one. it seems to be used in what is effectively a waitpid, but for threads?
why is returns your own tid, i can't even begin to imagine
it's a bit strange that this syscall supposedly always succeeds. i haven't looked at the source code, but i have a feeling if the address you pass in is outside of your address space...
just looked it up, and nope. lol
/*
* We don't check the error code - if userspace has
* not set up a proper pointer then tough luck.
*/
relevant resources:
man man
man syscalls
https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/