summaryrefslogtreecommitdiffstats
path: root/build/has
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-07 13:34:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-07 15:13:28 -0400
commit3908e7ef7ecaffd7b54228d09baeb1db83b0e45d (patch)
treead41f84cbac0011a717d875f0df1c62bf3fc83ad /build/has
parentc7320b94af8db53b0a4b0a96e37d6e81a0d4a68c (diff)
downloadbfs-3908e7ef7ecaffd7b54228d09baeb1db83b0e45d.tar.xz
build: Check for 1- and 2-argument getmntent() variants
Diffstat (limited to 'build/has')
-rw-r--r--build/has/getmntent-1.c9
-rw-r--r--build/has/getmntent-2.c10
2 files changed, 19 insertions, 0 deletions
diff --git a/build/has/getmntent-1.c b/build/has/getmntent-1.c
new file mode 100644
index 0000000..9854dcd
--- /dev/null
+++ b/build/has/getmntent-1.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <mntent.h>
+#include <stdio.h>
+
+int main(void) {
+ return !getmntent(stdin);
+}
diff --git a/build/has/getmntent-2.c b/build/has/getmntent-2.c
new file mode 100644
index 0000000..71f0220
--- /dev/null
+++ b/build/has/getmntent-2.c
@@ -0,0 +1,10 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <stdio.h>
+#include <sys/mnttab.h>
+
+int main(void) {
+ struct mnttab mnt;
+ return getmntent(stdin, &mnt);
+}