From: Roland McGrath Date: Mon, 28 Aug 1995 09:00:05 +0000 (+0000) Subject: * sysdeps/mach/hurd/dirstream.h: Define `struct __dirstream' X-Git-Tag: cvs/libc-950922~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e865adecff6cb94e8c638a47929dcee62267f20;p=thirdparty%2Fglibc.git * sysdeps/mach/hurd/dirstream.h: Define `struct __dirstream' instead of `DIR'. * sysdeps/unix/bsd/dirstream.h: Likewise. * sysdeps/stub/dirstream.h: Likewise. * sysdeps/unix/dirstream.h: Likewise. * sysdeps/mach/hurd/telldir.c: Include "dirstream.h". * sysdeps/mach/hurd/seekdir.c: Likewise. * sysdeps/mach/hurd/opendir.c: Likewise. * sysdeps/mach/hurd/closedir.c: Likewise. * sysdeps/mach/hurd/readdir.c: Likewise. * sysdeps/unix/telldir.c: Likewise. * sysdeps/unix/seekdir.c: Likewise. * sysdeps/unix/rewinddir.c: Likewise. * sysdeps/unix/readdir.c: Likewise. * sysdeps/unix/opendir.c: Likewise. * sysdeps/unix/closedir.c: Likewise. * sysdeps/unix/bsd/telldir.c: Likewise. * sysdeps/unix/bsd/readdir.c: Likewise. * dirent/Makefile (headers): Remove dirstream.h. (distribute): Put it here instead. --- diff --git a/ChangeLog b/ChangeLog index 036a1219c3a..be40e78b986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ Fri Aug 25 12:12:42 1995 Roland McGrath + * sysdeps/mach/hurd/dirstream.h: Define `struct __dirstream' + instead of `DIR'. + * sysdeps/unix/bsd/dirstream.h: Likewise. + * sysdeps/stub/dirstream.h: Likewise. + * sysdeps/unix/dirstream.h: Likewise. + * sysdeps/mach/hurd/telldir.c: Include "dirstream.h". + * sysdeps/mach/hurd/seekdir.c: Likewise. + * sysdeps/mach/hurd/opendir.c: Likewise. + * sysdeps/mach/hurd/closedir.c: Likewise. + * sysdeps/mach/hurd/readdir.c: Likewise. + * sysdeps/unix/telldir.c: Likewise. + * sysdeps/unix/seekdir.c: Likewise. + * sysdeps/unix/rewinddir.c: Likewise. + * sysdeps/unix/readdir.c: Likewise. + * sysdeps/unix/opendir.c: Likewise. + * sysdeps/unix/closedir.c: Likewise. + * sysdeps/unix/bsd/telldir.c: Likewise. + * sysdeps/unix/bsd/readdir.c: Likewise. + * dirent/Makefile (headers): Remove dirstream.h. + (distribute): Put it here instead. + * sysdeps/mach/hurd/mmap.c: Fix inverted test of MAP_FIXED. * stdio/vfscanf.c (number): Allow field width to inhibit first diff --git a/dirent/Makefile b/dirent/Makefile index 02352768d00..532020d1eb8 100644 --- a/dirent/Makefile +++ b/dirent/Makefile @@ -21,11 +21,11 @@ # subdir := dirent -headers := dirent.h dirstream.h +headers := dirent.h routines := opendir closedir readdir rewinddir \ seekdir telldir scandir alphasort \ getdents dirfd -distribute := direct.h +distribute := direct.h dirstream.h tests := list tst-seekdir diff --git a/sysdeps/mach/hurd/closedir.c b/sysdeps/mach/hurd/closedir.c index 6ac86a6cd4f..521787d02db 100644 --- a/sysdeps/mach/hurd/closedir.c +++ b/sysdeps/mach/hurd/closedir.c @@ -24,6 +24,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Close the directory stream DIRP. Return 0 if successful, -1 if not. */ diff --git a/sysdeps/mach/hurd/dirstream.h b/sysdeps/mach/hurd/dirstream.h index 42bbd07c4f7..a8c5fd12cbc 100644 --- a/sysdeps/mach/hurd/dirstream.h +++ b/sysdeps/mach/hurd/dirstream.h @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ The Hurd directory format is the same as `struct dirent', so `readdir' returns a pointer into the buffer we read directory data into. */ -typedef struct +struct __dirstream { void *__fd; /* `struct hurd_fd' pointer for descriptor. */ char *__data; /* Directory block. */ @@ -34,6 +34,6 @@ typedef struct int __entry_ptr; /* Entry number `__ptr' corresponds to. */ unsigned long int __allocation; /* Space allocated for the block. */ unsigned long int __size; /* Total valid data in the block. */ - } DIR; + }; #endif /* dirstream.h */ diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c index 40cb9d0dc09..8ab964a11da 100644 --- a/sysdeps/mach/hurd/opendir.c +++ b/sysdeps/mach/hurd/opendir.c @@ -29,6 +29,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Open a directory stream on NAME. */ diff --git a/sysdeps/mach/hurd/readdir.c b/sysdeps/mach/hurd/readdir.c index 746b11e5234..3c17d248e16 100644 --- a/sysdeps/mach/hurd/readdir.c +++ b/sysdeps/mach/hurd/readdir.c @@ -26,6 +26,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Read a directory entry from DIRP. */ diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c index 9f585eba633..fa4f1f4f523 100644 --- a/sysdeps/mach/hurd/seekdir.c +++ b/sysdeps/mach/hurd/seekdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Seek to position POS in DIRP. */ void diff --git a/sysdeps/mach/hurd/telldir.c b/sysdeps/mach/hurd/telldir.c index 7ce8d1f061a..ccde257a235 100644 --- a/sysdeps/mach/hurd/telldir.c +++ b/sysdeps/mach/hurd/telldir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Return the current position of DIRP. */ off_t diff --git a/sysdeps/stub/dirstream.h b/sysdeps/stub/dirstream.h index 9a3d5a0f05e..7d8bb9697f6 100644 --- a/sysdeps/stub/dirstream.h +++ b/sysdeps/stub/dirstream.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1993 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,10 +21,10 @@ Cambridge, MA 02139, USA. */ #define _DIRSTREAM_H 1 -/* This file should define a typedef `DIR', the data type of directory - stream objects returned by `opendir'. */ +/* This file should define a type `struct __dirstream', the data type of + directory stream objects returned by `opendir'. */ -#error "No system-dependent definition of `DIR'." +#error "No system-dependent definition of `struct __dirstream'." #endif /* dirstream.h */ diff --git a/sysdeps/unix/bsd/dirstream.h b/sysdeps/unix/bsd/dirstream.h index f3bf9ca894d..d46c59ec585 100644 --- a/sysdeps/unix/bsd/dirstream.h +++ b/sysdeps/unix/bsd/dirstream.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,7 +29,7 @@ Cambridge, MA 02139, USA. */ The BSD directory format is the same as `struct dirent', so `readdir' returns a pointer into the buffer we read directory data into. */ -typedef struct +struct __dirstream { int __fd; /* File descriptor. */ @@ -38,11 +38,6 @@ typedef struct size_t __offset; /* Current offset into the block. */ size_t __size; /* Total valid data in the block. */ __off_t __pos; /* Position in directory of this block. */ - } DIR; - -#ifdef __USE_BSD -/* Macro to return the file descriptor used for an open directory. */ -#define dirfd(DIR) ((DIR)->__fd) -#endif + }; #endif /* dirstream.h */ diff --git a/sysdeps/unix/bsd/readdir.c b/sysdeps/unix/bsd/readdir.c index e86a94dd52c..e3d020cd46a 100644 --- a/sysdeps/unix/bsd/readdir.c +++ b/sysdeps/unix/bsd/readdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ #include #include #include "direct.h" - +#include "dirstream.h" /* Read a directory entry from DIRP. */ struct dirent * diff --git a/sysdeps/unix/bsd/telldir.c b/sysdeps/unix/bsd/telldir.c index 0321f954b8d..dbab289a37f 100644 --- a/sysdeps/unix/bsd/telldir.c +++ b/sysdeps/unix/bsd/telldir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,6 +23,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Internal data structure for telldir and seekdir. */ struct record diff --git a/sysdeps/unix/closedir.c b/sysdeps/unix/closedir.c index e01dccb54cc..5f1ac7439a1 100644 --- a/sysdeps/unix/closedir.c +++ b/sysdeps/unix/closedir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Close the directory stream DIRP. Return 0 if successful, -1 if not. */ diff --git a/sysdeps/unix/dirstream.h b/sysdeps/unix/dirstream.h index d8c23959ad1..72fd67c7229 100644 --- a/sysdeps/unix/dirstream.h +++ b/sysdeps/unix/dirstream.h @@ -28,7 +28,7 @@ Cambridge, MA 02139, USA. */ The miscellaneous Unix `readdir' implementations read directory data into a buffer and fill in a `struct dirent' copy in the `DIR' object. */ -typedef struct +struct __dirstream { int __fd; /* File descriptor. */ @@ -38,7 +38,7 @@ typedef struct size_t __size; /* Total valid data in the block. */ struct dirent __entry; /* Returned by `readdir'. */ - } DIR; + }; #define _DIR_dirfd(dirp) ((dirp)->__fd) diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index d03f45e6af7..5cd620676ad 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,6 +29,7 @@ Cambridge, MA 02139, USA. */ #include #include "direct.h" /* This file defines `struct direct'. */ +#include "dirstream.h" /* Open a directory stream on NAME. */ DIR * diff --git a/sysdeps/unix/readdir.c b/sysdeps/unix/readdir.c index 3ffa63e9f61..1842948a358 100644 --- a/sysdeps/unix/readdir.c +++ b/sysdeps/unix/readdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,6 +26,7 @@ Cambridge, MA 02139, USA. */ #include #include "direct.h" /* This file defines `struct direct'. */ +#include "dirstream.h" /* direct.h may have an alternate definition for this. */ #ifndef D_RECLEN diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c index 3b82895e60c..7ad7bc11a3f 100644 --- a/sysdeps/unix/rewinddir.c +++ b/sysdeps/unix/rewinddir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,7 +21,7 @@ Cambridge, MA 02139, USA. */ #include #include #include - +#include "dirstream.h" /* Rewind DIRP to the beginning of the directory. */ void diff --git a/sysdeps/unix/seekdir.c b/sysdeps/unix/seekdir.c index b8d5c3c2ff6..b0a6f5e9d77 100644 --- a/sysdeps/unix/seekdir.c +++ b/sysdeps/unix/seekdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Seek to position POS in DIRP. */ void diff --git a/sysdeps/unix/telldir.c b/sysdeps/unix/telldir.c index c473bbc29df..5dbf1ca3c1d 100644 --- a/sysdeps/unix/telldir.c +++ b/sysdeps/unix/telldir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ Cambridge, MA 02139, USA. */ #include #include #include +#include "dirstream.h" /* Return the current position of DIRP. */ off_t