diff options
author | Pino Toscano <toscano.pino@tiscali.it> | 2011-11-06 12:39:04 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-11-06 13:12:14 +0100 |
commit | 384808e214350e3f4cae9fdabde70aea410c4a21 (patch) | |
tree | bcfed9f14f97c88ce8fca25f6730abface2a0065 /sysdeps/hurd/pt-destroy-specific.c | |
parent | 710717fec5f135c65a2856fd2e2360d99742e058 (diff) |
pthread_getspecific, pthread_setspecific: check the key validity
When getting a TSD, handle gracefully the case of an invalid key.
When setting a TSD, check for the validity of the key as recommended
(although not required) by POSIX. This also avoids potentially
filling the `thread_specifics' hash of threads with TSD of invalid
keys.
Add two simple checks in test-7.c for the two situations above.
* sysdeps/hurd/pt-getspecific.c (pthread_getspecific): Check the
validity of the specified key.
* sysdeps/hurd/pt-setspecific.c (pthread_setspecific): Likewise.
* tests/test-7.c (main): Add two assertions.
Diffstat (limited to 'sysdeps/hurd/pt-destroy-specific.c')
0 files changed, 0 insertions, 0 deletions