diff options
author | Karel Zak | 2015-03-06 13:17:20 +0100 |
---|---|---|
committer | Karel Zak | 2015-03-06 13:17:20 +0100 |
commit | 26e8964b9db51e27cc6eaf5510ebc8eac8443f33 (patch) | |
tree | 1adb27c7542eca3eadea4e3457f7bbab24f1b39f /include | |
parent | Merge branch 'logger-man-syslog-routine' of https://github.com/rgerhards/util... (diff) | |
download | kernel-qcow2-util-linux-26e8964b9db51e27cc6eaf5510ebc8eac8443f33.tar.gz kernel-qcow2-util-linux-26e8964b9db51e27cc6eaf5510ebc8eac8443f33.tar.xz kernel-qcow2-util-linux-26e8964b9db51e27cc6eaf5510ebc8eac8443f33.zip |
lib/timer: use separate file for timers
It seems that static builds require -lpthread for timer_* functions.
It's better to keep it out of our libs (e.g. libmount) to avoid
unnecessary dependence.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/Makemodule.am | 21 | ||||
-rw-r--r-- | include/monotonic.h | 14 | ||||
-rw-r--r-- | include/timer.h | 11 |
3 files changed, 25 insertions, 21 deletions
diff --git a/include/Makemodule.am b/include/Makemodule.am index 8d7c881d5..e5fb6d3d0 100644 --- a/include/Makemodule.am +++ b/include/Makemodule.am @@ -4,10 +4,9 @@ dist_noinst_HEADERS += \ include/at.h \ include/bitops.h \ include/blkdev.h \ - include/monotonic.h \ - include/c.h \ include/canonicalize.h \ include/carefulputc.h \ + include/c.h \ include/closestream.h \ include/colors.h \ include/cpuset.h \ @@ -28,6 +27,7 @@ dist_noinst_HEADERS += \ include/mbsalign.h \ include/md5.h \ include/minix.h \ + include/monotonic.h \ include/namespace.h \ include/nls.h \ include/optutils.h \ @@ -36,21 +36,22 @@ dist_noinst_HEADERS += \ include/path.h \ include/pathnames.h \ include/procutils.h \ + include/pt-bsd.h \ + include/pt-mbr.h \ + include/pt-mbr-partnames.h \ + include/pt-sgi.h \ + include/pt-sun.h \ include/randutils.h \ include/readutmp.h \ include/rpmatch.h \ include/setproctitle.h \ + include/statfs_magic.h include/strutils.h \ - include/swapprober.h \ include/swapheader.h \ + include/swapprober.h \ include/sysfs.h \ + include/timer.h \ include/timeutils.h \ include/ttyutils.h \ include/widechar.h \ - include/xalloc.h \ - include/pt-sgi.h \ - include/pt-bsd.h \ - include/pt-mbr.h \ - include/pt-mbr-partnames.h \ - include/pt-sun.h \ - include/statfs_magic.h + include/xalloc.h diff --git a/include/monotonic.h b/include/monotonic.h index bbebfe0b9..a499fa34a 100644 --- a/include/monotonic.h +++ b/include/monotonic.h @@ -1,18 +1,10 @@ -#ifndef UTIL_LINUX_BOOTTIME_H -#define UTIL_LINUX_BOOTTIME_H +#ifndef UTIL_LINUX_MONOTONIC_H +#define UTIL_LINUX_MONOTONIC_H -/* - * Uses clock_gettime() that requires $CLOCKGETTIME_LIBS - */ -#include <signal.h> #include <sys/time.h> extern int get_boot_time(struct timeval *boot_time); extern int gettime_monotonic(struct timeval *tv); -extern int setup_timer(timer_t * t_id, struct itimerval *timeout, - void (*timeout_handler)(int, siginfo_t *, void *)); -extern void cancel_timer(timer_t * t_id); - -#endif /* UTIL_LINUX_BOOTTIME_H */ +#endif /* UTIL_LINUX_MONOTONIC_H */ diff --git a/include/timer.h b/include/timer.h new file mode 100644 index 000000000..aa9f9c018 --- /dev/null +++ b/include/timer.h @@ -0,0 +1,11 @@ +#ifndef UTIL_LINUX_TIMER_H +#define UTIL_LINUX_TIMER_H + +#include <signal.h> +#include <sys/time.h> + +extern int setup_timer(timer_t * t_id, struct itimerval *timeout, + void (*timeout_handler)(int, siginfo_t *, void *)); +extern void cancel_timer(timer_t * t_id); + +#endif /* UTIL_LINUX_TIMER_H */ |