Re: Async user space notification from kernel?

Tigran Aivazian (tigran@sco.COM)
Thu, 26 Aug 1999 15:39:44 +0100 (BST)


Hi,

You just said:
> What is the best way to have the kernel notify a user space daemon
> that some event has occured without user space resorting to polling an
> ioctl(ugh)?

> Furthermore, since /proc doesn't contain _real_ files, but auto-created
> ones, presumably a select on a /proc entry would be disappointing.

If, by "_real_" you mean "regular" files (i.e. S_ISREG()) then using
select(2) on them is probably the most disappointing thing in the world -
i.e. it always answers "YES!" to all questions...

Seriously though, the answer to your question depends on what kind of
event your userspace daemon wants to be notified about. For example, if
the event is the fact of some time being elapsed, the best way to be
notified of this is to use alarm(2) system call and catch SIGALRM (or
setitimer(2)). If the event is a death of a child then you must catch
SIGCLD (and of course beware of subtle SIGCLD semantics). etc etc.

Therefore, perhaps it is worth being more specific about what you want to
achieve?

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

-
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/