All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sizeof (siginfo_t) problem
Date: Mon, 14 Jul 2003 08:48:00 -0700	[thread overview]
Message-ID: <16146.53424.388683.213654@napali.hpl.hp.com> (raw)
In-Reply-To: <20030714084000.J15481@devserv.devel.redhat.com>

>>>>> On Mon, 14 Jul 2003 08:40:00 -0400, Jakub Jelinek <jakub@redhat.com> said:

  Jakub> # if __WORDSIZE == 64
  Jakub> #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
  Jakub> # else
  Jakub> #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
  Jakub> # endif

  Jakub> typedef struct siginfo
  Jakub> {
  Jakub> int si_signo;               /* Signal number.  */
  Jakub> int si_errno;               /* If non-zero, an errno value associated with
  Jakub> this signal, as defined in <errno.h>.  */
  Jakub> int si_code;                /* Signal code.  */

  Jakub> union
  Jakub> {
  Jakub> int _pad[__SI_PAD_SIZE];
  Jakub> ...
  Jakub> struct
  Jakub> {
  Jakub> void *si_addr;      /* Faulting insn/memory ref.  */
  Jakub> } _sigfault;
  Jakub> ...
  Jakub> } _sifields;
  Jakub> } siginfo_t;

  Jakub> The kernel unfortunately does this right on sparc64 and alpha
  Jakub> from 64-bit arches only; ia64, s390x, ppc64 etc. got it
  Jakub> wrong.

The ia64 kernel defines in asm-ia64/siginfo.h:

#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 4)

typedef struct siginfo {
	int si_signo;
	int si_errno;
	int si_code;
	int __pad0;

What's wrong with that?

	--david

  parent reply	other threads:[~2003-07-14 15:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-14 12:40 sizeof (siginfo_t) problem Jakub Jelinek
2003-07-14 13:55 ` Jamie Lokier
2003-07-14 15:02   ` Andreas Schwab
2003-07-14 15:48 ` David Mosberger [this message]
2003-07-14 15:57   ` Jakub Jelinek
2003-07-14 16:52 ` Stephen Rothwell
2003-07-14 17:00   ` Jakub Jelinek
2003-07-14 17:11     ` Stephen Rothwell
2003-07-14 17:14       ` Jakub Jelinek
2003-07-14 17:25         ` Stephen Rothwell
2003-07-14 17:45           ` Jakub Jelinek
2003-07-19 18:32   ` Anton Blanchard
2003-07-21  0:08     ` Stephen Rothwell
2003-07-22 13:42       ` Russell King
2003-07-22 13:57         ` Stephen Rothwell
2003-07-14 18:31 Ulrich Weigand
2003-07-14 18:35 ` Jakub Jelinek
2003-07-14 18:52 Ulrich Weigand
2003-07-15 11:58 Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16146.53424.388683.213654@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=davidm@hpl.hp.com \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.