This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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_*/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]