[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Bug with fcntl(n, F_SETOWN, getpid) with NPTL 0.34



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamie Lokier 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

Very, very wrong.  It must be the getpid() value.  The TID must never be
used in user programs.  No user code must assume a fixed relationship
between a thread (pthread_t) and the TID.  The kernel must use the tgid
value and if this means further change, they have to be made as well.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/lOH22ijCOnn/RHQRAtd5AJ94c81H+f1HEAcIpQqgYjD3Duag1QCeMxbN
Db8T3rBobllwILUQSt2Ksr4=
=hJcU
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]