about summary refs log tree commit diff
path: root/Src/zsh_system.h
diff options
context:
space:
mode:
authordana <dana@dana.is>2018-06-20 17:29:56 -0500
committerdana <dana@dana.is>2018-06-20 17:29:56 -0500
commit394f3a47e464b67b17e2cb7166df066829250e88 (patch)
tree0fe4262c7857d546878f64b53fc2813e6f59296b /Src/zsh_system.h
parenteada7e1138a3fca90f085dd764ad86098e58c9ac (diff)
downloadzsh-394f3a47e464b67b17e2cb7166df066829250e88.tar.gz
zsh-394f3a47e464b67b17e2cb7166df066829250e88.tar.xz
zsh-394f3a47e464b67b17e2cb7166df066829250e88.zip
43075: Support nanosecond-precision time formatting
* Teach ztrftime() %9. and %N for nanoseconds
* Update prompt expansion to pass sub-second times for time formatting
* Update zsh/stat to pass sub-second times for atime/mtime/ctime

Patch heavily based on Oliver's earlier work @ workers/24059
Diffstat (limited to 'Src/zsh_system.h')
-rw-r--r--Src/zsh_system.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index 5339b496f..8289ee97c 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -250,6 +250,14 @@ struct timezone {
 };
 #endif
 
+/* Used to provide compatibility with clock_gettime() */
+#if !defined(HAVE_STRUCT_TIMESPEC) && !defined(ZSH_OOT_MODULE)
+struct timespec {
+    time_t tv_sec;
+    long tv_nsec;
+};
+#endif
+
 /* There's more than one non-standard way to get at this data */
 #if !defined(HAVE_STRUCT_DIRENT_D_INO) && defined(HAVE_STRUCT_DIRENT_D_STAT)
 # define d_ino d_stat.st_ino