Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2006 14:02:13 +0200
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        emulation@FreeBSD.org
Subject:   Re: cvs commit: src/sys/compat/linux linux_file.c linux_socket.c
Message-ID:  <20060924140213.74043db0@Magellan.Leidinger.net>
In-Reply-To: <20060924204648.Y74842@delplex.bde.org>
References:  <200609231906.k8NJ6smx010022@repoman.freebsd.org> <20060924204648.Y74842@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Bruce Evans <bde@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060924140213.74043db0>