On 15 Dec 2016, at 18:17, Brandon Potter wrote:
changeset f9aa72424274 in /z/repo/gem5 details: http://repo.gem5.org/gem5?cmd=changeset;node=f9aa72424274 description: syscall_emul: implement fallocate
Same problem here; you are calling fallocate() which is a linux specific function and thus fails to compile elsewhere.
diffstat: src/arch/x86/linux/process.cc | 2 +- src/sim/syscall_emul.cc | 21 +++++++++++++++++++++ src/sim/syscall_emul.hh | 4 ++++ 3 files changed, 26 insertions(+), 1 deletions(-) diffs (57 lines): diff -r deaf82fd2e7c -r f9aa72424274 src/arch/x86/linux/process.cc --- a/src/arch/x86/linux/process.cc Thu Dec 15 13:16:03 2016 -0500 +++ b/src/arch/x86/linux/process.cc Thu Dec 15 13:16:25 2016 -0500 @@ -503,7 +503,7 @@ /* 282 */ SyscallDesc("signalfd", unimplementedFunc), /* 283 */ SyscallDesc("timerfd_create", unimplementedFunc), /* 284 */ SyscallDesc("eventfd", unimplementedFunc), - /* 285 */ SyscallDesc("fallocate", unimplementedFunc), + /* 285 */ SyscallDesc("fallocate", fallocateFunc), /* 286 */ SyscallDesc("timerfd_settime", unimplementedFunc), /* 287 */ SyscallDesc("timerfd_gettime", unimplementedFunc), /* 288 */ SyscallDesc("accept4", unimplementedFunc), diff -r deaf82fd2e7c -r f9aa72424274 src/sim/syscall_emul.cc --- a/src/sim/syscall_emul.cc Thu Dec 15 13:16:03 2016 -0500 +++ b/src/sim/syscall_emul.cc Thu Dec 15 13:16:25 2016 -0500 @@ -935,6 +935,27 @@ } SyscallReturn +fallocateFunc(SyscallDesc *desc, int callnum, LiveProcess *process, + ThreadContext *tc) +{ + int index = 0; + int tgt_fd = process->getSyscallArg(tc, index); + int mode = process->getSyscallArg(tc, index); + off_t offset = process->getSyscallArg(tc, index); + off_t len = process->getSyscallArg(tc, index); + + int sim_fd = process->getSimFD(tgt_fd); + if (sim_fd < 0) + return -EBADF; + + int result = fallocate(sim_fd, mode, offset, len); + if (result < 0) + return -errno; + + return 0; +} + +SyscallReturnaccessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,int index) { diff -r deaf82fd2e7c -r f9aa72424274 src/sim/syscall_emul.hh --- a/src/sim/syscall_emul.hh Thu Dec 15 13:16:03 2016 -0500 +++ b/src/sim/syscall_emul.hh Thu Dec 15 13:16:25 2016 -0500 @@ -157,6 +157,10 @@ SyscallReturn ignoreFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); +// Target fallocateFunc() handler. +SyscallReturn fallocateFunc(SyscallDesc *desc, int num, + LiveProcess *p, ThreadContext *tc); + /// Target exit() handler: terminate current context. SyscallReturn exitFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); _______________________________________________ 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
