Hello,
I introduced fasync to the file_operations of a char driver.

==================================================
My driver code is like:

static struct fasync_struct* fasync_data = NULL;

int func_fasync(int fd, struct file *filp, int on)
{
    int result = 0;

    result = fasync_helper(fd, filp, on, &fasync_data);

    if( result < 0 ) return( result );
    else return( 0 );
}

When sending a signal, call:
            kill_fasync( &fasync_data, SIGIO, POLL_IN );
========================================================

In my application:
Declaration:
        static struct sigaction _sigAction;

Init signal:
    _sigAction.sa_flags = 0;

    sigemptyset(&_sigAction.sa_mask);
    sigaddset(&_sigAction.sa_mask, SIGCHLD);
    sigaddset(&_sigAction.sa_mask, SIGUSR1);
    sigaddset(&_sigAction.sa_mask, SIGIO);

    _sigAction.sa_handler = sigio_handler;

    if ( sigaction(SIGIO, &_sigAction, NULL) < 0 )
    {
        PRINT( ("Error!! setting sigio_handler\n") );
    }

Setting Async of file descriptor:
    fcntl( _fd, F_SETOWN, getpid() );
    int oflags = fcntl( _fd, F_GETFL );
    fcntl( _fd, F_SETFL, oflags | FASYNC);
===========================================================

kill_fasync is called from interrupt routine.

after kill_fasync is called, my sigio_handler is executed, however
after a lot of kill_fasync calls, my application is killed (by uclinux?).
With
uClinux prompt info:

> sh xx Child yy died
>

Note: without calling kill_fasync, my appl funs forever.

Question? What signal cause dying of my appl?? How can I debug this??
          With strace?? (is not compiling in my distr 2.6.17-uc0)

Thanks for your info.

Regards
Teun Grinwis

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to