Re: Bug with fcntl(n, F_SETOWN, getpid) with NPTL 0.34
Jamie Lokier <[email protected]> Sat, 18 Oct 2003 01:34:43 +0100
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Message-ID | <[email protected]> |
Roland McGrath wrote: > > It is incorrect for a program to use the value of getpid() as the > > argument to F_SETOWN. It should be using the value returned from the > > gettid() system call (tid (current->pid) != pid (current-tgid)). (Yes > > the naming is very confusing). Unfortunately this is not made easy > > (gettid() is not a libc function), and the man page is no longer > > correct when it says process id. > > This is incorrect. The kernel is what needs to be fixed. I agree the kernel could be changed. But which change do you have in mind? Changing fasync to deliver signals to a process instead of a thread breaks programs which use sigwaitinfo() as their per-thread event queue mechanism (e.g. to track dnotify events, or to guarantee event ordering from async futexes). There was a recent tiny kernel thread on this topic. As usual I may be the only person in the world who actually uses these capabilities ;) -- Jamie