mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
Update.
* pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P. * pthread_cancel.c: Use INVALID_TD_P. * pthread_detach.c: Likewise. * pthread_getschedparam.c: Likewise. * pthread_setschedparam.c: Likewise. * sysdeps/pthread/pthread_getcpuclockid.c: Likewise. * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise. * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P. * pthread_timedjoin.c: Likewise. * tst-basic7.c: Include <signal.h>.
This commit is contained in:
@ -31,14 +31,14 @@ __pthread_kill (threadid, signo)
|
||||
{
|
||||
struct pthread *pd = (struct pthread *) threadid;
|
||||
|
||||
/* Make sure the descriptor is valid. */
|
||||
if (INVALID_TD_P (pd))
|
||||
/* Not a valid thread handle. */
|
||||
return ESRCH;
|
||||
|
||||
/* We have a special syscall to do the work. */
|
||||
INTERNAL_SYSCALL_DECL (err);
|
||||
|
||||
/* The kernel returns EINVAL for PIDs <= 0. This is not nice since
|
||||
the user would expect ESRCH. Correct it here. */
|
||||
if (pd->tid <= 0)
|
||||
return ESRCH;
|
||||
|
||||
int val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, signo);
|
||||
|
||||
return (INTERNAL_SYSCALL_ERROR_P (val, err)
|
||||
|
Reference in New Issue
Block a user