lua-users home
lua-l archive

Re: HELP! problem with run LuaLanes

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



2012年11月26日 Hisham <h@hisham.hm>
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).


I check for linux with

#ifdef __linux__

and I found that I can also check glibc version with

#define __GLIBC__ 2#define __GLIBC_MINOR__ 4

Anyway, prctl isn't what I want since I want to set the name of the thread, not the process. But fixing the build issue is good enough for now :-).

Regards,
 
--
Benoit.


AltStyle によって変換されたページ (->オリジナル) /