Subject: Re: device driver causing fork & exec
To: None <eric@fudge.uchicago.edu>
From: Ronald Khoo <ronald@demon.net>
List: tech-kern
Date: 11/14/1998 00:03:56
> Is it safe for the read() routine of a device driver to cause the
> process doing the reading to spontaneously fork and exec?  Is it
> sane?  I'm trying to get back into user space somehow without
> requiring the reading process to know that anything special needs
> to be done.

Why be so exotic ? The traditional approach to this kind of problem is
to have two related device nodes, with the "back to userland" process
already there, asleep trying to read or open the control device.

When the main device read routine wants to get back to userland
without its reader knowing, that information becomes readable from the
control device so the other process takes care of it.

In fact if this is uncommon, you only need one control device and
associated process taking care of control stuff for a whole farm of
main devices.

And it can be persistent, and loop over each required exceptional
action, hence eliminating the cost of a fork/exec per execptional
action.

Any reason why a traditional approach like this wouldn't work for you?

--