# /* sig_maild.c * * This program sends a signal to the mail daemon to wake it up when * it has work to do. It is a separate program because it must run * set-user-id to the mail daemon. */ #define lockfile "/maild/lock" /* the mail daemon's lock file */ #define SIGCTLA 16 /* special interrupt signal */ main () { char cpid[10]; /* daemon's pid, from lock file */ int pid; /* integer pid for daemon */ int lkfd; /* lock file descriptor */ if ((lkfd = open (lockfile, 0)) < 0) exit (1); read (lkfd, cpid, sizeof (cpid)); close (lkfd); pid = atoi (cpid); kill (pid, SIGCTLA); }