SIGIO Howto

User code to enable async notification by SIGIO:
signal(SIGIO, &handler); // instead, do sigaction() in real code!
fcntl(fd, F_SETOWN, getpid());
int oflags = fcntl(fd, F_GETFL);
fcntl(fd, F_SETFL, oflags|FASYNC);
Driver method:
filp->fasync(): called when FASYNC flag has modified.
Kernel functions:
fasync_helper(): Register listener process.
kill_fasync(): Transmit signals to listener processes.

コメントを残す