signal.h defines SA_SIGINFO, but it doesn't seem to work; in the following
testcase, hiphup gets info passed as NULL.

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

void hiphup(int signo, siginfo_t *info, void *context)
{
  if (info == NULL) { printf("info NULL!\n"); return; }
  printf("got signal\nsigno: %d, info->si_signo: %d\n",
         signo, info->si_signo);
  return;
}

int main(int argc, char **argv)
{
  struct sigaction act;
  act.sa_mask = 0;
  act.sa_flags = SA_SIGINFO;
  act.sa_sigaction = hiphup;
  sigaction(SIGHUP, &act, NULL);
  raise(SIGHUP);
  return 0;
}


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to