Added Cygwin build support

strverscmp is included to satisfy a dependency in Cygwin.
Excluded utmp and prctl functions that are not supported currently.
This commit is contained in:
Wayne Porter
2016-03-10 15:04:27 -08:00
parent 1af18812b2
commit eea5e467ae
5 changed files with 184 additions and 8 deletions

View File

@ -21,7 +21,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#ifndef __CYGWIN__
#include <sys/prctl.h>
#endif
#include "c.h"
#define DEFAULT_SLEEPTIME 300
@ -78,8 +80,10 @@ int main(int argc, char *argv[])
sigaction(SIGUSR1, &signal_action, NULL);
sigaction(SIGUSR2, &signal_action, NULL);
#ifndef __CYGWIN__
/* set process name */
prctl(PR_SET_NAME, MY_NAME, NULL, NULL, NULL);
#endif
while (sleep_time > 0) {
sleep_time = sleep(sleep_time);