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]

Re: _opendir vs opendir


I've been using an arm-elf toolchain with a small patch that compiles
both the posix and unix directories. This works with little changes
needed, but one issue is that posix/opendir.c implements opendir
(since HAVE_OPENDIR is not defined), but unix/getcwd.c calls _opendir,
which is not defined anywhere. I've been using the following patch
that uses _syslist.h to redefine _opendir to opendir if HAVE_OPENDIR
is not defined. Is this a clean solution?

Cheers,
Shaun

Index: newlib/libc/include/_syslist.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/_syslist.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 _syslist.h
--- newlib/libc/include/_syslist.h	17 Feb 2000 19:39:46 -0000	1.1.1.1
+++ newlib/libc/include/_syslist.h	19 Aug 2005 22:49:03 -0000
@@ -21,9 +21,12 @@
 #define _unlink unlink
 #define _wait wait
 #define _write write
+#endif /* MISSING_SYSCALL_NAMES */
+
+#ifndef HAVE_OPENDIR
  /* functions not yet sysfaked */
  #define _opendir opendir
  #define _readdir readdir
  #define _closedir closedir
-#endif
-#endif
+#endif /* ! HAVE_OPENDIR */
+#endif /* ! __SYSLIST_H */


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