This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6399] gettid() should have a wrapper
- From: "nmiell at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 11 Jan 2014 00:17:43 +0000
- Subject: [Bug libc/6399] gettid() should have a wrapper
- Auto-submitted: auto-generated
- References: <bug-6399-131 at http dot sourceware dot org/bugzilla/>
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.