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


Shaun Jackman wrote:
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.


Actually, the comment was referring to the functions in the libc/syscalls directory. I checked in the patch with the explanation added.


Thanks,

-- Jeff J.

Cheers,
Shaun

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	1.1.1.1
+++ 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 */
+#endif /* MISSING_SYSCALL_NAMES */
+
+#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR
+/* 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
-#endif
+#endif /* MISSING_SYSCALL_NAMES || ! 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]