_opendir vs opendir

Shaun Jackman sjackman@gmail.com
Mon Aug 22 20:36:00 GMT 2005

2005/8/22, Jeff Johnston <jjohnstn@redhat.com>:
> This would be ok if the #if checked both !defined (HAVE_OPENDIR) ||
> defined (MISSING_SYSCALL_NAMES).  In addition, a comment should be added
> to note that if the opendir syscall is missing, there is a version of
> opendir in the libc/posix directory that can be used.
> Do you want me to check such a patch in or do you wish to submit something?

I'll submit a patch. I'm not entirely sure what the /* functions not
yet sysfaked */ comment meant. I grepped for sysfake in newlib but it
didn't turn up anything. It no longer seemed relevant so I removed it.


2005-08-22  Shaun Jackman  <sjackman@gmail.com>

	* libc/include/_syslist.h: If HAVE_OPENDIR is not defined,
	define _opendir as opendir, _readdir as readdir, and
	_closedir as closedir so that the implementations in
	libc/posix will be used.

diff -u -r1.1.1.1 _syslist.h
--- libc/include/_syslist.h	17 Feb 2000 19:39:46 -0000
+++ libc/include/_syslist.h	22 Aug 2005 20:23:06 -0000
@@ -21,9 +21,15 @@
 #define _unlink unlink
 #define _wait wait
 #define _write write
-/* functions not yet sysfaked */
+/* If the system call interface is missing opendir, readdir, and
+ * closedir, there is an implementation of these functions in
+ * libc/posix that is implemented using open, getdents, and close.
+ */
  #define _opendir opendir
  #define _readdir readdir
  #define _closedir closedir
+#endif /* ! __SYSLIST_H */

More information about the Newlib mailing list