Arnd Bergmann | 6760856 | 2006-10-02 02:18:26 -0700 | [diff] [blame^] | 1 | #include <asm/bug.h> |
| 2 | #include <asm/uaccess.h> |
| 3 | |
| 4 | #define __KERNEL_SYSCALLS__ |
| 5 | static int errno __attribute__((unused)); |
| 6 | #include <asm/unistd.h> |
| 7 | |
| 8 | #ifdef _syscall3 |
| 9 | int kernel_execve (const char *filename, char *const argv[], char *const envp[]) |
| 10 | __attribute__((__weak__)); |
| 11 | int kernel_execve (const char *filename, char *const argv[], char *const envp[]) |
| 12 | { |
| 13 | mm_segment_t fs = get_fs(); |
| 14 | int ret; |
| 15 | |
| 16 | WARN_ON(segment_eq(fs, USER_DS)); |
| 17 | ret = execve(filename, (char **)argv, (char **)envp); |
| 18 | if (ret) |
| 19 | ret = -errno; |
| 20 | |
| 21 | return ret; |
| 22 | } |
| 23 | #endif |