Skip to content

Commit a118ffe

Browse files
committed
Use opendir from newlib
1 parent ed69e7f commit a118ffe

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

newlib/configure.host

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ case "${host}" in
546546
mips*-ps2-*)
547547
sys_dir=ps2
548548
posix_dir=posix
549-
newlib_cflags="${newlib_cflags} -G0 -DHAVE_NANOSLEEP -DHAVE_OPENDIR"
549+
newlib_cflags="${newlib_cflags} -G0 -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN -D_NO_EXECVE -DNO_EXEC"
550550
;;
551551
mmix-knuth-mmixware)
552552
sys_dir=mmixware

newlib/libc/sys/ps2/sys/dirent.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
#define _SYS_DIRENT_H
33

44
typedef struct __dirdesc {
5-
int dd_fd;
6-
char *dd_buf;
5+
int dd_fd; /* directory file */
6+
int dd_loc; /* position in buffer */
7+
int dd_seek;
8+
char *dd_buf; /* buffer */
9+
int dd_len; /* buffer length */
10+
int dd_size; /* amount of data in buffer */
711
} DIR;
812

913
# define __dirfd(dp) ((dp)->dd_fd)
@@ -16,8 +20,22 @@ typedef struct __dirdesc {
1620
#define d_ino d_fileno /* compatibility */
1721

1822
struct dirent {
19-
struct stat d_stat;
23+
ino_t d_fileno; /* file number of entry */
24+
off_t d_off; /* Not an offset; see below */
25+
unsigned short int d_reclen; /* Length of this record */
26+
unsigned char d_type; /* Type of file; not supported
27+
by all filesystem types */
2028
char d_name[MAXNAMLEN + 1];
2129
};
2230

31+
#define DT_UNKNOWN 0
32+
#define DT_FIFO 1
33+
#define DT_CHR 2
34+
#define DT_DIR 4
35+
#define DT_BLK 6
36+
#define DT_REG 8
37+
#define DT_LNK 10
38+
#define DT_SOCK 12
39+
#define DT_WHT 14
40+
2341
#endif

0 commit comments

Comments
 (0)