]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
convert a couple more
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 15 Nov 2004 17:19:22 +0000 (17:19 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 15 Nov 2004 17:19:22 +0000 (17:19 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3012

coregrind/vg_syscalls.c
memcheck/tests/scalar.c
memcheck/tests/scalar.stderr.exp

index 00d6fdb9f934c17170e77aabe42c7482b289eb5e..dbfac09e39678875d3d141f5b0a1dbdf6d59e819 100644 (file)
@@ -1663,17 +1663,16 @@ PREx(sys_setfsuid, 0)
    PRE_REG_READ1(long, "setfsuid", vki_uid_t, uid);
 }
 
-PRE(_sysctl)
+PREx(sys_sysctl, 0)
 {
-   /* int _sysctl(struct __sysctl_args *args); */
-   PRINT("_sysctl ( %p )", arg1 );
-   PRE_MEM_WRITE( "_sysctl(args)", arg1, sizeof(struct __vki_sysctl_args) );
+   PRINT("sys_sysctl ( %p )", arg1 );
+   PRE_REG_READ1(long, "sysctl", struct __sysctl_args *, args);
+   PRE_MEM_WRITE( "sysctl(args)", arg1, sizeof(struct __vki_sysctl_args) );
 }
 
-POST(_sysctl)
+POSTx(sys_sysctl)
 {
    POST_MEM_WRITE( arg1, sizeof(struct __vki_sysctl_args) );
-
 }
 
 PREx(sys_sched_getscheduler, 0/*???*/)
@@ -5659,11 +5658,16 @@ PREx(sys_writev, MayBlock)
    }
 }
 
-PRE(prctl)
+PREx(sys_prctl, MayBlock)
 {
-   /* int prctl(int option, unsigned long arg2, unsigned long arg3,
-      unsigned long arg4, unsigned long arg5); */
    PRINT( "prctl ( %d, %d, %d, %d, %d )", arg1, arg2, arg3, arg4, arg5 );
+   // XXX: too simplistic, often not all args are used
+   // Nb: can't use "arg2".."arg5" here because that's our own macro...
+   PRE_REG_READ5(long, "prctl",
+                 int, option, unsigned long, parg2, unsigned long, parg3,
+                 unsigned long, parg4, unsigned long, parg5);
+   // XXX: totally wrong... we need to look at the 'option' arg, and do
+   // PRE_MEM_READs/PRE_MEM_WRITEs as necessary...
 }
 
 PREx(sys_adjtimex, 0)
@@ -6528,7 +6532,7 @@ static const struct sys_info sys_info[] = {
    SYSX_(__NR_writev,           sys_writev),       // 146 * P
    SYSX_(__NR_getsid,           sys_getsid),       // 147 * P
    SYSX_(__NR_fdatasync,        sys_fdatasync),    // 148 * P
-   SYSBA(__NR__sysctl,          sys_sysctl, 0),    // 149 *
+   SYSXY(__NR__sysctl,          sys_sysctl),       // 149 * L
 
    SYSX_(__NR_mlock,            sys_mlock),           // 150 * P
    SYSX_(__NR_munlock,          sys_munlock),         // 151 * P
@@ -6556,7 +6560,7 @@ static const struct sys_info sys_info[] = {
 
    SYSX_(__NR_setresgid,        sys_setresgid16),  // 170 ## (non-standard)
    SYSXY(__NR_getresgid,        sys_getresgid16),  // 171 ## L
-   SYSB_(__NR_prctl,            sys_prctl, MayBlock), // 172 *
+   SYSX_(__NR_prctl,            sys_prctl),        // 172 * L
    //   (__NR_rt_sigreturn,     sys_rt_sigreturn), // 173 (x86) ()
    SYSXY(__NR_rt_sigaction,     sys_rt_sigaction), // 174 (x86) ()
 
index 45df119fb25922d2d6e33fc1eed6eb04b99829cf..0555207f489cdc279828705527055b841995e8a4 100644 (file)
@@ -633,8 +633,8 @@ int main(void)
    SY(__NR_fdatasync, x0-1);
 
    // __NR__sysctl 149
//GO(__NR__sysctl, ".s .m");
//SY(__NR__sysctl);
  GO(__NR__sysctl, "1s 1m");
  SY(__NR__sysctl, x0);
 
    // __NR_mlock 150
    GO(__NR_mlock, "2s 0m");
@@ -724,9 +724,9 @@ int main(void)
    GO(__NR_getresgid, "3s 3m");
    SY(__NR_getresgid, x0, x0, x0);
 
-   // __NR_prctl              172
//GO(__NR_prctl, ".s .m");
//SY(__NR_prctl);
+   // __NR_prctl 172
  GO(__NR_prctl, "5s 0m");
  SY(__NR_prctl);
 
    // __NR_rt_sigreturn 173
    GO(__NR_rt_sigreturn, "n/a");
index 160adee1cef8f7ed450c12c68e1ff39c29e14715..d3415d24e8c3ec1a2348d6dc67a5cf556743ae3e 100644 (file)
@@ -1917,6 +1917,20 @@ Syscall param fdatasync(fd) contains uninitialised byte(s)
    by 0x........: __libc_start_main (...libc...)
    by 0x........: ...
 -----------------------------------------------------
+149:        __NR__sysctl 1s 1m
+-----------------------------------------------------
+
+Syscall param sysctl(args) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param sysctl(args) points to unaddressable byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
 150:          __NR_mlock 2s 0m
 -----------------------------------------------------
 
@@ -2209,6 +2223,34 @@ Syscall param getresgid16(sgid) points to unaddressable byte(s)
    by 0x........: ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 -----------------------------------------------------
+172:          __NR_prctl 5s 0m
+-----------------------------------------------------
+
+Syscall param prctl(option) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param prctl(parg2) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param prctl(parg3) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param prctl(parg4) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param prctl(parg5) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+-----------------------------------------------------
 173:   __NR_rt_sigreturn n/a
 -----------------------------------------------------
 -----------------------------------------------------