Dmitry V. Levin | 66a15a5 | 2014-01-07 19:32:32 +0000 | [diff] [blame] | 1 | # rt_sigaction on ALPHA has 5 args: sig, act, oact, sigsetsize, restorer. |
| 2 | # rt_sigaction on SPARC has 5 args: sig, act, oact, restorer, sigsetsize. |
| 3 | # rt_sigaction on other architectures has 4 args: sig, act, oact, sigsetsize. |
| 4 | # Some architectures have SA_RESTORER, some don't; |
| 5 | # in particular, SPARC has and ALPHA hasn't. |
| 6 | # |
| 7 | # There are two regexps for each test: |
| 8 | # the 1st is for any architecture with SA_RESTORER, including SPARC; |
| 9 | # the 2nd is for any architecture without SA_RESTORER, including ALPHA. |
| 10 | |
| 11 | # Test 1. |
| 12 | NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, {SIG_DFL, \[\], 0}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} |
| 13 | NR == 1 && /^rt_sigaction\(SIGUSR2, {SIG_IGN, \[HUP INT\], SA_RESTART}, {SIG_DFL, \[\], 0}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} |
| 14 | |
| 15 | # Test 2. |
| 16 | NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, {SIG_IGN, \[HUP INT\], SA_RESTORER\|SA_RESTART, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} |
| 17 | NR == 2 && /^rt_sigaction\(SIGUSR2, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, {SIG_IGN, \[HUP INT\], SA_RESTART}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} |
| 18 | |
| 19 | # Test 3. |
| 20 | NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], SA_RESTORER, 0x[0-9a-f]+}, {0x[0-9a-f]+, \[QUIT TERM\], SA_RESTORER\|SA_SIGINFO, 0x[0-9a-f]+}, (0x[0-9a-f]+, )?(4|8|16)\) = 0$/ {next} |
| 21 | NR == 3 && /^rt_sigaction\(SIGUSR2, {SIG_DFL, \[\], 0}, {0x[0-9a-f]+, \[QUIT TERM\], SA_SIGINFO}, (4|8|16)(, 0x[0-9a-f]+)?\) = 0$/ {next} |
| 22 | |
| 23 | # The last line. |
| 24 | NR == 4 && /^\+\+\+ exited with 0 \+\+\+$/ {next} |
| 25 | |
| 26 | { |
Dmitry V. Levin | b0c2a9d | 2014-02-08 00:37:48 +0000 | [diff] [blame^] | 27 | print "Line " NR " does not match: " $0 |
Dmitry V. Levin | 66a15a5 | 2014-01-07 19:32:32 +0000 | [diff] [blame] | 28 | exit 1 |
| 29 | } |
Dmitry V. Levin | b0c2a9d | 2014-02-08 00:37:48 +0000 | [diff] [blame^] | 30 | |
| 31 | END { |
| 32 | if (NR != 4) { |
| 33 | print "Expected 4 lines, found " NR " line(s)." |
| 34 | exit 1 |
| 35 | } |
| 36 | } |