Re: Registering for multiple SIGIO within a process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am not sure if this would work but you could try registering
different real time signals to be delivered to the shared object
instead of SIGIO. I am not sure if it would work. I do use RT signals
to be used instead of SIGIO.

You could try probably something like this

fcntl (devhandle, SETOWN, getpid ());
fcntl (devhandle, SETSIG, SIGRTMIN);
fcntl (devhandle, SETFL, O_ASYNC);

try registering a signal handler for SIGRTMIN like SIGIO. Could be a
possible solution.

Bharath

On 9/28/05, Bhattacharjee, Satadal <[email protected]> wrote:
> 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
> [email protected]
> (408) 433-4204
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux