implement statfs64, utimes and clock_gettime
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2034 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c
index 7f28d5c..f1f81ad 100644
--- a/coregrind/vg_syscalls.c
+++ b/coregrind/vg_syscalls.c
@@ -4052,7 +4052,16 @@
/* int statfs(const char *path, struct statfs *buf); */
MAYBE_PRINTF("statfs ( %p, %p )\n",arg1,arg2);
SYSCALL_TRACK( pre_mem_read_asciiz, tid, "statfs(path)", arg1 );
- SYSCALL_TRACK( pre_mem_write, tid, "stat(buf)",
+ SYSCALL_TRACK( pre_mem_write, tid, "statfs(buf)",
+ arg2, sizeof(struct statfs) );
+}
+
+PRE(statfs64)
+{
+ /* int statfs64(const char *path, struct statfs *buf); */
+ MAYBE_PRINTF("statfs64 ( %p, %p )\n",arg1,arg2);
+ SYSCALL_TRACK( pre_mem_read_asciiz, tid, "statfs64(path)", arg1 );
+ SYSCALL_TRACK( pre_mem_write, tid, "statfs64(buf)",
arg2, sizeof(struct statfs) );
}
@@ -4061,6 +4070,11 @@
VG_TRACK( post_mem_write, arg2, sizeof(struct statfs) );
}
+POST(statfs64)
+{
+ VG_TRACK( post_mem_write, arg2, sizeof(struct statfs64) );
+}
+
PRE(symlink)
{
/* int symlink(const char *oldpath, const char *newpath); */
@@ -4281,6 +4295,30 @@
VG_TRACK(post_mem_write, arg1, sizeof(struct timex));
}
+PRE(clock_gettime)
+{
+ /* int clock_gettime(clockid_t clk_id, struct timespec *tp); */
+ MAYBE_PRINTF("clock_gettime(%d, %p)\n" ,arg1,arg2);
+ SYSCALL_TRACK(pre_mem_write, tid, "clock_gettime(tp)",
+ arg2, sizeof(struct timespec));
+}
+
+POST(clock_gettime)
+{
+ if (!VG_(is_kerror)(res) && res == 0)
+ VG_TRACK( post_mem_write, arg2, sizeof(struct timespec) );
+}
+
+PRE(utimes)
+{
+ /* int utimes(const char *filename, struct timeval *tvp); */
+ MAYBE_PRINTF("utimes ( %p, %p )\n", arg1,arg2);
+ SYSCALL_TRACK( pre_mem_read_asciiz, tid, "utimes(filename)", arg1 );
+ if (arg2 != (UInt)NULL)
+ SYSCALL_TRACK( pre_mem_read, tid, "utimes(tvp)", arg2,
+ sizeof(struct timeval) );
+}
+
#define SIGNAL_SIMULATION 1
PRE(pause)
@@ -4656,6 +4694,7 @@
SYSBA(socketcall, True),
SYSBA(stat, False),
SYSBA(statfs, False),
+ SYSBA(statfs64, False),
SYSB_(symlink, True),
SYSBA(stat64, False),
SYSBA(fstat64, False),
@@ -4667,11 +4706,13 @@
SYSB_(unlink, True),
SYSBA(uname, False),
SYSB_(utime, True),
+ SYSB_(utimes, False),
SYSBA(waitpid, True),
SYSBA(wait4, True),
SYSB_(writev, True),
SYSB_(prctl, True),
SYSBA(adjtimex, False),
+ SYSBA(clock_gettime, False),
/* new signal handling makes these normal blocking syscalls */
SYSB_(pause, True),
diff --git a/coregrind/vg_unsafe.h b/coregrind/vg_unsafe.h
index 91e283d..5ce8bd0 100644
--- a/coregrind/vg_unsafe.h
+++ b/coregrind/vg_unsafe.h
@@ -90,7 +90,8 @@
/* 2.0 at least, for gid_t and loff_t */
#include <sys/types.h>
-#include <sys/statfs.h>
+#include <asm/statfs.h>
+#undef statfs
#include <sys/sysinfo.h>