Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.unix-wizards Subject: Re: Sun keyboard driver? Message-ID: <9155@brl-tgr.ARPA> Date: Tue, 12-Mar-85 12:36:52 EST Article-I.D.: brl-tgr.9155 Posted: Tue Mar 12 12:36:52 1985 Date-Received: Fri, 15-Mar-85 01:32:55 EST References: <253@linus.UUCP> Distribution: net Organization: Ballistic Research Lab Lines: 14 > #define KIOCSETKEY _IOW(k, 1, struct kiockey) This is a macro Berkeley introduced that evaluates to the (int) ioctl code (second argument to ioctl(2)) for ioctl functions that involve sending data from user process space into the kernel. The macro is defined in /usr/include/sys/ioctl.h. Unfortunately, they are making use of a Reiser C preprocessor trick to take the "k" and make a character constant 'k' out of it (then combine that with the constant "1" and the sizeof(struct kiockey)). If you are having trouble, first check that you're #including . One objection I have to the _IOWR macros is that not every ioctl fits this model. There are some "xt" driver ioctls for which the sizeof the transfered data simply does not fit the alloted space.