diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-05-02 18:10:35 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-05-02 18:10:35 +0000 |
commit | a33004e479d39b0f184f3f48bfed2b45fba5bb81 (patch) | |
tree | d0bd1a5814ead7afa9f770430f68c0ad359a543c /usr.bin/tar/bsdtar_platform.h | |
parent | 1867695ee64b8ee4fa4b68a44c5df776f53ffca8 (diff) | |
download | FreeBSD-src-a33004e479d39b0f184f3f48bfed2b45fba5bb81.zip FreeBSD-src-a33004e479d39b0f184f3f48bfed2b45fba5bb81.tar.gz |
More of Juergen Lock's patches for Linux.
(fflags support on Linux, nanosecond timestamp portability, enable
64-bit file offsets)
Diffstat (limited to 'usr.bin/tar/bsdtar_platform.h')
-rw-r--r-- | usr.bin/tar/bsdtar_platform.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tar/bsdtar_platform.h b/usr.bin/tar/bsdtar_platform.h index fbabedb..1c5a930 100644 --- a/usr.bin/tar/bsdtar_platform.h +++ b/usr.bin/tar/bsdtar_platform.h @@ -41,6 +41,7 @@ #include <paths.h> /* For _PATH_DEFTAPE */ #define HAVE_CHFLAGS 1 +#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec #if __FreeBSD__ > 4 #define HAVE_GETOPT_LONG 1 @@ -70,6 +71,7 @@ /* Linux */ #ifdef LINUX +#define _FILE_OFFSET_BITS 64 /* For a 64-bit off_t */ #include <stdint.h> /* for uintmax_t */ #define BSDTAR_FILESIZE_TYPE uintmax_t #define BSDTAR_FILESIZE_PRINTF "%ju" @@ -78,9 +80,15 @@ #define _GNU_SOURCE #define _PATH_DEFTAPE "/dev/st0" #define HAVE_GETOPT_LONG 1 -#define st_atimespec st_atim -#define st_mtimespec st_mtim -#define st_ctimespec st_ctim + +#ifdef HAVE_STRUCT_STAT_TIMESPEC +/* Fetch the nanosecond portion of the timestamp from a struct stat pointer. */ +#define ARCHIVE_STAT_MTIME_NANOS(pstat) (pstat)->st_mtim.tv_nsec +#else +/* High-res timestamps aren't available, so just use stubs here. */ +#define ARCHIVE_STAT_MTIME_NANOS(pstat) 0 +#endif + #endif /* |