From owner-freebsd-hackers Tue Mar 4 14:39:52 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6514837B405 for ; Tue, 4 Mar 2003 14:39:50 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6341143F85 for ; Tue, 4 Mar 2003 14:39:49 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h24MdgA6042652; Tue, 4 Mar 2003 23:39:47 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: "Mike Edenfield" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: D_KQFILTER & ltmdm. From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 04 Mar 2003 17:29:32 EST." <013801c2e29d$87b0f7e0$29330f0a@lcapps.educate.com> Date: Tue, 04 Mar 2003 23:39:42 +0100 Message-ID: <42651.1046817582@critter.freebsd.dk> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <013801c2e29d$87b0f7e0$29330f0a@lcapps.educate.com>, "Mike Edenfield " writes: >I'm working up a patch to the ltmdm to accomodate phk's recent changes to >cdevsw. I've gotten the module to build and load, but I have two questions >before I go ahead and submit a pr. > >1) I simply removed D_KQFILTER from the list of flags. Based on phk's >commit message I assumed the flag was simply not needed, and that removing >it would not break anything. Is this assumption correct? Thus far the >module is working (it loaded w/out a panic anyway) but I haven't tested it >very much. correct. D_KQFILTER was added so that we wouldn't dereference the d_kqfilter pointer in case it was not there (ie: if the driver was binary and compiled before the d_kqfilter pointer was added to cdevsw). It's hacks like this we avoid now. >2) The patch, which I've included below, only works for -CURRENT with >rev1.170 of conf.h. I wasn't sure how to get the preprocessor to >differentiate between -CURRENT before and after this specific revision of a >specific file. What is the correct way to do this? Or, alternatively, >should the patch simply assume FreeBSD 5 is the latest -CURRENT and not >worry about the imcompatibility w/ 5.0-RELEASE? I have bumped __FreeBSD_version so you can test for this. But your patch is wrong. Please format the initialization like you see in all the other device drivers: static struct cdevsw sio_cdevsw = { .d_maj = MAJOR_AUTO, .d_flags = D_TTY, .d_open = sioopen etc etc -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message