[sane-devel] Need help porting sanei/sanei_thread.c

Rene W. Olsen ac at rebels.com
Thu Sep 8 02:37:13 UTC 2005


Hello,

I'm in the process of porting SANE to AmigaOS4 sofare its been going well.

I use PThread for porting the app but the compiler stops with this error

2.Work:CVS-Home/sane-backends> make
gcc -Wall -mcrt=clib2 -Os -Iwork:cvs-home/sane-backends/include    -c -o sanei/sanei_thread.o
sanei/sanei_thread.c
sanei/sanei_thread.c: In function `restore_sigpipe':
sanei/sanei_thread.c:310: error: storage size of 'act' isn't known
sanei/sanei_thread.c:312: warning: implicit declaration of function `sigaction'
sanei/sanei_thread.c:312: error: `SIGPIPE' undeclared (first use in this function)
sanei/sanei_thread.c:312: error: (Each undeclared identifier is reported only once
sanei/sanei_thread.c:312: error: for each function it appears in.)
sanei/sanei_thread.c:310: warning: unused variable `act'
sanei/sanei_thread.c: In function `sanei_thread_begin':
sanei/sanei_thread.c:356: error: storage size of 'act' isn't known
sanei/sanei_thread.c:360: error: `SIGPIPE' undeclared (first use in this function)
sanei/sanei_thread.c:356: warning: unused variable `act'
sanei/sanei_thread.c: In function `sanei_thread_sendsig':
sanei/sanei_thread.c:411: warning: implicit declaration of function `pthread_kill'
make: *** [sanei/sanei_thread.o] Error 1

in this function

static void
restore_sigpipe( void )
{
    struct sigaction act;

    if( sigaction( SIGPIPE, NULL, &act ) == 0 ) {

        if( act.sa_handler == SIG_IGN ) {
            sigemptyset( &act.sa_mask );
            act.sa_flags   = 0;
            act.sa_handler = SIG_DFL;
            
            DBG( 2, "restoring SIGPIPE to SIG_DFL\n" );
            sigaction( SIGPIPE, &act, NULL );
        }
    }
}

The problem is that there isent any structure/macro on Amiga called sigaction.
And I cant really understand that sigaction first is definded as a structure and then
used as a macro.

Any hint were to find some info on sigaction is welcome :D

Next problem is `pthread_kill' what do I do when the Amiga port of PThread dosent support that
function?

Kind regards
Rene W. Olsen




More information about the sane-devel mailing list