Subject: Re: Mapping 2 compat linux32 syscalls on a single native one
To: Nicolas Joly <njoly@pasteur.fr>
From: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
List: tech-kern
Date: 01/30/2007 16:54:10
On Tue, Jan 30, 2007 at 01:34:11PM +0100, Nicolas Joly wrote:
> On Mon, Jan 29, 2007 at 05:04:22PM -0500, Christos Zoulas wrote:
> > On Jan 29, 10:27pm, xdivac02@stud.fit.vutbr.cz (Divacky Roman) wrote:
> > -- Subject: Re: Mapping 2 compat linux32 syscalls on a single native one
> > 
> > | > 64 bits compat linux use NPTL, but compat linux32 do not. This leads
> > | > to problems for 32 bits linux threaded programs that i'm trying to
> > | > debug and fix.
> > | 
> > | we had this problem in fbsd too. we solved it by introducing "linux_use26"
> > | function that tells wheter 2.6 emulation is present or not. this is determined
> > | by examining linux_release variable (which is a string representing what
> > | version of linux you are trying to emulate). I guess similar solution
> > | should work for you too..
> > | 
> > | roman
> > 
> > You are absolutely right. We have not set our 32 bit linux to pretend to
> > be 2.6 because we have not implemented the TLS stuff IIRC that NPTL needs
> > (mmm acronyms). Ideally we would use NPTL in both cases...
> 
> Agreed.
> 
> Do we want to have that NPTL compat linux implies NPTL compat linux32
> (as compat linux32 depends on compat linux64) ? Or do we allow each
> other use separate mecanism ?

what I meant was that 2.4 and 2.6 semantic differs so for example exit_group()
have to become

exit_group() 
{
	if (linux_use26()) {
	   2.6 stuff with threads...
	}
	
	sys_exit();
}

this way it works for both 2.6 and 2.4 emulation. Please note that user can set
the prefered version of emulation via sysctl. And glibc changes its behaviour depending
on the version set. So such dynamic behaviour determinining is a must.

roman