*BSD News Article 7098


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!wupost!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!Germany.EU.net!rrz.uni-koeln.de!unidui!flyer!flatlin!bad
From: bad@flatlin.ka.sub.org (Christoph Badura)
Subject: Re: Repeat of the question about VFS and VOP_SEEK()
Organization: Guru Systems/Funware Department
Date: Mon, 26 Oct 1992 23:57:06 GMT
Message-ID: <Bwr6J7.7q1@flatlin.ka.sub.org>
References: <b3co03lsb3LE00@amdahl.uts.amdahl.com> <1992Oct20.193544.2360@fcom.cc.utah.edu> <BwLoyL.85z@flatlin.ka.sub.org> <1992Oct25.113428.26098@fcom.cc.utah.edu>
Lines: 32

In <1992Oct25.113428.26098@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:

>In article <BwLoyL.85z@flatlin.ka.sub.org>, bad@flatlin.ka.sub.org (Christoph Badura) writes:
>|> In <1992Oct20.193544.2360@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
>|> >I suspect this is what should be happening when you
>|> >seek on a special device... the lseek should return a -1 with errno
>|> >set to EIO/EINVAL/ESPIPE/EBADFD (EINVAL seems most reasonable).
>|> 
>|> EBADFD is reserved for an invalid file descriptor beeing passed to a
>|> system call (as opposed to EINVAL).
>|> 
>|> EOPNOTSUPPORT would be more appropriate for obvious reasons.

>The majority of ioctl() failures in VFS filesystem implementations return
>ENOTTY, clearly improper.  I would prefer that ENOTTY be used (however bogus
>it would would be, since a special device may indeed be a tty, and some special
>devices are seekable), since EOPNOTSUPP (which you probably meant instead of
>"EOPNOTSUPPORT", which does not exist in /usr/include/sys/errno.h) clearly
>refers to socket I/O ("Operation not supported on socket").

EOPNOTSUPP (Yeah, I have to look it up every time.) was introduced
with the networking support in BSD. But I find it more descriptive
than ESPIPE, which is *the* traditional way to say that you can't
lseek on a fd. So we're stuck with it.

I don't see how ioctl(2) comes into play.

-- 
				Christoph Badura  ---  bad@flatlin.ka.sub.org

AIX is a better... is a better...  is a better... OpenSystem.
					IBM Rep at GUUG Symposium '92