sigaction : using "void (*sa_sigaction)(int, siginfo_t *, void *);"

Discussion in 'C Programming' started by Alexandre, Apr 5, 2004.

  1. Alexandre

    Alexandre Guest

    hello,

    in sigaction manpage it's written :

    sa_sigaction also specifies the action to be associated with signum.
    This function receives the signal number as its first argument, a
    pointer to a siginfo_t as its second argument and a pointer to a ucon-
    text_t (cast to void *) as its third argument.

    so we can pass arguments to the signal handler (throught "void*"), but I
    can't find the way...
    no way to put it anywhere...

    example :

    void ping(int sig, siginfo_t *siginf, void *ptr)
    {
    ....
    }

    int main()
    {
    struct sigaction sa_ping;
    int foo;

    foo = 3;

    sa_ping.sa_sigaction = ping;
    sigemptyset(&sa_ping.sa_mask);
    sa_ping.sa_flags = 0;
    sigaction(SIGUSR1, &sa_ping, 0);
    ....
    }

    where I can pass foo value in argument in ping (with a cast in (int *) )???


    if someone has an idea, I'll be thankfull

    Alexandre
    Alexandre, Apr 5, 2004
    #1
    1. Advertising

  2. Alexandre

    Eric Sosman Guest

    Alexandre wrote:
    >
    > hello,
    >
    > in sigaction manpage it's written :
    > [lots of stuff having nothing to do with C]


    You probably want comp.unix.programmer. Followups set.

    --
    Eric Sosman, Apr 5, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Robertson, Jr.
    Replies:
    1
    Views:
    960
    Kathy Burke
    Jun 25, 2003
  2. pete
    Replies:
    1
    Views:
    2,921
    Jon Yates
    Aug 29, 2003
  3. Mike - EMAIL IGNORED

    sigaction, muxex, condition variable

    Mike - EMAIL IGNORED, Aug 8, 2007, in forum: C++
    Replies:
    5
    Views:
    653
  4. Neal Becker

    sigaction?

    Neal Becker, Nov 4, 2010, in forum: Python
    Replies:
    1
    Views:
    310
    Lawrence D'Oliveiro
    Nov 7, 2010
  5. Replies:
    4
    Views:
    254
Loading...

Share This Page