Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 1997 08:29:10 -0600
From:      "Eric L. Hernes" <erich@lodgenet.com>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        mcgovern@spoon.beta.com (Brian J. McGovern), hackers@freebsd.org
Subject:   Re: Cases (was: Constructive Criticism) 
Message-ID:  <199701301429.IAA29130@jake.lodgenet.com>
In-Reply-To: Your message of "Thu, 30 Jan 1997 14:22:44 %2B1030." <199701300352.OAA26563@genesis.atrad.adelaide.edu.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Smith writes:
>#define CDEV_MAJOR      20
>static struct cdevsw foo_cdevsw =
>{
>    fooopen,          fooclose,       fooread,        foowrite,
>    fooioctl,         nullstop,       nullreset,      nodevtotty,
>    fooselect,        nommap,         NULL,           driver_name,
>    NULL, -1
>};
>
>Note that some of the placeholders are "no*" and some are "null*" - I
>think that this is laziness on someone's part 8(

I think that the `no' routines return ENODEV as an error, and
the `null' routines silently do nothing.  Probably only for
the ones that make sense though.  If you set d_open to
be nullopen, your device will work.  If you set it to noopen,
open("/dev/mydev") will always fail.  Some of them are just
#defined to be the other though, like d_reset and d_stop.
glance through sys/kern/subr_xxx.c and sys/sys/conf.h if you
care. ;-)

>
>-- 
>]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
>]] Genesis Software                     genesis@gsoft.com.au            [[
>]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
>]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
>]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[
>

eric.
-- 
erich@lodgenet.com
http://rrnet.com/~erich erich@rrnet.com






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