int exec_linux_aout_prep_zmagic __P((struct proc *, struct exec_package *)); int exec_linux_aout_prep_nmagic __P((struct proc *, struct exec_package *)); int exec_linux_aout_prep_omagic __P((struct proc *, struct exec_package *)); int exec_linux_aout_prep_qmagic __P((struct proc *, struct exec_package *));
static void *linux_aout_copyargs __P((struct exec_package *,	struct ps_strings *, void *, void *));#define	LINUX_AOUT_AUX_ARGSIZ	2#define LINUX_ELF_AUX_ARGSIZ (sizeof(AuxInfo) * 8 / sizeof(char *))const char linux_emul_path[] = "/emul/linux";extern int linux_error[];extern char linux_sigcode[], linux_esigcode[];extern struct sysent linux_sysent[];extern char *linux_syscallnames[];struct emul emul_linux_aout = {	"linux",	linux_error,	linux_sendsig,	LINUX_SYS_syscall,	LINUX_SYS_MAXSYSCALL,	linux_sysent,	linux_syscallnames,	LINUX_AOUT_AUX_ARGSIZ,	linux_aout_copyargs,	setregs,	linux_sigcode,	linux_esigcode,};struct emul emul_linux_elf = {	"linux",	linux_error,	linux_sendsig,	LINUX_SYS_syscall,	LINUX_SYS_MAXSYSCALL,	linux_sysent,	linux_syscallnames,	LINUX_ELF_AUX_ARGSIZ,	elf_copyargs,	setregs,	linux_sigcode,	linux_esigcode,};static void *linux_aout_copyargs(pack, arginfo, stack, argp)	struct exec_package *pack;	struct ps_strings *arginfo;	void *stack;	void *argp;{	char **cpp = stack;	char **stk = stack;	char *dp, *sp;	size_t len;	void *nullp = NULL;	int argc = arginfo->ps_nargvstr;	int envc = arginfo->ps_nenvstr;	if (copyout(&argc, cpp++, sizeof(argc)))		return NULL;	/* leave room for envp and argv */	cpp += 2;	if (copyout(&cpp, &stk[1], sizeof (cpp)))		return NULL;	dp = (char *) (cpp + argc + envc + 2);	sp = argp;	/* XXX don't copy them out, remap them! */	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 (copyout(&nullp, cpp++, sizeof(nullp)))		return NULL;	if (copyout(&cpp, &stk[2], sizeof (cpp)))		return NULL;	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 (copyout(&nullp, cpp++, sizeof(nullp)))		return NULL;	return cpp;}