mình muốn sử dungh nhiều lời gọi SIGIO trên cùng 1 process thì phải làm thế nào vậy ????????
Code:
struct sigaction sa;
int oflags;
int rc = 0;
// setup the signal handler
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = &AENSignalHandler; // AENSignalHandler is the signal handler
//sa.sa_flags = SA_ONESHOT;
sigfillset(&sa.sa_mask);
sigaction(SIGIO, &sa, NULL);
//aen_do_registration - enable driver to send us SIGIO for event
notification
rc = fcntl(ghMegaDev, F_SETOWN, getpid()); // ghMegaDev is the handle to the
driver
if (rc < 0) {
perror("AEN: registration, F_SETOWN");
return SL_ERR_LINUX_AEN_INIT_FAILED;
}
oflags = fcntl(ghMegaDev, F_GETFL);
rc = fcntl(ghMegaDev, F_SETFL, oflags| FASYNC);
if (rc < 0) {
perror("setup_aen_handler: Failed to set ASYNC flag\n");
return SL_ERR_LINUX_AEN_INIT_FAILED;
}
