summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/opendir.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/opendir.c')
-rw-r--r--otherlibs/unix/opendir.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/otherlibs/unix/opendir.c b/otherlibs/unix/opendir.c
new file mode 100644
index 000000000..0fa82657f
--- /dev/null
+++ b/otherlibs/unix/opendir.c
@@ -0,0 +1,17 @@
+#include <mlvalues.h>
+#include "unix.h"
+#include <sys/types.h>
+#ifdef HAS_DIRENT
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#endif
+
+value unix_opendir(path) /* ML */
+ value path;
+{
+ DIR * d;
+ d = opendir(String_val(path));
+ if (d == (DIR *) NULL) uerror("opendir", path);
+ return (value) d;
+}