2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include "unix_hints.h"
11 /* This prevents redefinition of struct timeval */
12 #define _AROS_TYPES_TIMEVAL_S_H_
14 #include <aros/debug.h>
16 #include "emul_intern.h"
17 #include "emul_unix.h"
19 #define is_special_dir(x) (x[0] == '.' && (!x[1] || (x[1] == '.' && !x[2])))
22 * Retrieves next item in the directory and updates dirpos.
23 * Also skips unwanted special entries (like . and ..).
24 * Host call lock is already acquired so we don't need to do it.
26 struct dirent
*ReadDir(struct emulbase
*emulbase
, struct filehandle
*fh
, IPTR
*dirpos
)
32 dir
= emulbase
->pdata
.SysIFace
->readdir(fh
->fd
);
38 } while (is_special_dir(dir
->d_name
));
41 bug("[ReadDir] Filehandle %s, ", fh
->hostname
);
43 bug("returning entry: %s\n", dir
->d_name
);
45 bug("end of search\n");
48 *dirpos
= emulbase
->pdata
.SysIFace
->telldir(fh
->fd
);