Subject: Re: bumping Linux emulation version?
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Christoph Hellwig <hch@ns.caldera.de>
List: tech-kern
Date: 09/30/2001 18:59:39
On Sun, Sep 30, 2001 at 06:47:39PM +0200, Emmanuel Dreyfus wrote:
> I have a problem with Linux/Mips emulation: most Linux/Mips systems now
> run glibc-2.2.4, which require a recent kernel. At program startup, libc
> calls new_uname() to check kernel version and terminates the program if
> it's too low.
> 
> Through uname(), we currently claim to emulate a 2.0.36 kernel, which
> causes a failure. If we claim a 2.4.0 kernel, it works. 
> 
> The minimal kernel version seems to be set at libc build time, depending
> on the kernel version. This is done in libc sources through the
> __LINUX_KERNEL_VERSION macro. It seems to me that this makes impossible
> to use the libc with an older kernel than the one that built it.
> 
> Is there any drawback to bump the emulated kernel version to a really
> recent version, such as 2.4.0? Or should it be bumped only for Mips?

You should make sure you actullay have all syscalls implemented that
you claim to have trough the higher version number.

For 2.2 this is thing like

 o setresgid/getresgid
 o prctl
 o all the real time signal stuff (sys_rt_sig*)
 o pread/pwrite
 o capset/capget
 o sigaltstack
 o sendfile
 o vfork

For 2.4 it's mostly the LFS and 32bit uid stuff which should be fairly
easy for NetBSD if not already existing, but also stuff like mincore/madvise
or pivot_root.

Glibc does feature instead of version-tests at runtime (yuck!), but other
apps might be slightly less intelligent.

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.