summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-12-10 01:01:53 +0100
committerH. Peter Anvin <hpa@zytor.com>2009-12-10 01:28:34 +0100
commit11cf88bd0b8165b65aaabaee0977e9a3ad474ab7 (patch)
tree33e74a88baf24ee971282ded562b78db40749bb9 /arch/x86/kernel/process.c
parentx86: Merge sys_iopl (diff)
downloadlinux-11cf88bd0b8165b65aaabaee0977e9a3ad474ab7.tar.xz
linux-11cf88bd0b8165b65aaabaee0977e9a3ad474ab7.zip
x86: Merge sys_execve
Change 32-bit sys_execve to PTREGSCALL3, and merge with 64-bit. Signed-off-by: Brian Gerst <brgerst@gmail.com> LKML-Reference: <1260403316-5679-4-git-send-email-brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r--arch/x86/kernel/process.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5e2ba634ea15..bb17bd9334fb 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -236,6 +236,32 @@ int sys_vfork(struct pt_regs *regs)
/*
+ * sys_execve() executes a new program.
+ */
+long sys_execve(char __user *name, char __user * __user *argv,
+ char __user * __user *envp, struct pt_regs *regs)
+{
+ long error;
+ char *filename;
+
+ filename = getname(name);
+ error = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ return error;
+ error = do_execve(filename, argv, envp, regs);
+
+#ifdef CONFIG_X86_32
+ if (error == 0) {
+ /* Make sure we don't return using sysenter.. */
+ set_thread_flag(TIF_IRET);
+ }
+#endif
+
+ putname(filename);
+ return error;
+}
+
+/*
* Idle related variables and functions
*/
unsigned long boot_option_idle_override = 0;