Subject: exec priorities: do they work?
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 10/19/2003 01:28:20
One roblem with exec priorities: Mach-O binaries can be run by two
emulations: COMPAT_MACH and COMPAT_DARWIN

For now, COMPAT_MACH is a fake emulation which should not run any
binary. It is mostly there as a placeholder for the mach system call
table. In the future we might support older Mach binaries through it.
For that reason, the COMPAT_MACH probe function is still there.

But for now, Mach-O binaries should be run with COMPAT_DARWIN. The
problem is that the kernel first try COMPAT_MACH. For dynamic binaries,
it will fail because the interpreter won't be found in /emul/mach (it's
in /emul/darwin). But static binaries are stollen by COMPAT_MACH.  

exec priorities are there to avoid this kind of problem, but even with
EXECSW_PRIO_LAST for COMPAT_MACH and EXECSW_PRIO_FIRST for
COMPAT_DARWIN, COMPAT_MACH seems called first. 

In order to get what I want, I have to swap the order of COMPAT_DARWIN
and COMPAT_MACH in exec_conf.c or always return ENOEXEC in COMPAT_MACH's
probe. What is the problem with exec priorities? Am I doing something
wrong?

-- 
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.
manu@netbsd.org