Registering for multiple SIGIO within a process

From: Bhattacharjee, Satadal
Date: Wed Sep 28 2005 - 17:03:18 EST


Hi,
I have hit a typical situation where I am having issues with signals. Below
is the description of the issue.
There are two separate Host Bus Adapters (HBA) connected to the system. Each
HBA has its own driver loaded in the kernel.

There are two separate shared objects to talk to each of the drivers. One
shared object does not communicate with the other one.

Each shared object has function within it to register with kernel to receive
SIGIO when an event is generated by the HBA. Driver received the event from
the HBA and sends SIGIO to the kernel.

There is an application (executable) which loads the two shared objects.
Application then calls function within the shared object to register events
from HBA.

When driver generates a signal, the shared object which registered last,
receives the signal. The first registration never receives any signal.

Now I checked the man pages and found out that you can register for the same
signal only once from a process.
We tried to change the signal from SIGIO to SIGUSER1 in one of the shared
object. But on checking the kernel code we realized that only SIGIO is
supported.

So can somebody suggest what is the correct mechanism to register with the
kernel for receiving multiple signals from a single process?

I am not subscribed to the list, so please copy me in the CC field when
replying.
The shared object code snippet for registration is below:
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;
}
*****************************************************************
Satadal Bhattacharjee,
LSI Logic Corp.,
3098 W Warren Ave,
Fremont, CA, 94539
satadalb@xxxxxxxx
(408) 433-4204

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/