diff options
| author | christos <christos@NetBSD.org> | 2001-07-29 21:28:45 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2001-07-29 21:28:45 +0000 |
| commit | 934898bc3271edacfb9b80aab725dae6737880ac (patch) | |
| tree | 15a38a7d4d063eecdadc0c75be4ec04a15ab2399 /sys/compat/linux/common/linux_exec_aout.c | |
| parent | b474b9ac65c95b4c60ba7c4e44eb8b2add3f0436 (diff) | |
Adjust to the new copyargs() footprint.
Diffstat (limited to 'sys/compat/linux/common/linux_exec_aout.c')
| -rw-r--r-- | sys/compat/linux/common/linux_exec_aout.c | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/sys/compat/linux/common/linux_exec_aout.c b/sys/compat/linux/common/linux_exec_aout.c index 4f9a9bb20e3..f665e2187b3 100644 --- a/sys/compat/linux/common/linux_exec_aout.c +++ b/sys/compat/linux/common/linux_exec_aout.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_aout.c,v 1.44 2000/12/01 13:49:35 jdolecek Exp $ */ +/* $NetBSD: linux_exec_aout.c,v 1.45 2001/07/29 21:28:46 christos Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -66,40 +66,41 @@ #include <compat/linux/linux_syscallargs.h> #include <compat/linux/linux_syscall.h> -void *linux_aout_copyargs __P((struct exec_package *, - struct ps_strings *, void *, void *)); +int linux_aout_copyargs __P((struct exec_package *, struct ps_strings *, + char **, void *)); static int exec_linux_aout_prep_zmagic __P((struct proc *, - struct exec_package *)); + struct exec_package *)); static int exec_linux_aout_prep_nmagic __P((struct proc *, - struct exec_package *)); + struct exec_package *)); static int exec_linux_aout_prep_omagic __P((struct proc *, - struct exec_package *)); + struct exec_package *)); static int exec_linux_aout_prep_qmagic __P((struct proc *, - struct exec_package *)); + struct exec_package *)); -void * -linux_aout_copyargs(pack, arginfo, stack, argp) +int +linux_aout_copyargs(pack, arginfo, stackp, argp) struct exec_package *pack; struct ps_strings *arginfo; - void *stack; + char **stackp; void *argp; { - char **cpp = stack; - char **stk = stack; + char **cpp = (char **)*stackp; + char **stk = (char **)*stackp; char *dp, *sp; size_t len; void *nullp = NULL; int argc = arginfo->ps_nargvstr; int envc = arginfo->ps_nenvstr; + int error; - if (copyout(&argc, cpp++, sizeof(argc))) - return NULL; + if ((error = copyout(&argc, cpp++, sizeof(argc))) != 0) + return error; /* leave room for envp and argv */ cpp += 2; - if (copyout(&cpp, &stk[1], sizeof (cpp))) - return NULL; + if ((error = copyout(&cpp, &stk[1], sizeof (cpp))) != 0) + return error; dp = (char *) (cpp + argc + envc + 2); sp = argp; @@ -108,27 +109,28 @@ linux_aout_copyargs(pack, arginfo, stack, argp) arginfo->ps_argvstr = cpp; /* remember location of argv for later */ for (; --argc >= 0; sp += len, dp += len) - if (copyout(&dp, cpp++, sizeof(dp)) || - copyoutstr(sp, dp, ARG_MAX, &len)) - return NULL; + if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0 || + (error = copyoutstr(sp, dp, ARG_MAX, &len)) != 0) + return error; - if (copyout(&nullp, cpp++, sizeof(nullp))) - return NULL; + if ((error = copyout(&nullp, cpp++, sizeof(nullp))) != 0) + return error; - if (copyout(&cpp, &stk[2], sizeof (cpp))) - return NULL; + if ((error = copyout(&cpp, &stk[2], sizeof (cpp))) != 0) + return error; arginfo->ps_envstr = cpp; /* remember location of envp for later */ for (; --envc >= 0; sp += len, dp += len) - if (copyout(&dp, cpp++, sizeof(dp)) || - copyoutstr(sp, dp, ARG_MAX, &len)) - return NULL; + if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0 || + (error = copyoutstr(sp, dp, ARG_MAX, &len)) != 0) + return error; - if (copyout(&nullp, cpp++, sizeof(nullp))) - return NULL; + if ((error = copyout(&nullp, cpp++, sizeof(nullp))) != 0) + return error; - return cpp; + *stackp = (char *)cpp; + return 0; } int |
