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

int main(int argc, char **argv)
{
   if (argc != 2) {
      fprintf (stderr, "usage : %s pid\n", argv[0]);
      exit (0);
   }
   
   pid_t pid = atoi (argv[1]);

   sigval mysigval;
   mysigval.sival_int = 1234;

   printf (" --- sending SIGUSR1 signal %d to pid %d, mypid = %d ...\n", SIGUSR1, pid, getpid());

   if (sigqueue(pid, SIGUSR1, mysigval) == -1) {
     psignal (SIGUSR1, "LINE 22");
     perror ("sigqueue error\n");
     exit (0);
   }
   return 0;
}
