jehanne: introduce libposix_getdents machinery
This commit is contained in:
@ -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. */
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user