NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/39416: emulation support for pread/pwrite missing in linux32 emulation

>Number:         39416
>Category:       kern
>Synopsis:       emulation support for pread/pwrite missing in linux32 emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 27 08:50:00 +0000 2008
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 4.0
Dr. Nagler & Company GmbH
System: NetBSD s401 4.0 NetBSD 4.0 (NSW-S401) #11: Wed Jul 30 21:13:34 CEST 
Architecture: x86_64
Machine: amd64
        Some linux libraries installed for linux32 comparbility uses pread() to 
get data from
        an open file.
        In NetBSD4.0 this call is still unimplemented in the LINUX32 emulation.
        For example the YP-libs of Linux are using pread() to get the binding 
        I've recognized this in the firefox-bin installed from pkgsrc that will 
run in
        linux32 emulation.
        try to run a linux programm that uses pread - the system call will fail 
- not implemented
        Not realy shure, because I'm not shure about the exact stack alignment 
for theese calls.
        It looks like there is a size problem with the type off_t.
        In netbsd32 (at least since 3.0 - we have no older system running 
anymore) this type is 8 byte,
        but in linux32 it is only 4 bytes.
        In linux there seems to be calls like pread64() and pwrite64() for 
64-bit offsets - at
        least the header files will redirect pread() to pread64() if 
__USE_FILE_OFFSET64 is set.
        In kernel 2.6.16-1 pread64 seems to be mapped to syscall number 180 in 
        "#define __NR_pread64             180". No definition for pread itself 
is in the header files.
        I've no access to the linux sources at the moment, so I cannot check, 
if the pread() function
        will just call pread64() in the library. In that case the missing 
emulation can be added
        by just calling netbsd32_pread().

        If there is a real 32 bit call in linux, a little bit more work is 
        For the 32 bit calls we need an additional argument structure, but than 
it should be simply
        possible to use the version with 64 bit offsets. Perhaps a size check 
        (offest + numbytes <= 1^32) should be done to keep semantics.


Home | Main Index | Thread Index | Old Index