summaryrefslogtreecommitdiff
path: root/newlib/libc/sys/rtems/sys/dirent.h
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/rtems/sys/dirent.h')
-rw-r--r--newlib/libc/sys/rtems/sys/dirent.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/newlib/libc/sys/rtems/sys/dirent.h b/newlib/libc/sys/rtems/sys/dirent.h
new file mode 100644
index 00000000000..93808d312b1
--- /dev/null
+++ b/newlib/libc/sys/rtems/sys/dirent.h
@@ -0,0 +1,52 @@
+#ifndef _SYS_DIRENT_H
+# define _SYS_DIRENT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This file was written to be compatible with the BSD directory
+ * routines, so it looks like it. But it was written from scratch.
+ * Sean Eric Fagan, sef@Kithrup.COM
+ *
+ * Copied to RTEMS configuration without modification.
+ */
+
+typedef struct _dirdesc {
+ int dd_fd;
+ long dd_loc;
+ long dd_size;
+ char *dd_buf;
+ int dd_len;
+ long dd_seek;
+} DIR;
+
+# define __dirfd(dp) ((dp)->dd_fd)
+
+DIR *opendir(const char *);
+struct dirent *readdir(DIR *);
+void rewinddir(DIR *);
+int closedir(DIR *);
+void seekdir(DIR *dir, long loc);
+long telldir(DIR *dir);
+
+#include <sys/types.h>
+
+#include <limits.h>
+
+struct dirent {
+ long d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ /* we need better syntax for variable-sized arrays */
+ unsigned short d_namlen;
+ char d_name[NAME_MAX + 1];
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif