From: Ulrich Drepper Date: Thu, 19 Aug 1999 21:00:36 +0000 (+0000) Subject: Add change from main branch. X-Git-Tag: cvs/glibc_2-1-2~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d36f40995aa75b732cd40146cb302f1983de2eee;p=thirdparty%2Fglibc.git Add change from main branch. --- diff --git a/dirent/dirent.h b/dirent/dirent.h index 139f41de7c4..deb06fca6cf 100644 --- a/dirent/dirent.h +++ b/dirent/dirent.h @@ -272,10 +272,28 @@ extern int versionsort64 __P ((__const __ptr_t __e1, __const __ptr_t __e2)); Reading starts at offset *BASEP, and *BASEP is updated with the new position after reading. Returns the number of bytes read; zero when at end of directory; or -1 for errors. */ + +fndef __USE_FILE_OFFSET64 extern __ssize_t getdirentries __P ((int __fd, char *__restrict __buf, size_t __nbytes, __off_t *__restrict __basep)); +# else +# ifdef __REDIRECT +extern __ssize_t __REDIRECT (getdirentries, + __P ((int __fd, char *__restrict __buf, + size_t __nbytes, + __off_t *__restrict __basep)), + getdirentries64); +# else +# define getdirentries getdirentries64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern __ssize_t getdirentries64 __P ((int __fd, char *__restrict __buf, + size_t __nbytes, + __off64_t *__restrict __basep)); +# endif #endif /* Use BSD or misc. */ diff --git a/sysdeps/generic/seekdir.c b/sysdeps/generic/seekdir.c index c12d3af3c00..19ec4e0175a 100644 --- a/sysdeps/generic/seekdir.c +++ b/sysdeps/generic/seekdir.c @@ -25,7 +25,7 @@ void seekdir (dirp, pos) DIR *dirp; - off_t pos; + long int pos; { if (dirp == NULL) { diff --git a/sysdeps/generic/telldir.c b/sysdeps/generic/telldir.c index 3400829cb76..ddd9003f08e 100644 --- a/sysdeps/generic/telldir.c +++ b/sysdeps/generic/telldir.c @@ -22,18 +22,18 @@ #include /* Return the current position of DIRP. */ -off_t +long int telldir (dirp) DIR *dirp; { if (dirp == NULL) { __set_errno (EINVAL); - return -1; + return -1l; } __set_errno (ENOSYS); - return (off_t) -1; + return -1l; } diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c index 047b4cd11b1..49e80d7938d 100644 --- a/sysdeps/mach/hurd/seekdir.c +++ b/sysdeps/mach/hurd/seekdir.c @@ -27,7 +27,7 @@ void seekdir (dirp, pos) DIR *dirp; - __off_t pos; + long int pos; { __libc_lock_lock (dirp->__lock); /* Change our entry index pointer to POS and discard any data already diff --git a/sysdeps/mach/hurd/telldir.c b/sysdeps/mach/hurd/telldir.c index 0063ddf6887..ed373fb190d 100644 --- a/sysdeps/mach/hurd/telldir.c +++ b/sysdeps/mach/hurd/telldir.c @@ -25,7 +25,7 @@ /* Return the current position of DIRP. */ /* XXX should be __telldir ? */ -off_t +long int telldir (dirp) DIR *dirp; { diff --git a/sysdeps/unix/bsd/telldir.c b/sysdeps/unix/bsd/telldir.c index 29ef72c41e3..d9799b0f9b2 100644 --- a/sysdeps/unix/bsd/telldir.c +++ b/sysdeps/unix/bsd/telldir.c @@ -39,18 +39,18 @@ __libc_lock_define_initialized(static, lock) /* Locks above data. */ /* Return the current position of DIRP. */ -off_t +long int telldir (dirp) DIR *dirp; { struct record *new; - off_t pos; + long int pos; __libc_lock_lock (lock); new = malloc (sizeof *new); if (new == NULL) - return (off_t) -1; + return -1l; new->pos = dirp->filepos; new->offset = dirp->offset; @@ -71,7 +71,7 @@ telldir (dirp) void seekdir (dirp, pos) DIR *dirp; - __off_t pos; + long int pos; { struct record *r, **prevr; diff --git a/sysdeps/unix/seekdir.c b/sysdeps/unix/seekdir.c index caecbefd781..f9df9c18b47 100644 --- a/sysdeps/unix/seekdir.c +++ b/sysdeps/unix/seekdir.c @@ -27,10 +27,10 @@ void seekdir (dirp, pos) DIR *dirp; - __off_t pos; + long int pos; { __libc_lock_lock (dirp->lock); - (void) __lseek(dirp->fd, pos, SEEK_SET); + (void) __lseek (dirp->fd, pos, SEEK_SET); dirp->size = 0; dirp->offset = 0; __libc_lock_unlock (dirp->lock); diff --git a/sysdeps/unix/telldir.c b/sysdeps/unix/telldir.c index f0ad95fd7ca..bb898130def 100644 --- a/sysdeps/unix/telldir.c +++ b/sysdeps/unix/telldir.c @@ -21,7 +21,7 @@ #include /* Return the current position of DIRP. */ -off_t +long int telldir (DIR *dirp) { return dirp->filepos;