* How to get the pid or proc* in a driver open() interface ???
@ 1998-03-09 5:00 laurent_menten
1998-03-17 5:00 ` linnartz
0 siblings, 1 reply; 2+ messages in thread
From: laurent_menten @ 1998-03-09 5:00 UTC (permalink / raw)
So as I develop a DDriver that should be some like assynchronous, my aim is
as my DDriver receives an interrupt (from the hardware) it reports it with a
signal (SIGIO or other) to the process that opened the special file.
The documentation states that there are two functions that works with signals
and available for DDrivers writters:
psignal() wich get a struct proc* to the process to be signaled.
gsignal() wich get a pid_t the the group to be signaled.
I thought I can get a proc* either from the DDriver itself in the open()
entrypoint or by a process and pass it using ioctl but I found no way to do
this; the only way I found to get a proc* is in the buf structure used by
block IOs but since my DDriver is a character one...
An other solution is to inform my DDriver with an ioctl of the process group
ID and to send the signal to the group (not really what I want since there are
about 8 minors and they may all be opened by a different child of a same
process!)
Maybe there is a solution using threads???
Thanks in advance...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to get the pid or proc* in a driver open() interface ???
1998-03-09 5:00 How to get the pid or proc* in a driver open() interface ??? laurent_menten
@ 1998-03-17 5:00 ` linnartz
0 siblings, 0 replies; 2+ messages in thread
From: linnartz @ 1998-03-17 5:00 UTC (permalink / raw)
I don't understand fully why you want to obtain the procptr in
the open routine, as it mostly gets stored in the struct buf,
but you've got 2 possibilities
u.u_proc or
task_to_proc(current_task())
But before taken all the burden of a device driver, did you
look at the aio family.
If you really need your own device driver, the device driver
documentaion is an excellent starting point
Pit
In article <6e0cli$5lr$1@nnrp1.dejanews.com>,
laurent_menten@yahoo.com wrote:
>
>
> So as I develop a DDriver that should be some like assynchronous, my aim is
> as my DDriver receives an interrupt (from the hardware) it reports it with a
> signal (SIGIO or other) to the process that opened the special file.
> The documentation states that there are two functions that works with
signals
> and available for DDrivers writters:
>
> psignal() wich get a struct proc* to the process to be signaled.
> gsignal() wich get a pid_t the the group to be signaled.
>
> I thought I can get a proc* either from the DDriver itself in the open()
> entrypoint or by a process and pass it using ioctl but I found no way to do
> this; the only way I found to get a proc* is in the buf structure used by
> block IOs but since my DDriver is a character one...
>
> An other solution is to inform my DDriver with an ioctl of the process group
> ID and to send the signal to the group (not really what I want since there
are
> about 8 minors and they may all be opened by a different child of a same
> process!)
>
> Maybe there is a solution using threads???
>
> Thanks in advance...
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-03-17 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-03-09 5:00 How to get the pid or proc* in a driver open() interface ??? laurent_menten
1998-03-17 5:00 ` linnartz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox