linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Kevin B. Hendricks" <khendricks@ivey.uwo.ca>
To: pnilesh@in.ibm.com, linuxppc-dev@lists.linuxppc.org
Subject: Re: strange sigaction ()
Date: Tue, 6 Mar 2001 10:24:59 -0500	[thread overview]
Message-ID: <01030610245900.20862@localhost> (raw)
In-Reply-To: <CA256A07.003DA9D3.00@d73mta05.au.ibm.com>


Hi,


Try the following, it works for me:

#include <stdlib.h>
#include <stdio.h>
#include <signal.h>

static struct sigaction act;
static void handler (int,siginfo_t *,void *);

int
main ()
{
  act.sa_sigaction=handler;
  act.sa_flags=SA_SIGINFO;
  sigaction (SIGALRM,&act,NULL);
  alarm (1);
  sleep (2);
}

void handler (int x, siginfo_t *s,void *v)
{
    printf ("si_signo   = %d, si_code  = %d, si_errno  = %d\n",s->si_signo,
s->si_code, s->si_errno);
}

[kbhend@localhost kbhend]$ gcc -otest test.c
[kbhend@localhost kbhend]$ ./test
si_signo   = 14, si_code  = 0, si_errno  = 0
[kbhend@localhost kbhend]$


On Tuesday 06 March 2001 06:04, pnilesh@in.ibm.com wrote:
> I am seeing a strange problem with sigaction on powerpc.
>
> static struct sigaction act;
> static void handler (int,siginfo_t *,void *);
> main ()
> {
> sigaction (SIGALRM,&act,NULL);
> alarm (1);
> sleep (2);
> }
>
> void handler (int x, siginfo_t *s,void *v)
> {
>     printf ("si_signo   = %d, si_code  = %d, si_errno  = %d\n",s->si_signo,
> s->si_code, s->si_errno);
> }
>
> This program gives meaningful values on Linux Intel Redhat.
> On Apple Dual G4 PowerPC I am getting junk values
> si_signo = 805464356
> si_errno = 805464640
> si_code = 21
>
> I dont know what is happening.
> Please educate me.
>
> Nilesh
>
>
>

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-03-06 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-06 11:04 strange sigaction () pnilesh
2001-03-06 15:24 ` Kevin B. Hendricks [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-07 12:40 pnilesh
2001-03-07 13:36 ` Kevin B. Hendricks

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=01030610245900.20862@localhost \
    --to=khendricks@ivey.uwo.ca \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=pnilesh@in.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).