|
One alternative is to detect Linux with `#ifdef linux` (or Glibc <
2.12; there's probably an #ifdef for that) and use prctl(2) instead.
It works fine on threads:
prctl(PR_SET_NAME, "myThread", 0, 0, 0);
This edits the name that shows up in /proc/$$/stat (I suppose that's
the thread name you want to edit? At least that's the one I use for
displaying thread names in htop).
#define __GLIBC__ 2
#define __GLIBC_MINOR__ 4