From d32bd15a65de4df6102e3d5449e3af586ca81e0e Mon Sep 17 00:00:00 2001 From: Nicolas Joly Date: Mon, 8 Jun 2009 11:46:07 +0000 Subject: [PATCH] Various compat linux siginfo fixes. - alpha: add missing _uid member to SIGCHLD structure. - amd64: add missing typedef, and fix padding size. - arm: add missing linux_siginfo definition. --- sys/compat/linux/arch/alpha/linux_siginfo.h | 3 ++- sys/compat/linux/arch/amd64/linux_siginfo.h | 6 +++--- .../linux/arch/{alpha => arm}/linux_siginfo.h | 25 +++++++++------------- 3 files changed, 15 insertions(+), 19 deletions(-) copy sys/compat/linux/arch/{alpha => arm}/linux_siginfo.h (83%) diff --git a/sys/compat/linux/arch/alpha/linux_siginfo.h b/sys/compat/linux/arch/alpha/linux_siginfo.h index 4a004172bfd..2ae35c22fd2 100644 --- a/sys/compat/linux/arch/alpha/linux_siginfo.h +++ b/sys/compat/linux/arch/alpha/linux_siginfo.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_siginfo.h,v 1.4 2008/04/28 20:23:42 martin Exp $ */ +/* $NetBSD: linux_siginfo.h,v 1.5 2008/11/23 23:48:48 njoly Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -69,6 +69,7 @@ typedef struct linux_siginfo { /* SIGCHLD */ struct { linux_pid_t _pid; + linux_uid_t _uid; int _status; linux_clock_t _utime; linux_clock_t _stime; diff --git a/sys/compat/linux/arch/amd64/linux_siginfo.h b/sys/compat/linux/arch/amd64/linux_siginfo.h index 3c3f93208fd..4eeb4e1212e 100644 --- a/sys/compat/linux/arch/amd64/linux_siginfo.h +++ b/sys/compat/linux/arch/amd64/linux_siginfo.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_siginfo.h,v 1.4 2008/11/23 23:48:48 njoly Exp $ */ +/* $NetBSD: linux_siginfo.h,v 1.5 2009/05/27 12:20:37 njoly Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -34,7 +34,7 @@ #ifndef _AMD64_LINUX_SIGINFO_H #define _AMD64_LINUX_SIGINFO_H -#define LINUX___ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) +#define LINUX___ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) #define LINUX_SI_MAX_SIZE 128 #define LINUX_SI_PAD_SIZE \ ((LINUX_SI_MAX_SIZE - LINUX___ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) @@ -45,7 +45,7 @@ typedef union linux_sigval { } linux_sigval_t; -struct linux_siginfo { +typedef struct linux_siginfo { int lsi_signo; int lsi_errno; int lsi_code; diff --git a/sys/compat/linux/arch/alpha/linux_siginfo.h b/sys/compat/linux/arch/arm/linux_siginfo.h similarity index 83% copy from sys/compat/linux/arch/alpha/linux_siginfo.h copy to sys/compat/linux/arch/arm/linux_siginfo.h index 4a004172bfd..4191cc90b20 100644 --- a/sys/compat/linux/arch/alpha/linux_siginfo.h +++ b/sys/compat/linux/arch/arm/linux_siginfo.h @@ -1,9 +1,6 @@ -/* $NetBSD: linux_siginfo.h,v 1.4 2008/04/28 20:23:42 martin Exp $ */ +/* $NetBSD: linux_siginfo.h,v 1.1 2002/01/14 23:14:39 bjh21 Exp $ */ /*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * * This code is derived from software contributed to The NetBSD Foundation * by Eric Haszlakiewicz. * @@ -29,8 +26,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _ALPHA_LINUX_SIGINFO_H -#define _ALPHA_LINUX_SIGINFO_H +#ifndef _ARM_LINUX_SIGINFO_H +#define _ARM_LINUX_SIGINFO_H typedef union linux_sigval { int sival_int; @@ -38,14 +35,14 @@ typedef union linux_sigval { } linux_sigval_t; #define SI_MAX_SIZE 128 -#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4) +#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3) typedef struct linux_siginfo { int lsi_signo; int lsi_errno; int lsi_code; union { - int _pad[SI_PAD_SIZE]; + int _pad[SI_PAD_SIZE]; /* kill() */ struct { @@ -69,6 +66,7 @@ typedef struct linux_siginfo { /* SIGCHLD */ struct { linux_pid_t _pid; + linux_uid_t _uid; int _status; linux_clock_t _utime; linux_clock_t _stime; @@ -76,18 +74,15 @@ typedef struct linux_siginfo { /* SIGPOLL */ struct { - int _band; - int _fd; + int _band; + int _fd; } _sigpoll; /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ struct { - void *_addr; + void *_addr; } _sigfault; } _sidata; } linux_siginfo_t; -#define lsi_pid _sidata._kill._pid -#define lsi_uid _sidata._kill._uid - -#endif /* !_ALPHA_LINUX_SIGINFO_H */ +#endif /* !_ARM_LINUX_SIGINFO_H */ -- 2.11.4.GIT