I am going to rollback this change. I could not find any way for implementing getdents() using readdir() or other similar C functions. All these functions require a DIR* where as getdents() provides a file descriptor. While it is possible to obtain a DIR * from the fd, closing the DIR* would close the fd as well, which means that the application cannot use the fd any longer.

--
Nilay


On Tue, 21 Oct 2014, Mitch Hayenga via gem5-dev wrote:

changeset:   10484:6709bbcf564d
user:        Michael Adler <[email protected]>
date:        Mon Oct 20 16:44:53 2014 -0500
summary:     sim: implement getdents/getdents64 in user mode


Errors:
build/ARM/sim/syscall_emul.cc:881:30: error: use of undeclared identifier
'SYS_getdents'
   int bytes_read = syscall(SYS_getdents, fd, bufArg.bufferPtr(), nbytes);
                            ^
build/ARM/sim/syscall_emul.cc:899:30: error: use of undeclared identifier
'SYS_getdents64'
   int bytes_read = syscall(SYS_getdents64, fd, bufArg.bufferPtr(),
nbytes);


It looks like this recent changeset for syscall emulation directly makes a
syscall to SYS_getdents.  Which seemingly does not exist on mac OS X.

From the getdents manpage:
"This is not the function you are interested in.  Look at readdir(3) for
the POSIX conforming C library interface."


- Mitch
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to