Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update.
2003-12-23 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid setting with __ASSUME_TGKILL || defined __NR_tgkill. If pid is 0, set it to selftid. * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline. Don't set self->pid but self->tid. If self->pid == 0 and self->tid != 0, return self->tid without doing a syscall. * descr.h (struct pthread): Move pid field after tid. * Makefile (tests): Add tst-raise1. * tst-raise1.c: New file.
- Loading branch information
Ulrich Drepper
committed
Dec 27, 2003
1 parent
dc8527f
commit cb5b938
Showing
6 changed files
with
88 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <errno.h> | ||
#include <error.h> | ||
#include <signal.h> | ||
#include <stdlib.h> | ||
|
||
volatile int count; | ||
|
||
void | ||
sh (int sig) | ||
{ | ||
++count; | ||
} | ||
|
||
int | ||
main (void) | ||
{ | ||
struct sigaction sa; | ||
sa.sa_handler = sh; | ||
sigemptyset (&sa.sa_mask); | ||
sa.sa_flags = 0; | ||
if (sigaction (SIGUSR1, &sa, NULL) < 0) | ||
{ | ||
printf ("sigaction failed: %m\n"); | ||
exit (1); | ||
} | ||
if (raise (SIGUSR1) < 0) | ||
{ | ||
printf ("first raise failed: %m\n"); | ||
exit (1); | ||
} | ||
if (raise (SIGUSR1) < 0) | ||
{ | ||
printf ("second raise failed: %m\n"); | ||
exit (1); | ||
} | ||
if (count != 2) | ||
{ | ||
printf ("signal handler not called 2 times\n"); | ||
exit (1); | ||
} | ||
exit (0); | ||
} |