OSDN Git Service

- trim any trailing whitespace
[uclinux-h8/uClibc.git] / libc / misc / dirent / dirstream.h
index 5cb63a2..370886a 100644 (file)
@@ -26,9 +26,8 @@ Cambridge, MA 02139, USA.  */
 
 #include <features.h>
 #include <sys/types.h>
-#ifdef __UCLIBC_HAS_THREADS__
-#include <pthread.h>
-#endif
+
+#include <bits/uClibc_mutex.h>
 
 /* For now, syscall readdir () only supports one entry at a time. It
  * will be changed in the future.
@@ -61,17 +60,15 @@ struct __dirstream {
 
   /* total size of buffer */
   size_t dd_max;
+
   /* lock */
-#ifdef __UCLIBC_HAS_THREADS__
-  pthread_mutex_t dd_lock;
-#else
-  void *dd_lock;
-#endif
+  __UCLIBC_MUTEX(dd_lock);
 };                             /* stream data from opendir() */
 
 
-extern int __getdents(unsigned int fd, struct dirent *dirp, unsigned int count);
-extern int __getdents64 (unsigned int fd, struct dirent64 *dirp, unsigned int count);
+extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden;
+#ifdef __UCLIBC_HAS_LFS__
+extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden;
+#endif
 
 #endif /* dirent.h  */