-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test interleaved/overlapping SIGPROF/SIGALRM delivery
- Loading branch information
1 parent
d5d126a
commit 1475ac4
Showing
2 changed files
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ | ||
|
||
#include "util.h" | ||
|
||
static volatile int count; | ||
|
||
static void handler(__attribute__((unused)) int sig) { ++count; } | ||
|
||
int main(void) { | ||
struct itimerval itv = { | ||
{ 0, 1000 }, | ||
{ 0, 1000 }, | ||
}; | ||
|
||
test_assert(0 == signal(SIGPROF, handler)); | ||
test_assert(0 == signal(SIGALRM, handler)); | ||
|
||
setitimer(ITIMER_REAL, &itv, NULL); | ||
setitimer(ITIMER_PROF, &itv, NULL); | ||
|
||
while (count < 2000) { | ||
} | ||
|
||
atomic_puts("EXIT-SUCCESS"); | ||
return 0; | ||
} |