Index: head/sys/compat/freebsd32/freebsd32_misc.c =================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c +++ head/sys/compat/freebsd32/freebsd32_misc.c @@ -3237,6 +3237,7 @@ /* * Fill in "ps_strings" struct for ps, w, etc. */ + imgp->argv = vectp; if (suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nargvstr, argc) != 0) return (EFAULT); @@ -3256,6 +3257,7 @@ if (suword32(vectp++, 0) != 0) return (EFAULT); + imgp->envv = vectp; if (suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nenvstr, envc) != 0) return (EFAULT); Index: head/sys/kern/imgact_elf.c =================================================================== --- head/sys/kern/imgact_elf.c +++ head/sys/kern/imgact_elf.c @@ -1374,6 +1374,11 @@ AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); AUXARGS_ENTRY(pos, AT_BSDFLAGS, __elfN(sigfastblock) ? ELF_BSDF_SIGFASTBLK : 0); + AUXARGS_ENTRY(pos, AT_ARGC, imgp->args->argc); + AUXARGS_ENTRY_PTR(pos, AT_ARGV, imgp->argv); + AUXARGS_ENTRY(pos, AT_ENVC, imgp->args->envc); + AUXARGS_ENTRY_PTR(pos, AT_ENVV, imgp->envv); + AUXARGS_ENTRY_PTR(pos, AT_PS_STRINGS, imgp->ps_strings); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Index: head/sys/kern/kern_exec.c =================================================================== --- head/sys/kern/kern_exec.c +++ head/sys/kern/kern_exec.c @@ -1646,6 +1646,7 @@ /* * Fill in "ps_strings" struct for ps, w, etc. */ + imgp->argv = vectp; if (suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nargvstr, argc) != 0) return (EFAULT); @@ -1665,6 +1666,7 @@ if (suword(vectp++, 0) != 0) return (EFAULT); + imgp->envv = vectp; if (suword(&arginfo->ps_envstr, (long)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nenvstr, envc) != 0) return (EFAULT); Index: head/sys/sys/elf_common.h =================================================================== --- head/sys/sys/elf_common.h +++ head/sys/sys/elf_common.h @@ -956,8 +956,13 @@ #define AT_HWCAP 25 /* CPU feature flags. */ #define AT_HWCAP2 26 /* CPU feature flags 2. */ #define AT_BSDFLAGS 27 /* ELF BSD Flags. */ +#define AT_ARGC 28 /* Argument count */ +#define AT_ARGV 29 /* Argument vector */ +#define AT_ENVC 30 /* Environment count */ +#define AT_ENVV 31 /* Environment vector */ +#define AT_PS_STRINGS 32 /* struct ps_strings */ -#define AT_COUNT 28 /* Count of defined aux entry types. */ +#define AT_COUNT 33 /* Count of defined aux entry types. */ /* * Relocation types. Index: head/sys/sys/imgact.h =================================================================== --- head/sys/sys/imgact.h +++ head/sys/sys/imgact.h @@ -78,6 +78,8 @@ void *ps_strings; /* pointer to ps_string (user space) */ struct image_args *args; /* system call arguments */ struct sysentvec *sysent; /* system entry vector */ + void *argv; /* pointer to argv (user space) */ + void *envv; /* pointer to envv (user space) */ char *execpath; unsigned long execpathp; char *freepath;