diff options
| author | Mike Barcroft <mike@FreeBSD.org> | 2002-09-10 18:12:16 +0000 |
|---|---|---|
| committer | Mike Barcroft <mike@FreeBSD.org> | 2002-09-10 18:12:16 +0000 |
| commit | 9ad8e31ee817854515bca6274ff960317dc479bb (patch) | |
| tree | fe9a9607cb3e929fc652b2ff859bbcf59ff52334 /include | |
| parent | b2c6ac5b2b568c2c1ef38bdf93b9e44874eed3da (diff) | |
Notes
Diffstat (limited to 'include')
| -rw-r--r-- | include/dirent.h | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/include/dirent.h b/include/dirent.h index b3de757a0427..f6e4ccd53c19 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -41,13 +41,18 @@ * The kernel defines the format of directory entries returned by * the getdirentries(2) system call. */ +#include <sys/cdefs.h> #include <sys/dirent.h> -#ifdef _POSIX_SOURCE -typedef void * DIR; -#else +#if __BSD_VISIBLE || __XSI_VISIBLE +/* + * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer + * to the specification. + */ +#define d_ino d_fileno /* backward and XSI compatibility */ +#endif -#define d_ino d_fileno /* backward compatibility */ +#if __BSD_VISIBLE /* definitions for library routines operating on directories. */ #define DIRBLKSIZ 1024 @@ -80,29 +85,37 @@ typedef struct _dirdesc { #define NULL 0 #endif -#endif /* _POSIX_SOURCE */ +#else /* !__BSD_VISIBLE */ -#ifndef _KERNEL +typedef void * DIR; -#include <sys/cdefs.h> +#endif /* __BSD_VISIBLE */ + +#ifndef _KERNEL __BEGIN_DECLS +#if __BSD_VISIBLE +DIR *__opendir2(const char *, int); +int alphasort(const void *, const void *); +int getdents(int, char *, int); +int getdirentries(int, char *, int, long *); +#endif DIR *opendir(const char *); struct dirent * readdir(DIR *); +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 +int readdir_r(DIR *, struct dirent *, struct dirent **); +#endif void rewinddir(DIR *); -int closedir(DIR *); -#ifndef _POSIX_SOURCE -DIR *__opendir2(const char *, int); -long telldir(DIR *); -void seekdir(DIR *, long); +#if __BSD_VISIBLE int scandir(const char *, struct dirent ***, int (*)(struct dirent *), int (*)(const void *, const void *)); -int alphasort(const void *, const void *); -int getdents(int, char *, int); -int getdirentries(int, char *, int, long *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -#endif /* not POSIX */ +#endif +#if __XSI_VISIBLE +void seekdir(DIR *, long); +long telldir(DIR *); +#endif +int closedir(DIR *); __END_DECLS #endif /* !_KERNEL */ |
