blob: 35fc49e1eb2f4a713c6eff9d0376c6b0d3b51303 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <syscall-nr.h>
#include "tests/lib.h"
#include "tests/main.h"
// From "lib/user/syscall.c", but modified to push some zeros on the stack
// first, to get a better output for the tests if the stack error message
// remains.
#define syscall0(NUMBER) \
({ \
int retval; \
asm volatile \
("pushl $0; pushl $0; pushl %[number]; int $0x30; addl $4, %%esp" \
: "=a" (retval) \
: [number] "i" (NUMBER) \
: "memory"); \
retval; \
})
void test_main(void)
{
// Call a syscall that is quite a bit larger than the maximum syscall number.
syscall0(1024 * 1024);
fail("Should have failed.");
}
|