Subject: Re: Mapping 2 compat linux32 syscalls on a single native one
To: Christos Zoulas <christos@zoulas.com>
From: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
List: tech-kern
Date: 01/30/2007 22:09:17
On Tue, Jan 30, 2007 at 01:42:40PM -0500, Christos Zoulas wrote:
> On Jan 30,  4:54pm, xdivac02@stud.fit.vutbr.cz (Divacky Roman) wrote:
> -- Subject: Re: Mapping 2 compat linux32 syscalls on a single native one
> 
> | 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.
> 
> It is does really depend on linux_use26(), it depends if the
> process was using NPTL or not, on a process by process basis; like:
> 
> exit_group() 
> {
> 	if (p->nptl) {
> 	   2.6 stuff with threads...
> 	}
> 	
> 	sys_exit();
> }
> 
> You can have processes that use 2.4 and 2.6 active at the same time.

I dont think this is ok because use of NPTL is determined by glibc which looks at
uname output. ie. you would have to have per-proc uname output. but feel free to
do it your own netbsd way :)

in fbsd the linux_use26 function is per-jail set (each jail has its linux_version sysctl)