summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-19 14:50:48 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-19 15:50:45 -0400
commit48d91c62cd27c15fe0e928abf6d023d17e9c41f7 (patch)
treea6dd2dfb7acddb2e45bdbdddf4fced3ae0155e15 /config
parent111cc3af4b6132fda47d18683a04985ca7c571c2 (diff)
downloadbfs-48d91c62cd27c15fe0e928abf6d023d17e9c41f7.tar.xz
config: Check for struct stat::st_{a,c,m,birth}{tim,timespec}
Diffstat (limited to 'config')
-rw-r--r--config/header.mk4
-rw-r--r--config/st-acmtim.c12
-rw-r--r--config/st-acmtimespec.c12
-rw-r--r--config/st-birthtim.c9
-rw-r--r--config/st-birthtimespec.c9
5 files changed, 46 insertions, 0 deletions
diff --git a/config/header.mk b/config/header.mk
index 38f1277..5b6ff11 100644
--- a/config/header.mk
+++ b/config/header.mk
@@ -20,6 +20,10 @@ HEADERS := \
${GEN}/pipe2.h \
${GEN}/posix-spawn-addfchdir.h \
${GEN}/posix-spawn-addfchdir-np.h \
+ ${GEN}/st-acmtim.h \
+ ${GEN}/st-acmtimespec.h \
+ ${GEN}/st-birthtim.h \
+ ${GEN}/st-birthtimespec.h \
${GEN}/statx.h \
${GEN}/statx-syscall.h \
${GEN}/strerror-l.h \
diff --git a/config/st-acmtim.c b/config/st-acmtim.c
new file mode 100644
index 0000000..d687ab0
--- /dev/null
+++ b/config/st-acmtim.c
@@ -0,0 +1,12 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <sys/stat.h>
+
+int main(void) {
+ struct stat sb = {0};
+ unsigned int a = sb.st_atim.tv_sec;
+ unsigned int c = sb.st_ctim.tv_sec;
+ unsigned int m = sb.st_mtim.tv_sec;
+ return a + c + m;
+}
diff --git a/config/st-acmtimespec.c b/config/st-acmtimespec.c
new file mode 100644
index 0000000..f747bc0
--- /dev/null
+++ b/config/st-acmtimespec.c
@@ -0,0 +1,12 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <sys/stat.h>
+
+int main(void) {
+ struct stat sb = {0};
+ unsigned int a = sb.st_atimespec.tv_sec;
+ unsigned int c = sb.st_ctimespec.tv_sec;
+ unsigned int m = sb.st_mtimespec.tv_sec;
+ return a + c + m;
+}
diff --git a/config/st-birthtim.c b/config/st-birthtim.c
new file mode 100644
index 0000000..4964571
--- /dev/null
+++ b/config/st-birthtim.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <sys/stat.h>
+
+int main(void) {
+ struct stat sb = {0};
+ return sb.st_birthtim.tv_sec;
+}
diff --git a/config/st-birthtimespec.c b/config/st-birthtimespec.c
new file mode 100644
index 0000000..91a613f
--- /dev/null
+++ b/config/st-birthtimespec.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <sys/stat.h>
+
+int main(void) {
+ struct stat sb = {0};
+ return sb.st_birthtimespec.tv_sec;
+}