]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix netbsd sigaction struct
authorJoel Sing <jsing@google.com>
Thu, 10 May 2012 17:48:16 +0000 (03:48 +1000)
committerJoel Sing <jsing@google.com>
Thu, 10 May 2012 17:48:16 +0000 (03:48 +1000)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6198063

src/pkg/runtime/signal_netbsd_386.c
src/pkg/runtime/signal_netbsd_amd64.c

index 39d829484de0f68f3596f1c4049a79e7bb48ba30..b4871ee8e0837a1a3076fa5f56b6f2271bd49b18 100644 (file)
@@ -11,10 +11,10 @@ extern void runtime·sigtramp(void);
 
 typedef struct sigaction {
        union {
-               void    (*__sa_handler)(int32);
-               void    (*__sa_sigaction)(int32, Siginfo*, void *);
-       } __sigaction_u;                /* signal handler */
-       uint32  sa_mask;                /* signal mask to apply */
+               void    (*_sa_handler)(int32);
+               void    (*_sa_sigaction)(int32, Siginfo*, void *);
+       } _sa_u;                        /* signal handler */
+       uint32  sa_mask[4];             /* signal mask to apply */
        int32   sa_flags;               /* see signal options below */
 } Sigaction;
 
@@ -124,9 +124,12 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
        sa.sa_flags = SA_SIGINFO|SA_ONSTACK;
        if(restart)
                sa.sa_flags |= SA_RESTART;
-       sa.sa_mask = ~0ULL;
+       sa.sa_mask[0] = ~0U;
+       sa.sa_mask[1] = ~0U;
+       sa.sa_mask[2] = ~0U;
+       sa.sa_mask[3] = ~0U;
        if (fn == runtime·sighandler)
                fn = (void*)runtime·sigtramp;
-       sa.__sigaction_u.__sa_sigaction = (void*)fn;
+       sa._sa_u._sa_sigaction = (void*)fn;
        runtime·sigaction(i, &sa, nil);
 }
index 8b4f624e7cb7d487cf578d1876e3d5b26c9462dc..a27f9db24db3166870e35be1a91ff156bd0dea70 100644 (file)
@@ -11,10 +11,10 @@ extern void runtime·sigtramp(void);
 
 typedef struct sigaction {
        union {
-               void    (*__sa_handler)(int32);
-               void    (*__sa_sigaction)(int32, Siginfo*, void *);
-       } __sigaction_u;                /* signal handler */
-       uint32  sa_mask;                /* signal mask to apply */
+               void    (*_sa_handler)(int32);
+               void    (*_sa_sigaction)(int32, Siginfo*, void *);
+       } _sa_u;                        /* signal handler */
+       uint32  sa_mask[4];             /* signal mask to apply */
        int32   sa_flags;               /* see signal options below */
 } Sigaction;
 
@@ -133,9 +133,12 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
        sa.sa_flags = SA_SIGINFO|SA_ONSTACK;
        if(restart)
                sa.sa_flags |= SA_RESTART;
-       sa.sa_mask = ~0ULL;
+       sa.sa_mask[0] = ~0U;
+       sa.sa_mask[1] = ~0U;
+       sa.sa_mask[2] = ~0U;
+       sa.sa_mask[3] = ~0U;
        if (fn == runtime·sighandler)
                fn = (void*)runtime·sigtramp;
-       sa.__sigaction_u.__sa_sigaction = (void*)fn;
+       sa._sa_u._sa_sigaction = (void*)fn;
        runtime·sigaction(i, &sa, nil);
 }