*BSD News Article 7026


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: Repeat of the question about VFS and VOP_SEEK()
Message-ID: <1992Oct25.113428.26098@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: University of Utah Computer Center
References: <b3co03lsb3LE00@amdahl.uts.amdahl.com> <1992Oct20.193544.2360@fcom.cc.utah.edu> <BwLoyL.85z@flatlin.ka.sub.org>
Date: Sun, 25 Oct 92 11:34:28 GMT
Lines: 35

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").  Using EINVAL
("Invalid argument"), on the other hand, seems more reasonable, as the device
being lseek()ed is truly not a valid lseek() target.  EOPNOTSUPP is likely to
go away in a non-socket networking implementation (like x-kernel or currents,
both of which are semi-officially under developement for 386BSD).


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.

-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------