summaryrefslogtreecommitdiffstats
path: root/build/has/timegm.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-06 16:04:05 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-06 16:04:05 -0400
commitf976c98d334dce9ba30aa7da4427bb530aeea536 (patch)
treeff48eba03fc0ce3a3497118142b87ebaa6865bf7 /build/has/timegm.c
parentc74947f39063218f3cbd884e4ebaafe8dfc9302c (diff)
downloadbfs-f976c98d334dce9ba30aa7da4427bb530aeea536.tar.xz
xtime: Use the libc's timegm() if present
Diffstat (limited to 'build/has/timegm.c')
-rw-r--r--build/has/timegm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/build/has/timegm.c b/build/has/timegm.c
new file mode 100644
index 0000000..6e2d155
--- /dev/null
+++ b/build/has/timegm.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <time.h>
+
+int main(void) {
+ struct tm tm = {0};
+ return (int)timegm(&tm);
+}