]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Implement sched_setparam(), sched_getparam() and sched_yield()
authorJulian Seward <jseward@acm.org>
Fri, 3 May 2002 21:18:11 +0000 (21:18 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 3 May 2002 21:18:11 +0000 (21:18 +0000)
(Helge Deller)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@208

vg_syscall_mem.c

index 18c0b9befa95694914dd8cd36951368a91336bd0..abcc63e8302ddf74d432462657918957e24283c7 100644 (file)
@@ -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;