diff --git a/newlib/configure.host b/newlib/configure.host index 3630104cc9..caeadcc873 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -527,7 +527,7 @@ case "${host}" in mips*-ps2-*) sys_dir=ps2 posix_dir=posix - newlib_cflags="${newlib_cflags} -G0 -DHAVE_NANOSLEEP -DHAVE_OPENDIR" + newlib_cflags="${newlib_cflags} -G0 -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN -D_NO_EXECVE -DNO_EXEC" ;; mmix-knuth-mmixware) sys_dir=mmixware diff --git a/newlib/libc/sys/ps2/sys/dirent.h b/newlib/libc/sys/ps2/sys/dirent.h index 7b504ee11b..e7a6434f6c 100644 --- a/newlib/libc/sys/ps2/sys/dirent.h +++ b/newlib/libc/sys/ps2/sys/dirent.h @@ -2,8 +2,12 @@ #define _SYS_DIRENT_H typedef struct __dirdesc { - int dd_fd; - char *dd_buf; + int dd_fd; /* directory file */ + int dd_loc; /* position in buffer */ + int dd_seek; + char *dd_buf; /* buffer */ + int dd_len; /* buffer length */ + int dd_size; /* amount of data in buffer */ } DIR; # define __dirfd(dp) ((dp)->dd_fd) @@ -16,8 +20,22 @@ typedef struct __dirdesc { #define d_ino d_fileno /* compatibility */ struct dirent { - struct stat d_stat; + ino_t d_fileno; /* file number of entry */ + off_t d_off; /* Not an offset; see below */ + unsigned short int d_reclen; /* Length of this record */ + unsigned char d_type; /* Type of file; not supported + by all filesystem types */ char d_name[MAXNAMLEN + 1]; }; +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 + #endif \ No newline at end of file