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

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Sep 8 15:38:05 UTC 2005


Hi,

On Thu, Sep 08, 2005 at 03:37:13AM +0100, Rene W. Olsen wrote:
> 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)

All the signal stuff is defined in the system header file signal.h. If
that's not available on Amigaos, maybe it just does not support signals?

> 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.

"struct sigaction" and the function "sigaction" are different things.

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

"man sigaction" :-) You should find the manual page in google.

>From Linux man page:
       #include <signal.h>

       int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);

Bye,
  Henning



More information about the sane-devel mailing list