diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | nq.c | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile index 4df9cf2..c6cc8d6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS=-g -std=c89 -Wall -O2 +CFLAGS=-g -Wall -O2 all: nq nq: nq.c clean: diff --git a/README.md b/README.md index 15805f7..cc7fe58 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ These small utilities allow creating very lightweight job queue systems which require no setup, maintenance, supervision, or any long-running processes. -`nq` should run on any POSIX.1-2008 compliant system using directories -where flock(2) works. +`nq` should run on any POSIX.1-2008 compliant system which also +provides a working flock(2). Tested on Linux 4.1, OpenBSD 5.7 and +FreeBSD 10.1. The intended purpose is ad-hoc queuing of command lines (e.g. for building several targets of a Makefile, downloading multiple files one diff --git a/nq.c b/nq.c index 0bbb009..ba8dc1c 100644 --- a/nq.c +++ b/nq.c @@ -3,7 +3,7 @@ * -w ... wait for all jobs/listed jobs queued so far to finish * -t ... exit 0 if no (listed) job needs waiting * - * - requires POSIX.1-2008 + * - requires POSIX.1-2008 and having flock(2) * - enforcing order works like this: * - every job has a flock(2)ed output file ala ",TIMESTAMP.PID" * - every job starts only after all earlier flock(2)ed files finished @@ -19,7 +19,8 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -#define _POSIX_C_SOURCE 200809L +/* for FreeBSD. */ +#define _WITH_DPRINTF #include <sys/file.h> #include <sys/stat.h> |