[sane-devel] Re: Need help porting sanei/sanei_thread.c
Rene W. Olsen
ac at rebels.com
Fri Sep 9 12:23:33 UTC 2005
On 2005/09/08, Henning Meier-Geinitz wrote:
> 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?
Yes AmigaOS has singnal handling, but its diffrent from the linux way, so I dident understand what
went on there.
>> 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.
Hmm okey, dident know that C allowed a struct and function to have the same name.. ohh well leve and
learn.
>> Any hint were to find some info on sigaction is welcome :D
>
> "man sigaction" :-) You should find the manual page in google.
Yes I should have but I was really tired and dident think of googling for it. Me bad!!
>> From Linux man page:
> #include <signal.h>
>
> int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
okey
Regards
Rene W. Olsen
More information about the sane-devel
mailing list