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/14829] sched_* functions wrongly alter thread scheduling, rather than process


http://sourceware.org/bugzilla/show_bug.cgi?id=14829

--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> ---
On Mon, Jun 17, 2013 at 08:44:43PM +0000, carlos at redhat dot com wrote:
> > > Did I miss anything?
> > 
> > Yes. getpid() uses the cached pid from the TCB. So if set_tid_address
> > returned the tid, then getpid() would return the wrong pid. 
> 
> It's not the wrong pid, it's the identifier of the schedulable object which is
> the kernel task associated with the process. It's as correct as you can get.

No. If fork() returns a value X to a parent process, and the child
process sees its own pid as value Y via getpid(), then the
implementation is non-conforming.

> All kernel functions already do accept pid and tid interchangeably.
> 
> You can already have several different identifiers for the same task.

There is nothing wrong with the kernel _accepting_ different
identifiers for the same task. However standard functions which
_return_ the pid must return consistent values. The change you
proposed for the kernel would break this requirement in existing
static binaries and when using old shared libc versions from before
the kernel change. As far as I know, this goes against kernel
interface stability policy.

-- 
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]