aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-22 12:58:37 +0100
committerMattias Andrée <m@maandree.se>2026-02-22 12:58:37 +0100
commitcf92368317b4bbceaff1935105ce8790e7e1b610 (patch)
tree1b8170471bdad79405c6dde8dad02a54b9d89c7c
parentUpdate e-mail (diff)
downloadsleep-until-cf92368317b4bbceaff1935105ce8790e7e1b610.tar.gz
sleep-until-cf92368317b4bbceaff1935105ce8790e7e1b610.tar.bz2
sleep-until-cf92368317b4bbceaff1935105ce8790e7e1b610.tar.xz
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--DEPENDENCIES4
-rw-r--r--Makefile7
-rw-r--r--README14
-rw-r--r--config.mk11
-rw-r--r--sleep-until.18
5 files changed, 26 insertions, 18 deletions
diff --git a/DEPENDENCIES b/DEPENDENCIES
index 92e22d9..57a4e92 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -7,11 +7,11 @@ RUNTIME DEPENDENCIES:
BUILD DEPENDENCIES:
libc (glibc>=2.8)
- cc
+ c99
make
coreutils
sed
- auto-auto-complete (out-put, for shell tab-compeltion)
+ auto-auto-complete (opt-out, for shell tab-completion)
INSTALL DEPENDENCIES:
diff --git a/Makefile b/Makefile
index 61d51fb..3c03fe2 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,8 @@ zsh: sleep-until.zsh
fish: sleep-until.fish
clocks.h:
- sed -n 's/^[ \t]*#[ \t]*define[ \t][ \t]*\(CLOCK_[^ \t]*\).*$$/X(\1)/p' < /usr/include/bits/time.h > $@
+ sed -n 's/^[ \t]*#[ \t]*define[ \t][ \t]*\(CLOCK_[^ \t]*\).*$$/X(\1)/p' < $(CLOCK_HEADER_FILE) | \
+ sed '/X(CLOCK_SGI_CYCLE)/d' > $@
sleep-until.o: sleep-until.c clocks.h
$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
@@ -63,6 +64,6 @@ uninstall:
-rmdir -- "$(DESTDIR)$(PREFIX)/share/bash-completion"
clean:
- -rm -f -- sleep-until *.o clocks.h *.bash *.zsh *.fish
+ -rm -f -- sleep-until *.o *.su clocks.h *.bash *.zsh *.fish
-.PHONY: all base shell bash zsh fish install install-base install-shell install-base install-zsh install-fish uninstall clean
+.PHONY: all base shell bash zsh fish install install-base install-shell install-zsh install-fish uninstall clean
diff --git a/README b/README
index 76d6de9..b71824c 100644
--- a/README
+++ b/README
@@ -7,7 +7,7 @@ SYNOPSIS
DESCRIPTION
Pause until TIMEPOINT. TIMEPOINT is the number of seconds
since Epoch, in UTC but not accounting for leap seconds,
- by default. If CLOCKNAME is specifed, TIMEPOINT is the
+ by default. If CLOCKNAME is specified, TIMEPOINT is the
number of seconds since the zerotime of that clock.
TIMEPOINT may be an arbitrary floating point number.
Pause is continued when interrupted.
@@ -18,17 +18,17 @@ DESCRIPTION
* CLOCK_BOOTTIME
* CLOCK_REALTIME_ALARM
* CLOCK_BOOTTIME_ALARM
- Note that the neither course clocks, CLOCK_MONOTONIC_RAW
- (the proper implementation of a monotonic clock), and
- CLOCK_TAI does not work.
+ Note that the neither the coarse clocks, CLOCK_MONOTONIC_RAW
+ (the proper implementation of a monotonic clock), nor
+ CLOCK_TAI work.
RATIONALE
- Previously, the best wait to sleep until a specific time
+ Previously, the best way to sleep until a specific time
was to use date, sleep, and arithmetics in Bash. This is
- very inconvenient, and only allows sleep over a monotonic
+ very inconvenient, and only allows sleep on a monotonic
clock.
- This progam was written so that the author could combine
+ This program was written so that the author could combine
it with mplayer to construct a custom alarm clock.
SEE ALSO
diff --git a/config.mk b/config.mk
index eb4100f..ea62250 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,15 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
-CC = cc
+CC = c99
CPPFLAGS = -D_POSIX_C_SOURCE=199309L
-CFLAGS = -std=c99 -Wall -O2
+CFLAGS =
LDFLAGS = -s
+
+CLOCK_HEADER_FILE != \
+ if test -r /usr/include/bits/time.h; then \
+ printf '%s\n' /usr/include/bits/time.h; \
+ else \
+ printf '%s\n' /usr/include/linux/time.h; \
+ fi
diff --git a/sleep-until.1 b/sleep-until.1
index c166d7a..a7cb9a0 100644
--- a/sleep-until.1
+++ b/sleep-until.1
@@ -9,7 +9,7 @@ sleep-until - sleep until a specified time
.SH DESCRIPTION
Pause until \fItimepoint\fP. \fItimepoint\fP is the number of
seconds since Epoch, in UTC but not accounting for leap seconds,
-by default. If \fIclockname\fP is specifed, \fItimepoint\fP is
+by default. If \fIclockname\fP is specified, \fItimepoint\fP is
the number of seconds since the zerotime of that clock.
\fItimepoint\fP may be an arbitrary floating point number.
Pause is continued when interrupted.
@@ -31,9 +31,9 @@ On Linux 4.2.2 the clocks that can be used are:
*
\fBCLOCK_BOOTTIME_ALARM\fP
.PP
-Note that the neither course clocks, \fBCLOCK_MONOTONIC_RAW\fP
-(the proper implementation of a monotonic clock), and
-\fBCLOCK_TAI\fP does not work.
+Note that the neither the coarse clocks, \fBCLOCK_MONOTONIC_RAW\fP
+(the proper implementation of a monotonic clock), nor
+\fBCLOCK_TAI\fP work.
.SH EXIT STATUS
.TP
0