aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/sys_i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/sys_i386.c')
-rw-r--r--arch/i386/kernel/sys_i386.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
index dc6e3bbeba31..4048397f1740 100644
--- a/arch/i386/kernel/sys_i386.c
+++ b/arch/i386/kernel/sys_i386.c
@@ -21,6 +21,7 @@
21#include <linux/utsname.h> 21#include <linux/utsname.h>
22 22
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/unistd.h>
24#include <asm/ipc.h> 25#include <asm/ipc.h>
25 26
26/* 27/*
@@ -248,3 +249,17 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
248 249
249 return error; 250 return error;
250} 251}
252
253
254/*
255 * Do a system call from kernel instead of calling sys_execve so we
256 * end up with proper pt_regs.
257 */
258int kernel_execve(const char *filename, char *const argv[], char *const envp[])
259{
260 long __res;
261 asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx"
262 : "=a" (__res)
263 : "0" (__NR_execve),"ri" (filename),"c" (argv), "d" (envp) : "memory");
264 return __res;
265}