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. */
/* 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;
void
seekdir (dirp, pos)
DIR *dirp;
- __off_t pos;
+ long int pos;
{
struct record *r, **prevr;
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);