This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] add <sys/dir.h>
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: newlib <newlib at sources dot redhat dot com>
- Date: Tue, 10 Aug 2010 23:14:48 -0500
- Subject: [PATCH] add <sys/dir.h>
The predecessor of POSIX.1 <dirent.h> and struct dirent was 4.2 BSD's
<sys/dir.h> and struct direct[1]. glibc[2] and the BSDs[3][4][5] still
provide the old-style header for compatibility.
Patch attached.
Yaakov
Cygwin/X
[1] http://www.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
[2] http://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/dir.h
[3] http://svn.freebsd.org/viewvc/base/head/sys/sys/dir.h?view=markup
[4] http://www.openbsd.org/cgi-bin/cvsweb/src/sys/sys/dir.h
[5] http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/dir.h
2010-08-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/include/sys/dir.h: New BSD-compatibility header.
Index: libc/include/sys/dir.h
--- /dev/null
+++ libc/include/sys/dir.h
@@ -0,0 +1,18 @@
+/* BSD predecessor of POSIX.1 <dirent.h> and struct dirent */
+
+#ifndef _SYS_DIR_H_
+#define _SYS_DIR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <dirent.h>
+
+#define direct dirent
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_SYS_DIR_H_*/