From 78073f1e7439c80358ee98bf71795a111551ce88 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Fri, 3 May 2002 21:18:11 +0000 Subject: [PATCH] Implement sched_setparam(), sched_getparam() and sched_yield() (Helge Deller) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@208 --- vg_syscall_mem.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index 18c0b9befa..abcc63e830 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -2162,17 +2162,32 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) KERNEL_DO_SYSCALL(tid,res); break; - case __NR_sched_setparam: - case __NR_sched_getparam: - case __NR_sched_yield: - if (VG_(clo_instrument)) { - VG_(message)(Vg_UserMsg, - "Warning: noted but unhandled __NR_sched_* syscall (%d).", - syscallno); - VG_(message)(Vg_UserMsg, - " This could cause spurious value errors" - " to appear."); - } + case __NR_sched_setparam: /* syscall 154 */ + /* int sched_setparam(pid_t pid, const struct sched_param *p); */ + if (VG_(clo_instrument)) + VG_(printf)("sched_setparam ( %d, %p )\n", arg1, arg2 ); + must_be_readable( tst, "sched_setparam(ptr)", + arg2, sizeof(struct sched_param) ); + KERNEL_DO_SYSCALL(tid,res); + if (!VG_(is_kerror)(res)) + make_readable( arg2, sizeof(struct sched_param) ); + break; + + case __NR_sched_getparam: /* syscall 155 */ + /* int sched_getparam(pid_t pid, struct sched_param *p); */ + if (VG_(clo_instrument)) + VG_(printf)("sched_getparam ( %d, %p )\n", arg1, arg2 ); + must_be_writable( tst, "sched_getparam(ptr)", + arg2, sizeof(struct sched_param) ); + KERNEL_DO_SYSCALL(tid,res); + if (!VG_(is_kerror)(res)) + make_readable( arg2, sizeof(struct sched_param) ); + break; + + case __NR_sched_yield: /* syscall 158 */ + /* int sched_yield(void); */ + if (VG_(clo_instrument)) + VG_(printf)("sched_yield ()\n" ); KERNEL_DO_SYSCALL(tid,res); break; -- 2.47.2