All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: strange sigaction ()
@ 2001-03-07 12:40 pnilesh
  2001-03-07 13:36 ` Kevin B. Hendricks
  0 siblings, 1 reply; 4+ messages in thread
From: pnilesh @ 2001-03-07 12:40 UTC (permalink / raw)
  To: khendricks; +Cc: linuxppc-dev


It did not work for me !!
Is the problem with kernel or it is elsewhere ?
Which kernel patch will fix this ?



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/

^ permalink raw reply	[flat|nested] 4+ messages in thread
* strange sigaction ()
@ 2001-03-06 11:04 pnilesh
  2001-03-06 15:24 ` Kevin B. Hendricks
  0 siblings, 1 reply; 4+ messages in thread
From: pnilesh @ 2001-03-06 11:04 UTC (permalink / raw)
  To: linuxppc-dev


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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-03-07 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-07 12:40 strange sigaction () pnilesh
2001-03-07 13:36 ` Kevin B. Hendricks
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 11:04 pnilesh
2001-03-06 15:24 ` Kevin B. Hendricks

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.