Date: Sat, 25 Oct 2008 19:29:55 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 151913 for review Message-ID: <200810251929.m9PJTtOT010203@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151913 Change 151913 by peter@peter_cheese on 2008/10/25 19:28:57 Make the sysctl wrapper work a little closer to reality. oldlenp is always written to if non null. This is used to query ideal buffer sizes. Affected files ... .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#17 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#17 (text+ko) ==== @@ -872,16 +872,20 @@ PRE_MEM_READ("sysctl(name)", ARG1, ARG2 * sizeof(int *)); if (ARG5 != (UWord)NULL) PRE_MEM_READ("sysctl(new)", (Addr)ARG5, ARG6); - if (ARG3 != (UWord)NULL) { - PRE_MEM_READ("sysctl(oldlenp)", (Addr)ARG4, sizeof(vki_size_t)); - PRE_MEM_WRITE("sysctl(oldval)", (Addr)ARG3, *(vki_size_t *)ARG4); + if (ARG4 != (UWord)NULL) { + if (ARG3 != (UWord)NULL) { + PRE_MEM_READ("sysctl(oldlenp)", (Addr)ARG4, sizeof(vki_size_t)); + PRE_MEM_WRITE("sysctl(oldval)", (Addr)ARG3, *(vki_size_t *)ARG4); + } + PRE_MEM_WRITE("sysctl(oldlenp)", (Addr)ARG4, sizeof(vki_size_t)); } } POST(sys___sysctl) { - if (ARG3 != (UWord)NULL) { + if (ARG4 != (UWord)NULL) { POST_MEM_WRITE((Addr)ARG4, sizeof(vki_size_t)); - POST_MEM_WRITE((Addr)ARG3, *(vki_size_t *)ARG4); + if (ARG3 != (UWord)NULL) + POST_MEM_WRITE((Addr)ARG3, *(vki_size_t *)ARG4); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810251929.m9PJTtOT010203>