From 6c2f2b9d62b196296e827f8bb7336a39e80695a9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 17 Mar 2010 14:49:14 +0100 Subject: libblkid: add microsecond resolution for cache entries The libblkid library uses stat.st_mtine to detect changes on the device. The last update time of of the device in the cache is stored as TIME= tag in the /etc/blkid.tab file. Linux since 2.5.48 supports nanosecond resolution and more precise time is available in the stat.st_mtim timespec struct. This patch add microsecond precision to TIME= tag in the cache file, old format: TIME="" the new format: TIME="." This change is backwardly compatible. Now, the blkid_verify() function checks stat.st_mtime and stat.st_mtim.tv_nsec/1000. Test: # e2label /dev/sdb1 AAAA old version: # blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1 /dev/sdb1: LABEL="AAAA" /dev/sdb1: LABEL="AAAA" new version: # blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1 /dev/sdb1: LABEL="AAAA" /dev/sdb1: LABEL="BBBB" Signed-off-by: Karel Zak --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9cc20b7ac..96d7219f9 100644 --- a/configure.ac +++ b/configure.ac @@ -601,6 +601,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ AC_CHECK_MEMBERS([struct termios.c_line],,, [[#include ]]) +AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, + [#include ]) + AC_CHECK_DECLS([ ADDR_NO_RANDOMIZE, FDPIC_FUNCPTRS, -- cgit v1.2.3-55-g7522