diff --git a/lib/include/test/spu_syscalls.h b/lib/include/test/spu_syscalls.h index 73d1c6e..4e50e6b 100644 --- a/lib/include/test/spu_syscalls.h +++ b/lib/include/test/spu_syscalls.h @@ -65,4 +65,12 @@ static inline int spu_run(int fd, uint32_t *npc, uint32_t *status) return syscall(SYS_spu_run, fd, npc, status); } + +struct linux_dirent { + unsigned long d_ino; /* Inode number */ + unsigned long d_off; /* Offset to next linux_dirent */ + unsigned short d_reclen; /* Length of this linux_dirent */ + char d_name[]; /* Filename (null-terminated) */ +}; + #endif /* _SPU_SYSCALLS_H */ diff --git a/tests/02-spu_create/07-destroy-vs-readdir-race.c b/tests/02-spu_create/07-destroy-vs-readdir-race.c index 4e89f8b..10943ce 100644 --- a/tests/02-spu_create/07-destroy-vs-readdir-race.c +++ b/tests/02-spu_create/07-destroy-vs-readdir-race.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -47,7 +46,7 @@ static void do_creates(const char *name) } } -static int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) +static int getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int count) { return syscall(SYS_getdents, fd, dirp, count); } @@ -55,7 +54,7 @@ static int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) static void do_readdirs(void) { int dir, rc; - struct dirent dirents[10]; + struct linux_dirent dirents[10]; dir = open("/spu", O_RDONLY); assert(dir >= 0); diff --git a/tests/02-spu_create/08-gang-destroy-vs-readdir-race.c b/tests/02-spu_create/08-gang-destroy-vs-readdir-race.c index 492cc6e..6c814bc 100644 --- a/tests/02-spu_create/08-gang-destroy-vs-readdir-race.c +++ b/tests/02-spu_create/08-gang-destroy-vs-readdir-race.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -48,7 +47,7 @@ static void do_creates(const char *name) } } -static int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) +static int getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int count) { return syscall(SYS_getdents, fd, dirp, count); } @@ -56,7 +55,7 @@ static int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) static void do_readdirs(void) { int dir, rc; - struct dirent dirents[10]; + struct linux_dirent dirents[10]; dir = open("/spu", O_RDONLY); assert(dir >= 0);