Commit f5292240 authored by Ian Lance Taylor's avatar Ian Lance Taylor

Get the right sigaction struct for the 386 rt_sigaction system

call.  This uses the header files from a 32-bit Ubuntu Hardy
system.

The use of _LOOSE_KERNEL_NAMES seems right.  The
-D__ARCH_SI_UID_T works around a bug which appears to be fixed
in later Linux versions.

R=rsc
http://go/go-review/1013015
parent 1228112b
// godefs -f -m32 -f -I/home/rsc/pub/linux-2.6/arch/x86/include -f -I/home/rsc/pub/linux-2.6/include defs2.c // godefs -f -m32 -f -D_LOOSE_KERNEL_NAMES -f -D__ARCH_SI_UID_T=__kernel_uid32_t defs2.c
// MACHINE GENERATED - DO NOT EDIT. // MACHINE GENERATED - DO NOT EDIT.
...@@ -54,8 +54,7 @@ struct Fpstate { ...@@ -54,8 +54,7 @@ struct Fpstate {
uint32 reserved; uint32 reserved;
Fpxreg _fxsr_st[8]; Fpxreg _fxsr_st[8];
Xmmreg _xmm[8]; Xmmreg _xmm[8];
uint32 padding1[44]; uint32 padding[56];
byte _anon_[48];
}; };
typedef struct Timespec Timespec; typedef struct Timespec Timespec;
...@@ -72,10 +71,10 @@ struct Timeval { ...@@ -72,10 +71,10 @@ struct Timeval {
typedef struct Sigaction Sigaction; typedef struct Sigaction Sigaction;
struct Sigaction { struct Sigaction {
byte _u[4]; void *k_sa_handler;
uint32 sa_mask;
uint32 sa_flags; uint32 sa_flags;
void *sa_restorer; void *sa_restorer;
uint32 sa_mask;
}; };
typedef struct Siginfo Siginfo; typedef struct Siginfo Siginfo;
......
...@@ -88,9 +88,9 @@ initsig(void) ...@@ -88,9 +88,9 @@ initsig(void)
for(i = 0; i<NSIG; i++) { for(i = 0; i<NSIG; i++) {
if(sigtab[i].flags) { if(sigtab[i].flags) {
if(sigtab[i].flags & SigCatch) if(sigtab[i].flags & SigCatch)
*(void**)sa._u = (void*)sigtramp; // handler sa.k_sa_handler = (void*)sigtramp;
else else
*(void**)sa._u = (void*)sigignore; // handler sa.k_sa_handler = (void*)sigignore;
if(sigtab[i].flags & SigRestart) if(sigtab[i].flags & SigRestart)
sa.sa_flags |= SA_RESTART; sa.sa_flags |= SA_RESTART;
else else
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
#include <asm/signal.h> #include <asm/signal.h>
#include <asm/mman.h> #include <asm/mman.h>
#include <asm/sigframe.h> #include <asm/sigcontext.h>
#include <asm/ucontext.h> #include <asm/ucontext.h>
#include <asm/siginfo.h>
/* /*
#include <sys/signal.h> #include <sys/signal.h>
...@@ -22,6 +23,17 @@ ...@@ -22,6 +23,17 @@
#include <ucontext.h> #include <ucontext.h>
*/ */
/* This is the sigaction structure from the Linux 2.1.68 kernel which
is used with the rt_sigaction system call. For 386 this is not
defined in any public header file. */
struct kernel_sigaction {
__sighandler_t k_sa_handler;
unsigned long sa_flags;
void (*sa_restorer) (void);
sigset_t sa_mask;
};
enum { enum {
$PROT_NONE = PROT_NONE, $PROT_NONE = PROT_NONE,
$PROT_READ = PROT_READ, $PROT_READ = PROT_READ,
...@@ -43,7 +55,7 @@ typedef struct _xmmreg $Xmmreg; ...@@ -43,7 +55,7 @@ typedef struct _xmmreg $Xmmreg;
typedef struct _fpstate $Fpstate; typedef struct _fpstate $Fpstate;
typedef struct timespec $Timespec; typedef struct timespec $Timespec;
typedef struct timeval $Timeval; typedef struct timeval $Timeval;
typedef struct sigaction $Sigaction; typedef struct kernel_sigaction $Sigaction;
typedef siginfo_t $Siginfo; typedef siginfo_t $Siginfo;
typedef struct sigaltstack $Sigaltstack; typedef struct sigaltstack $Sigaltstack;
typedef struct sigcontext $Sigcontext; typedef struct sigcontext $Sigcontext;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment