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