This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6399] gettid() should have a wrapper


https://sourceware.org/bugzilla/show_bug.cgi?id=6399

--- Comment #25 from Nicholas Miell <nmiell at gmail dot com> ---
Should gettid() actually be exposed to userspace? My suggestion in bug 14300
was the introduction of a pid_t "pthread_gettid_np(pthread_t *thr)" (which,
naturally, could take pthread_self() as an argument).

Leaving gettid() hidden and only exposing the pthread function would act as an
implicit hint that you really should be using the pthread functions where
possible.

As such, acknowledging that the following functions take tids would be a
mistake:

sched_getaffinity()
sched_setaffinity()
sched_getparam() 
sched_setparam()
sched_getscheduler()
sched_setscheduler()

because the following functions already exist:

pthread_getaffinity_np() pthread_attr_getaffinity_np()
pthread_setaffinity_np() pthread_attr_setaffinity_np()
pthread_getschedparam() pthread_attr_getschedparam()
pthread_setschedparam() pthread_attr_setschedparam()
pthread_attr_getschedpolicy()
pthread_attr_setschedpolicy()

And ideally the other functions like fcntl() or timer_create() would get small
wrappers that that transparently convert a pthread_t to a tid before invoking
the system call.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]