diff options
| author | Mattias Andrée <m@maandree.se> | 2026-02-22 12:58:37 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-02-22 12:58:37 +0100 |
| commit | cf92368317b4bbceaff1935105ce8790e7e1b610 (patch) | |
| tree | 1b8170471bdad79405c6dde8dad02a54b9d89c7c | |
| parent | Update e-mail (diff) | |
| download | sleep-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-- | DEPENDENCIES | 4 | ||||
| -rw-r--r-- | Makefile | 7 | ||||
| -rw-r--r-- | README | 14 | ||||
| -rw-r--r-- | config.mk | 11 | ||||
| -rw-r--r-- | sleep-until.1 | 8 |
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: @@ -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 @@ -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 @@ -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 |
