Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_exec.c
Show First 20 Lines • Show All 1,631 Lines • ▼ Show 20 Lines | exec_copyout_strings(struct image_params *imgp) | ||||
destp -= ARG_MAX - imgp->args->stringspace; | destp -= ARG_MAX - imgp->args->stringspace; | ||||
destp = rounddown2(destp, sizeof(void *)); | destp = rounddown2(destp, sizeof(void *)); | ||||
vectp = (char **)destp; | vectp = (char **)destp; | ||||
if (imgp->sysent->sv_stackgap != NULL) | if (imgp->sysent->sv_stackgap != NULL) | ||||
imgp->sysent->sv_stackgap(imgp, (u_long *)&vectp); | imgp->sysent->sv_stackgap(imgp, (u_long *)&vectp); | ||||
if (imgp->auxargs) { | if (imgp->auxargs) | ||||
/* | imgp->sysent->sv_copyout_auxargs(imgp, (u_long *)&vectp); | ||||
brooks: Would it be too ELF specific to call `__elfN(freebsd_copyout_auxargs)` here if `imgp->sysent… | |||||
jhbAuthorUnsubmitted Done Inline ActionsIt feels like it would be, though the use of Elf_Auxinfo was ELF-specific before. OTOH, you can't actually call __elfN() here since this file isn't compiled multiple times (though I suppose freebsd32 already uses a separate copyout_strings()). Hmm, I'm not sure. In the Linux ABIs in the child review, it does seem like linux_copyout_strings() should just call linux_copyout_auxargs() directly, though I guess on i386 we support Linux a.out still. jhb: It feels like it would be, though the use of Elf_Auxinfo was ELF-specific before. OTOH, you… | |||||
* Allocate room on the stack for the ELF auxargs | |||||
* array. It has up to AT_COUNT entries. | |||||
*/ | |||||
vectp -= howmany(AT_COUNT * sizeof(Elf_Auxinfo), | |||||
sizeof(*vectp)); | |||||
} | |||||
/* | /* | ||||
* Allocate room for the argv[] and env vectors including the | * Allocate room for the argv[] and env vectors including the | ||||
* terminating NULL pointers. | * terminating NULL pointers. | ||||
*/ | */ | ||||
vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; | vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 182 Lines • Show Last 20 Lines |
Would it be too ELF specific to call __elfN(freebsd_copyout_auxargs) here if imgp->sysent->sv_copyout_auxargs == NULL to avoid most of the explicit assignments?