jehanne: introduce libposix_getdents machinery

This commit is contained in:
2017-08-21 01:19:27 +02:00
parent 79333d77e6
commit 075dc184a0
2 changed files with 10 additions and 8 deletions

View File

@ -22,14 +22,9 @@
#define MAXNAMLEN 127 /* sizeof(struct dirent.d_name)-1 */ #define MAXNAMLEN 127 /* sizeof(struct dirent.d_name)-1 */
struct dirent #define _LIBPOSIX_H
{ #include <posix.h> /* get dirent structure from posix.h */
ino_t d_ino; #undef _LIBPOSIX_H
char d_name[MAXNAMLEN+1];
unsigned int d_reclen;
};
#define _DIRENT_HAVE_D_RECLEN
typedef struct { typedef struct {
int dd_fd; /* Directory file. */ int dd_fd; /* Directory file. */

View File

@ -250,6 +250,13 @@ getpass(const char *prompt)
return POSIX_getpass(errnop, prompt); return POSIX_getpass(errnop, prompt);
} }
int
getdents (int fd, void *buf, int buf_size)
{
int *errnop = &_REENT->_errno;
return libposix_getdents(errnop, fd, buf, buf_size);
}
#undef pread #undef pread
ssize_t ssize_t
pread(int fd, void *buf, size_t count, off_t offset) pread(int fd, void *buf, size_t count, off_t offset)