summaryrefslogtreecommitdiff
path: root/src/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdeps')
-rw-r--r--src/sysdeps/trydirfd.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/sysdeps/trydirfd.c b/src/sysdeps/trydirfd.c
new file mode 100644
index 0000000..c2eccf2
--- /dev/null
+++ b/src/sysdeps/trydirfd.c
@@ -0,0 +1,19 @@
+/* ISC license. */
+
+#undef _POSIX_C_SOURCE
+#undef _XOPEN_SOURCE
+
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE
+#endif
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__
+#endif
+
+#include <dirent.h>
+
+int main (void)
+{
+ DIR *dir = opendir(".") ;
+ return dirfd(dir) ;
+}