From owner-freebsd-hackers Thu Jan 30 06:30:23 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA12933 for hackers-outgoing; Thu, 30 Jan 1997 06:30:23 -0800 (PST) Received: from bacall.lodgenet.com (bacall.lodgenet.com [205.138.147.242]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id GAA12923 for ; Thu, 30 Jan 1997 06:30:19 -0800 (PST) Received: (from mail@localhost) by bacall.lodgenet.com (8.6.12/8.6.12) id IAA21805; Thu, 30 Jan 1997 08:29:10 -0600 Received: from garbo.lodgenet.com(204.124.123.250) by bacall via smap (V1.3) id sma021784; Thu Jan 30 08:28:46 1997 Received: from jake.lodgenet.com (jake.lodgenet.com [10.0.11.30]) by garbo.lodgenet.com (8.6.12/8.6.9) with ESMTP id IAA10106; Thu, 30 Jan 1997 08:28:04 -0600 Received: from jake.lodgenet.com (localhost [127.0.0.1]) by jake.lodgenet.com (8.8.4/8.6.12) with ESMTP id IAA29130; Thu, 30 Jan 1997 08:29:10 -0600 (CST) Message-Id: <199701301429.IAA29130@jake.lodgenet.com> X-Mailer: exmh version 2.0beta 12/23/96 To: Michael Smith cc: mcgovern@spoon.beta.com (Brian J. McGovern), hackers@freebsd.org Subject: Re: Cases (was: Constructive Criticism) In-reply-to: Your message of "Thu, 30 Jan 1997 14:22:44 +1030." <199701300352.OAA26563@genesis.atrad.adelaide.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 30 Jan 1997 08:29:10 -0600 From: "Eric L. Hernes" Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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