Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Nov 2011 13:13:38 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        tim@kientzle.com, perryh@pluto.rain.com, freebsd-arch@freebsd.org
Subject:   Re: [PATCH] fadvise(2) system call
Message-ID:  <20111113111338.GX50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <15483.1321181667@critter.freebsd.dk>
References:  <4ebf4e1f.hkNuKvwPEzh2GJhi%perryh@pluto.rain.com> <15483.1321181667@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--xts/o66bJCDUp3W0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Nov 13, 2011 at 10:54:27AM +0000, Poul-Henning Kamp wrote:
> In message <4ebf4e1f.hkNuKvwPEzh2GJhi%perryh@pluto.rain.com>, perryh@plut=
o.rain
> .com writes:
> >Warner Losh <imp@bsdimp.com> wrote:
>=20
> >> >> wrote:
> >> >>> ... seek(2) is badly broken on tape drives.
> >> >>> It does nothing and doesn't return an error ...
> >> >>=20
> >> >> Honestly, I think we've got bigger problems to worry about
> >> >> than whether lseek() works on magnetic tape drives ...
> >> >=20
> >> > True, but failing silently -- doing nothing but not returning an
> >> > error -- is a POLA violation.  Those are worth fixing simply on
> >> > principle.
> >>
> >> Early Unix layering made that kinda hard... :(
> >
> >and yet, it somehow manages to return an error if applied to a pipe.
> >There must be some point at which the inode type affects the result.
>=20
> There is a big difference:  pipes operate at the fdesc level, devices
> sit behind what can best be explained as a symlink into a different
> name-space, and the cdevsw API does not pass the fdesc offset in.
I do not think this is true. Devfs does pass the file offset as
uio_offset to the cdevsw read and write methods. Also, the dev nodes
are marked as seekable.

Drivers can see the file offset and operate on them properly, but not at
the lseek(2) time.

--xts/o66bJCDUp3W0
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk6/pmIACgkQC3+MBN1Mb4jkdQCgjeSrEBr7Nche80zypS8vpQTl
6lMAn19exjL9N8n2YYDmxQtWgDwG1XuG
=GPhu
-----END PGP SIGNATURE-----

--xts/o66bJCDUp3W0--



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