sigaction question

sigaction question

Post by Wyllys Ingerso » Tue, 24 Oct 1995 04:00:00

System:  Solaris 2.3/ Sparc 10/51

I seem to be having trouble getting information passed into
a signal interrupt handler.  I want more than just the
signal number.  According to the sigaction man page, I should be
able to do something like the following...

declare a signal handler function like so:

void sig_handler(int sig, siginfo_t *si, void *ctxt)
        blah blah blah


install it like so:

    struct sigaction act, oact;

    act.sa_sigaction = sig_handler;
    act.sa_flags = SA_SIGINFO;

    sigaction(SIGPIPE, &act, &oact);

So, when a SIGPIPE (Also tried SIGINT) is generated I want
the siginfo structure in the handler to be non-NULL.  However,
every time I generate the SIGPIPE or SIGINT (when installed)
the 2nd argument in the handler (struct siginfo *si) is always

Any ideas what is happening, why can't I get this structure
to be non-NULL??


Wyllys Ingersoll                      Interlock Developer

Reston, VA


1. question about sigaction


As we know, sigaction takes an "const struct sigaction *act" as the second
argument. If I define signal handler in a function:

void myfunc()
    struct sigaction act;
    /* set atc */
    /* ... */
    sigaction(SIGINT, &act, NULL);

With getting out of myfunc(), the local variable act will be out-of-scope,
the memory of it will be freed. Will that cause problem?

Thanks in advance!

2. booting with no console ..

3. A question about sigaction and core files

4. binaries for Solaris 2.3

5. sigaction() signal.h question

6. Is a getty server replacing multiple getty processes feasable?

7. question on sigaction() - how to request SIG_IGN?

8. ? How to check existence of variable name passed as argument

9. Serial port polling using sigaction()...

10. sigaction sa_sigaction wheres my calling pid???

11. Problems with sigaction

12. Signal handling: signal() vs. sigaction()

13. signal handler & sigaction()