Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * This file contains various random system calls that |
3 | * have a non-standard calling sequence on the Linux/i386 | |
4 | * platform. | |
5 | */ | |
6 | ||
7 | #include <linux/errno.h> | |
8 | #include <linux/sched.h> | |
9 | #include <linux/mm.h> | |
4e950f6f | 10 | #include <linux/fs.h> |
1da177e4 | 11 | #include <linux/smp.h> |
1da177e4 LT |
12 | #include <linux/sem.h> |
13 | #include <linux/msg.h> | |
14 | #include <linux/shm.h> | |
15 | #include <linux/stat.h> | |
16 | #include <linux/syscalls.h> | |
17 | #include <linux/mman.h> | |
18 | #include <linux/file.h> | |
19 | #include <linux/utsname.h> | |
cba4fbbf | 20 | #include <linux/ipc.h> |
1da177e4 | 21 | |
5b80fe8b PC |
22 | #include <linux/uaccess.h> |
23 | #include <linux/unistd.h> | |
1da177e4 | 24 | |
bbc1f698 JS |
25 | #include <asm/syscalls.h> |
26 | ||
fe74290d AB |
27 | /* |
28 | * Do a system call from kernel instead of calling sys_execve so we | |
29 | * end up with proper pt_regs. | |
30 | */ | |
31 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | |
32 | { | |
33 | long __res; | |
34 | asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" | |
35 | : "=a" (__res) | |
5b80fe8b | 36 | : "0" (__NR_execve), "ri" (filename), "c" (argv), "d" (envp) : "memory"); |
fe74290d AB |
37 | return __res; |
38 | } |