Subject: Re: Mapping 2 compat linux32 syscalls on a single native one
To: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 01/30/2007 16:28:47
On Jan 30, 10:09pm, xdivac02@stud.fit.vutbr.cz (Divacky Roman) wrote:
-- Subject: Re: Mapping 2 compat linux32 syscalls on a single native one

| 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 :)

This is not true (NPTL is not determined by libc).

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

At least on my SUSE linux the libc/libpthread library is chosen by the
dynamic linker which looks for $LD_ASSUME_VERSION. Depending on it
it chooses to load libraries from /lib{,64} or /lib{,64}/tls.

/lib{,64}/tls contains:
    libc.so.6*         libpthread.so.0*   libthread_db.so.1* 
    libm.so.6*         librt.so.1*        
which are the NPTL libraries.

Have you tried this on linux? Here's the ps(1) output from one of
my machines [SLE 9.1]:

 5466 ?        Sl    19:59 /usr/local/.version/jdk1.5.0_08/bin/java -Xmx1000000k
13944 ?        Sl    86:07 /usr/local/.version/jdk1.5.0_08/bin/java -Xms1024m -X
 7365 ?        S      0:00 /usr/local/.version/jdk1.5.0_08/bin/java -Xbootclassp
 7375 ?        S      0:02 /usr/local/.version/jdk1.5.0_08/bin/java -Xbootclassp
 7376 ?        S      1:01 /usr/local/.version/jdk1.5.0_08/bin/java -Xbootclassp
 7377 ?        S      1:00 /usr/local/.version/jdk1.5.0_08/bin/java -Xbootclassp
 7378 ?        S      1:00 /usr/local/.version/jdk1.5.0_08/bin/java -Xbootclassp

This is the output from 3 java processes. The first two processes
[5466,13944] use NPTL [that is why in the ps string we see Sl].
The third [737?] was ran with LD_ASSUME_KERNEL=2.4.1 and it is
running 5 clone-based linux threads. So it is entirely possible
and desirable to run both clone based processed and NPTL processes
at the same time on the same machine in both 32 and 64 bit mode.

christos