On 24 Jan 2017, at 22:08, Jason Lowe-Power wrote:
Hi Brandon,
I think this is a "real" bug:
http://qa.gem5.org//1905/compiling-problem-gem5-mac-os-10-11-6-scons-build-arm-gem5-opt.
I think there are a few more places that need an #ifdef NO_STATFS.
Could
you look into it and post a patch if there's a problem? If not, please
reply to the gem5 QA post and let them know.
Can people try this one and probably get the #ifdefs right for NetBSD as
well? There are at least 3 different checks for that code; if people
don’t care about “style” I could get it right, but ..
diff -r e47703369039 src/sim/syscall_emul.hh
--- a/src/sim/syscall_emul.hh Fri Jan 20 14:12:58 2017 -0500
+++ b/src/sim/syscall_emul.hh Tue Jan 24 23:45:04 2017 +0000
@@ -70,6 +70,8 @@
#include <sys/stat.h>
#if (NO_STATFS == 0)
#include <sys/statfs.h>
+#else
+#include <sys/mount.h>
#endif
#include <sys/time.h>
#include <sys/uio.h>
@@ -530,20 +532,25 @@
{
TypedBufferArg<typename OS::tgt_statfs> tgt(addr);
+ tgt->f_type = TheISA::htog(host->f_type);
#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD__)
- tgt->f_type = 0;
+ tgt->f_bsize = TheISA::htog(host->f_iosize);
#else
- tgt->f_type = TheISA::htog(host->f_type);
+ tgt->f_bsize = TheISA::htog(host->f_bsize);
#endif
- tgt->f_bsize = TheISA::htog(host->f_bsize);
tgt->f_blocks = TheISA::htog(host->f_blocks);
tgt->f_bfree = TheISA::htog(host->f_bfree);
tgt->f_bavail = TheISA::htog(host->f_bavail);
tgt->f_files = TheISA::htog(host->f_files);
tgt->f_ffree = TheISA::htog(host->f_ffree);
memcpy(&tgt->f_fsid, &host->f_fsid, sizeof(host->f_fsid));
+#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD__)
+ tgt->f_namelen = TheISA::htog(host->f_namemax);
+ tgt->f_frsize = TheISA::htog(host->f_bsize);
+#else
tgt->f_namelen = TheISA::htog(host->f_namelen);
tgt->f_frsize = TheISA::htog(host->f_frsize);
+#endif
memcpy(&tgt->f_spare, &host->f_spare, sizeof(host->f_spare));
tgt.copyOut(mem);
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev