cvs commit: src/sys/compat/linux linux_file.c linux_socket.c

Alexander Leidinger netchild at FreeBSD.org
Sun Sep 24 05:01:40 PDT 2006


Quoting Bruce Evans <bde at zeta.org.au> (Sun, 24 Sep 2006 21:21:23 +1000 (EST)):

emulation@ CCed.

> > netchild    2006-09-23 19:06:54 UTC
> >
> >  FreeBSD src repository
> >
> >  Modified files:
> >    sys/compat/linux     linux_file.c linux_socket.c
> >  Log:
> >  MFp4:
> >  ...
> >  - Return EISDIR in pread() when arg is a directory.
> 
> Why do extra work to break pread() on directories?  (The patch only
> breaks cases where pread() succeeds.  Cases where pread() fails
> with an errno not expected by Linux, if any, are not affected.)

Linux expects to get EISDIR here. We are using the linux test project
testcases to check how compatible we are with linux. Have a look at
http://wiki.freebsd.org/linux-kernel for more.

So in your opinion we should not behave like linux programs expect it
regarding such things which we allow in FreeBSD? For some parts I don't
mind this, but on the other side we should be compatible if we tell our
users that we are compatible (and we do this implicitly already). Where
to draw the line?

> Whether read(), pread() or lseek() works on directories should depend
> on whether the underlying file supports it.  ffs under FreeBSD supports
> all these functions.  I think linux_read() is just read(), so it doesn't
> do extra work to be bug for bug compatible with Linux, and is now
> incompatible with linux_pread().  linux_lseek() still just wraps
> lseek(), so linux_pread() is now incompatible with it too.

For linux_read() we have still some open issues (read02 in the LTP
table in the wiki may test just this). Since not all of the LTP tests
are as verbose as others, this may be one of the tests which fails.

For linux_lseek() we need to investigate if this is already checked for
in the LTP. If yes and the test doesn't fail, we're ok. If not we need
to determine what linux does.

Bye,
Alexander.

-- 
      ...and that is how we know the Earth to be banana-shaped.
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-emulation mailing list