aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/process.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-09-22 16:58:42 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-22 16:58:43 -0400
commit3e86a8c617413e344143839c514e9b0c1713065c (patch)
treed979f64645e47d37b273787faf6bc834550e3963 /arch/s390/kernel/process.c
parent2d70ca23f86647e076e3a8b64b3a90e583b894d5 (diff)
[S390] Convert sys_execve to function with parameters.
Use function parameters instead of accessing the pt_regs structure to get the parameters. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/process.c')
-rw-r--r--arch/s390/kernel/process.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 189d978f76d6..59fe6ecc6ed3 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -32,6 +32,7 @@
32#include <linux/elfcore.h> 32#include <linux/elfcore.h>
33#include <linux/kernel_stat.h> 33#include <linux/kernel_stat.h>
34#include <linux/syscalls.h> 34#include <linux/syscalls.h>
35#include <linux/compat.h>
35#include <asm/compat.h> 36#include <asm/compat.h>
36#include <asm/uaccess.h> 37#include <asm/uaccess.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
@@ -268,30 +269,25 @@ asmlinkage void execve_tail(void)
268/* 269/*
269 * sys_execve() executes a new program. 270 * sys_execve() executes a new program.
270 */ 271 */
271SYSCALL_DEFINE0(execve) 272SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv,
273 char __user * __user *, envp)
272{ 274{
273 struct pt_regs *regs = task_pt_regs(current); 275 struct pt_regs *regs = task_pt_regs(current);
274 char *filename; 276 char *filename;
275 unsigned long result; 277 long rc;
276 int rc;
277 278
278 filename = getname((char __user *) regs->orig_gpr2); 279 filename = getname(name);
279 if (IS_ERR(filename)) { 280 rc = PTR_ERR(filename);
280 result = PTR_ERR(filename); 281 if (IS_ERR(filename))
282 return rc;
283 rc = do_execve(filename, argv, envp, regs);
284 if (rc)
281 goto out; 285 goto out;
282 }
283 rc = do_execve(filename, (char __user * __user *) regs->gprs[3],
284 (char __user * __user *) regs->gprs[4], regs);
285 if (rc) {
286 result = rc;
287 goto out_putname;
288 }
289 execve_tail(); 286 execve_tail();
290 result = regs->gprs[2]; 287 rc = regs->gprs[2];
291out_putname:
292 putname(filename);
293out: 288out:
294 return result; 289 putname(filename);
290 return rc;
295} 291}
296 292
297/* 293/*