bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Early compilation failure with NexentaCore.


From: Mats Erik Andersson
Subject: Re: [bug-inetutils] Early compilation failure with NexentaCore.
Date: Fri, 17 Jun 2011 00:28:56 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

torsdag den 16 juni 2011 klockan 13:14 skrev Simon Josefsson detta:
> Mats Erik Andersson <address@hidden> writes:
> 
> >    typedef sig_t;
> >
> > This does not apply to OpenSolaris:
> >
> >    /* config.h */
> >
> >    /* #undef HAVE_SIG_T */
> 
> Glibc uses 'sighandler_t' for this, and gnulib should make sure it is
> available.  I've checked in a fix for this, please test!

This is not enough in OpenSolaris, since there is no type like
'__sighandler_t' that whould be rewritten using a typedef.

At least for NexentaCore, the signal handler is an anonymous type,
as is displayed by

    /* signal.h */
    /* Ignoring conditionals. */

    extern int (*ssignal(int, int (*)(int)))(int);

    extern void (*bsd_signal(int, void (*)(int)))(int);

    extern void (*sigset(int, void (*)(int)))(int);


    /* sys/signal.h */

    struct sigaction {
        union {
            void (*_handler)();
            ....
        } _funcptr;
    };

    #define sa_handler _funcptr._handler;

Furthermore,

    /* sys/iso/signal_iso.h */

    #ifdef __cplusplus
    #  define SIG_DFL (SIG_PF)0
    #else
    #  define SIG_DFL (void(*)())0
    #endif

    /* iso/signal_iso.h */

    #ifdef __cplusplus
    extern "C" SIG_PF signal(int, SIG_PF);
    #else
    extern void (*signal(int, void (*)(int)))(int);
    #endif

So we see that only C++ gets the benefit of a named
function type, not plain C.

Regards,
  Mats



reply via email to

[Prev in Thread] Current Thread [Next in Thread]