diff -r ac608464be80 src/arch/arm/linux/process.cc --- a/src/arch/arm/linux/process.cc Thu Oct 18 18:35:42 2012 -0500 +++ b/src/arch/arm/linux/process.cc Mon Oct 22 16:45:21 2012 -0500 @@ -108,7 +108,7 @@ /* 30 */ SyscallDesc("utime", unimplementedFunc), /* 31 */ SyscallDesc("unused#31", unimplementedFunc), /* 32 */ SyscallDesc("unused#32", unimplementedFunc), - /* 33 */ SyscallDesc("access", unimplementedFunc), + /* 33 */ SyscallDesc("access", accessFunc), /* 34 */ SyscallDesc("nice", unimplementedFunc), /* 35 */ SyscallDesc("unused#35", unimplementedFunc), /* 36 */ SyscallDesc("sync", unimplementedFunc), diff -r ac608464be80 src/sim/syscall_emul.hh --- a/src/sim/syscall_emul.hh Thu Oct 18 18:35:42 2012 -0500 +++ b/src/sim/syscall_emul.hh Mon Oct 22 16:45:21 2012 -0500 @@ -335,6 +335,10 @@ SyscallReturn cloneFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); +/// Target access() handler +SyscallReturn accessFunc(SyscallDesc *desc, int num, + LiveProcess *p, ThreadContext *tc); + /// Futex system call /// Implemented by Daniel Sanchez /// Used by printf's in multi-threaded apps diff -r ac608464be80 src/sim/syscall_emul.cc --- a/src/sim/syscall_emul.cc Thu Oct 18 18:35:42 2012 -0500 +++ b/src/sim/syscall_emul.cc Mon Oct 22 16:45:21 2012 -0500 @@ -851,3 +851,20 @@ } } +SyscallReturn +accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc) +{ + int index = 0; + + string path; + if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index))) + return (TheISA::IntReg)-EFAULT; + + // Adjust path for current working directory + path = p->fullPath(path); + + mode_t mode = p->getSyscallArg(tc, index); + + int result = access(path.c_str(), mode); + return (result == -1) ? -errno : result; +}