Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jul 1999 03:09:30 -0400 (EDT)
From:      Alfred Perlstein <bright@rush.net>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        brian@Awfulhak.org, jmg@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/net if_tun.c
Message-ID:  <Pine.BSF.3.96.990724025735.27774S-100000@cygnus.rush.net>
In-Reply-To: <199907240453.OAA15384@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 24 Jul 1999, Bruce Evans wrote:

> >I don't think I agree that writing 0 bytes should result in EIO, 
> >perhaps EINVAL would be more apt ?
> 
> Both are surprising.  POSIX.1 requires writing 0 bytes to a regular
> file to succeed and have no effect (e.g., it must not change the
> modification time).  Why should it behave differently for devices?

Shouldn't the devices themselves specify what an error actually is,
meaning it up to the device to define an API?

Since the tun device wants packets, writing an invalid packet
(0 len or greater than MRU) should be an error no?

Well maybe not, as in complicates niave applications of the tun 
device as well as not being in the spirit of the POSIX spec you
brought up.

In conclusion as the person in charge of "what's right",
what is your opinion after considering the initial reason 
for an error repsonce?

Oh, for some reason ENODEV seems like a more "fun" error to
return:

     19 ENODEV Operation not supported by device. An attempt was made to apply
             an inappropriate function to a device, for example, trying to
             read a write-only device such as a printer.

or, write a 0 length data packet to a tunneling device, or perhaps
EMSGSIZE if the definition is changed from "message too long" to
"incorrect message size"

and now i'm making too big a deal of this.

:)

-Alfred Perlstein - [bright@rush.net|bright@wintelcom.net] 
systems administrator and programmer
    Win Telecom - http://www.wintelcom.net/




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990724025735.27774S-100000>