|
From: Dirk M. <mu...@kd...> - 2003-11-19 00:46:22
|
CVS commit by mueller:
implement statfs64, utimes and clock_gettime
M +42 -1 vg_syscalls.c 1.57
M +2 -1 vg_unsafe.h 1.20
--- valgrind/coregrind/vg_syscalls.c #1.56:1.57
@@ -4053,5 +4053,14 @@ PRE(statfs)
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) );
}
@@ -4062,4 +4071,9 @@ POST(statfs)
}
+POST(statfs64)
+{
+ VG_TRACK( post_mem_write, arg2, sizeof(struct statfs64) );
+}
+
PRE(symlink)
{
@@ -4282,4 +4296,28 @@ POST(adjtimex)
}
+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
@@ -4657,4 +4695,5 @@ static const struct sys_info sys_info[]
SYSBA(stat, False),
SYSBA(statfs, False),
+ SYSBA(statfs64, False),
SYSB_(symlink, True),
SYSBA(stat64, False),
@@ -4668,4 +4707,5 @@ static const struct sys_info sys_info[]
SYSBA(uname, False),
SYSB_(utime, True),
+ SYSB_(utimes, False),
SYSBA(waitpid, True),
SYSBA(wait4, True),
@@ -4673,4 +4713,5 @@ static const struct sys_info sys_info[]
SYSB_(prctl, True),
SYSBA(adjtimex, False),
+ SYSBA(clock_gettime, False),
/* new signal handling makes these normal blocking syscalls */
--- valgrind/coregrind/vg_unsafe.h #1.19:1.20
@@ -91,5 +91,6 @@
#include <sys/types.h>
-#include <sys/statfs.h>
+#include <asm/statfs.h>
+#undef statfs
#include <sys/sysinfo.h>
|