This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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]

Calls to getpid() in clone'd child return parent's pid.


libc-ports,

For the following tests:
nptl/tst-align2.c
nptl/tst-getpid1.c
nptl/tst-getpid2.c

I'm seeing that calls to getpid() in the clone'd child return the parent's pid.
If I make a raw syscall e.g. syscall(__NR_getpid), this returns the correct
pid. Is this problem indicative of anything in particular?

For example on hppa-linux, the cloned child will inhereit the value of the
parents thread register. The nptl getpid() wrapper will therefore return
the parents pid.

How is this supposed to work when the clone flags are zero?

Cheers,
Carlos.


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