Odd behaviour with write and sound

Brian Kress (kressb@sandwich.net)
Mon, 08 Nov 1999 20:04:29 -0500


Hi all,

I'm developing a kernel module on 2.2.x. This is a "driver"
that monitors all I/O activity in the system and collects
some stats about it. There's probably better ways to do
this, but this module is mostly for me to learn more about
the way the kernel works.
The module works by replacing the write system call
with my own function. It collects the info it wants and
then calls the real write syscall. It does this with something
like:

void* old_write;
extern void* sys_call_table[];
...
old_write=sys_call_table[__NR_write];
sys_call_table[__NR_write]=new_write;

This works great most of the time. My function
(new_write) gets called, collects it's info, and calls
old_write.
However, if the machine is playing a sound file
of any variety, this doesn't work. printks show that
while a sound is playing, the writes to the sound
driver are going through my function, but no others
are. When no sound is playing, they all do.
Does the sound driver change the write() call
in some way? Anyone have any idea what could
be causing this? This is so bizarre...

Brian

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/