Eric Blake <e...@byu.net> writes:

>> > It fails to build on IRIX 5.3 due to missing siginterrupt function:
>> > ld: ERROR 33: Unresolved text symbol "siginterrupt" -- 1st referenced by
>> > tests.o.
>> >
>> > Since gnulib does not provide a siginterrupt replacement I instead added
>> > the replacement used by bash 4.0 to tests.c:
>> 
>> Thanks for the report, I believe this should be fixed in gnulib.
>
> I'm not so sure.  POSIX lists siginterrupt as obsolete (in other
> words, the better action would be fixing your code to comply
> to modern POSIX, rather than making it easy to rely on a
> crutch for using an obsolete interface, similar to how we
> recommend memset over bzero).

Oh.  I didn't notice that.  There is a slight difference though, since
siginterrupt is still part of POSIX but bzero is not.

However, I share your concern, and no longer feel it is important to
push this into gnulib.  I'm going to fix my code to use sigaction
instead.

I noticed my code does something like this:

#ifndef _WIN32
  old = siginterrupt (SIGALRM, 1);
  alarm (secs);
#else
  setsockopt ((int) gnutls_transport_get_ptr (session), SOL_SOCKET,
              SO_RCVTIMEO, (char *) &secs, sizeof (int));
#endif

I'm thinking that using setsockopt may be more elegant than using a
SIGALRM signal, but I'm not sure.  Any advice?

/Simon


Reply via email to