diff options
| author | jtc <jtc@NetBSD.org> | 1993-12-10 19:16:09 +0000 |
|---|---|---|
| committer | jtc <jtc@NetBSD.org> | 1993-12-10 19:16:09 +0000 |
| commit | 7b954b21d9ed0bae44dd3ddec8a5d996e4c8b577 (patch) | |
| tree | 15d7c9ae78646d4596cad0a6406a65aca84a8372 /include | |
| parent | 04dac8afca162cb25890af467580f42288239299 (diff) | |
Expand "u_long" & "u_short" to "unsigned long" and "unsigned short".
Some programs (like NSCA httpd) include <dirent.h> without first including
<sys/types.h> so the u_foo types aren't declared. I don't think POSIX.1
allows us to include <sys/types.h> in <dirent.h> either.
Diffstat (limited to 'include')
| -rw-r--r-- | include/dirent.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/include/dirent.h b/include/dirent.h index e10192c798b..0b1d93f4eee 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)dirent.h 5.18 (Berkeley) 2/23/91 - * $Id: dirent.h,v 1.3 1993/08/01 18:44:56 mycroft Exp $ + * $Id: dirent.h,v 1.4 1993/12/10 19:16:09 jtc Exp $ */ #ifndef _DIRENT_H_ @@ -46,9 +46,9 @@ */ struct dirent { - u_long d_fileno; /* file number of entry */ - u_short d_reclen; /* length of this record */ - u_short d_namlen; /* length of string in d_name */ + unsigned long d_fileno; /* file number of entry */ + unsigned short d_reclen; /* length of this record */ + unsigned short d_namlen; /* length of string in d_name */ #ifdef _POSIX_SOURCE char d_name[255 + 1]; /* name must be no longer than this */ #else @@ -57,17 +57,8 @@ struct dirent { #endif }; -#ifdef _POSIX_SOURCE -typedef void * DIR; -#else - -#define d_ino d_fileno /* backward compatibility */ - -/* definitions for library routines operating on directories. */ -#define DIRBLKSIZ 1024 - /* structure describing an open directory. */ -typedef struct _dirdesc { +typedef struct { int dd_fd; /* file descriptor associated with directory */ long dd_loc; /* offset in current buffer */ long dd_size; /* amount of data returned by getdirentries */ @@ -77,16 +68,22 @@ typedef struct _dirdesc { void *dd_ddloc; /* Linked list of ddloc structs for telldir/seekdir */ } DIR; + +#ifndef _POSIX_SOURCE +#define d_ino d_fileno /* backward compatibility */ + +/* definitions for library routines operating on directories. */ +#define DIRBLKSIZ 1024 + #define dirfd(dirp) ((dirp)->dd_fd) #ifndef NULL #define NULL 0 #endif - #endif /* _POSIX_SOURCE */ -#ifndef KERNEL +#ifndef KERNEL #include <sys/cdefs.h> __BEGIN_DECLS |
