All pastes #27183 Raw Edit

Something

public c v1 · immutable
#27183 ·published 2005-10-31 21:10 UTC
rendered paste body
/* */#include <signal.h>#include <time.h>#include <stdio.h>#include <unistd.h>#include <stdlib.h>void xyz(sigval_t x){   fprintf(stderr, "xyz\n");}int main(int argc, char *argv[]){  struct sigevent sig_spec;  struct itimerspec tmr_setting;  timer_t timer_h;  sig_spec.sigev_notify = SIGEV_THREAD;  sig_spec.sigev_notify_function = xyz;  sig_spec.sigev_notify_attributes = NULL;  if (timer_create(CLOCK_REALTIME, &sig_spec, &timer_h) < 0)  {     perror("timer_create");     exit(1);  }  tmr_setting.it_value.tv_sec = 1;  tmr_setting.it_value.tv_nsec = 0;  tmr_setting.it_interval.tv_sec = 1;  tmr_setting.it_interval.tv_nsec = 0;  if (timer_settime(timer_h, 0, &tmr_setting, NULL) < 0)  {     perror("timer_settime");  }  sleep(30);}