Subject: wskbd ioctl question
To: None <>
From: Chris Jones <>
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:

	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 Jones                                
           Mad scientist at large          
"Is this going to be a stand-up programming session, sir, or another bug hunt?"