[Midnightbsd-cvs] src [10966] trunk/include/dirent.h: update definitions

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Jun 15 14:08:33 EDT 2018


Revision: 10966
          http://svnweb.midnightbsd.org/src/?rev=10966
Author:   laffer1
Date:     2018-06-15 14:08:32 -0400 (Fri, 15 Jun 2018)
Log Message:
-----------
update definitions

Modified Paths:
--------------
    trunk/include/dirent.h

Modified: trunk/include/dirent.h
===================================================================
--- trunk/include/dirent.h	2018-06-15 17:22:14 UTC (rev 10965)
+++ trunk/include/dirent.h	2018-06-15 18:08:32 UTC (rev 10966)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -27,7 +28,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)dirent.h	8.2 (Berkeley) 7/28/94
- * $MidnightBSD$
+ * $FreeBSD: stable/10/include/dirent.h 270002 2014-08-14 20:20:21Z jhb $
  */
 
 #ifndef _DIRENT_H_
@@ -55,30 +56,15 @@
 /* definitions for library routines operating on directories. */
 #define	DIRBLKSIZ	1024
 
-struct _telldir;		/* see telldir.h */
-struct pthread_mutex;
+struct _dirdesc;
+typedef struct _dirdesc DIR;
 
-/* structure describing an open directory. */
-typedef struct _dirdesc {
-	int	dd_fd;		/* file descriptor associated with directory */
-	long	dd_loc;		/* offset in current buffer */
-	long	dd_size;	/* amount of data returned by getdirentries */
-	char	*dd_buf;	/* data buffer */
-	int	dd_len;		/* size of data buffer */
-	long	dd_seek;	/* magic cookie returned by getdirentries */
-	long	dd_rewind;	/* magic cookie for rewinding */
-	int	dd_flags;	/* flags for readdir */
-	struct pthread_mutex	*dd_lock;	/* lock */
-	struct _telldir *dd_td;	/* telldir position recording */
-} DIR;
-
-#define	dirfd(dirp)	((dirp)->dd_fd)
-
 /* flags for opendir2 */
 #define DTF_HIDEW	0x0001	/* hide whiteout entries */
 #define DTF_NODUP	0x0002	/* don't return duplicate names */
 #define DTF_REWIND	0x0004	/* rewind after reading union stack */
 #define __DTF_READALL	0x0008	/* everything has been read */
+#define	__DTF_SKIPREAD	0x0010  /* assume internal buffer is populated */
 
 #else /* !__BSD_VISIBLE */
 
@@ -91,9 +77,11 @@
 __BEGIN_DECLS
 #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700
 int	 alphasort(const struct dirent **, const struct dirent **);
+int	 dirfd(DIR *);
 #endif
 #if __BSD_VISIBLE
 DIR	*__opendir2(const char *, int);
+int	 fdclosedir(DIR *);
 int	 getdents(int, char *, int);
 int	 getdirentries(int, char *, int, long *);
 #endif



More information about the Midnightbsd-cvs mailing list