Subject: wskbd ioctl question
To: None <current-users@netbsd.org>
From: Chris Jones <cjones@rupert.honors.montana.edu>
List: current-users
Date: 09/03/1998 12:25:41
I'm playing with the ioctl's for wscons, and things are behaving
strangely. I open the device (/dev/ttyE0 or /dev/wskbd) as O_RDWR,
and then I try to do a WSKBDIO_BELL ioctl. It says, "Permission
denied." Looking at sys/dev/wscons/wskbd.c, I see this:
case WSKBDIO_BELL:
if ((flag & FWRITE) == 0)
return (EACCES);
...but flag should be the file mode, which is O_RDWR, which is 0x3,
and FWRITE should be 0x2. (0x3 & 0x2) == 0x2 != 0. So why am I
getting EACCES?
I'm obviously missing something here, but I've checked every function
in the stack, as seen from ddb. Maybe my kernel (-current from Aug
13) has different code than my sources (Sep 2)?
Chris
--
-----------------------------------------------------cjones@math.montana.edu
Chris Jones cjones@honors.montana.edu
Mad scientist at large cjones@nervana.montana.edu
"Is this going to be a stand-up programming session, sir, or another bug hunt?"