PERFORCE change 151913 for review
Peter Wemm
peter at FreeBSD.org
Sat Oct 25 19:29:56 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=151913
Change 151913 by peter at 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);
}
}
More information about the p4-projects
mailing list