116002 VG_(printf): Problems with justification of strings and integers
155125 avoid cutting away file:lineno after long function name
197259 Unsupported arch_prtctl PR_SET_GS option
+201435 Fix Darwin: -v does not show kernel version
211926 Avoid compilation warnings in valgrind.h with -pedantic
226609 Crediting upstream authors in man page
269360 s390x: Fix addressing mode selection for compare-and-swap
}
}
+Int VG_(sysctl)(Int *name, UInt namelen, void *oldp, SizeT *oldlenp, void *newp, SizeT newlen)
+{
+ SysRes res;
+# if defined(VGO_darwin)
+ res = VG_(do_syscall6)(__NR___sysctl,
+ name, namelen, oldp, oldlenp, newp, newlen);
+# else
+ res = VG_(mk_SysRes_Error)(VKI_ENOSYS);
+# endif
+ return sr_isError(res) ? -1 : sr_Res(res);
+}
+
/* ---------------------------------------------------------------------
Resource limits
------------------------------------------------------------------ */
VG_(umsg)("\n");
if (VG_(clo_verbosity) > 1) {
+# if !defined(VGO_darwin)
SysRes fd;
+# endif
VexArch vex_arch;
VexArchInfo vex_archinfo;
if (!logging_to_fd)
* (HChar**) VG_(indexXA)( VG_(args_for_valgrind), i ));
}
+# if !defined(VGO_darwin)
VG_(message)(Vg_DebugMsg, "Contents of /proc/version:\n");
fd = VG_(open) ( "/proc/version", VKI_O_RDONLY, 0 );
if (sr_isError(fd)) {
VG_(message)(Vg_DebugMsg, "\n");
VG_(close)(fdno);
}
+# else
+ VG_(message)(Vg_DebugMsg, "Output from sysctl({CTL_KERN,KERN_VERSION}):\n");
+ /* Note: preferable to use sysctlbyname("kern.version", kernelVersion, &len, NULL, 0)
+ however that syscall is OS X 10.10+ only. */
+ Int mib[] = {CTL_KERN, KERN_VERSION};
+ SizeT len;
+ VG_(sysctl)(mib, sizeof(mib)/sizeof(Int), NULL, &len, NULL, 0);
+ HChar *kernelVersion = VG_(malloc)("main.pp.1", len);
+ VG_(sysctl)(mib, sizeof(mib)/sizeof(Int), kernelVersion, &len, NULL, 0);
+ VG_(message)(Vg_DebugMsg, " %s\n", kernelVersion);
+ VG_(free)( kernelVersion );
+# endif
VG_(machine_get_VexArchInfo)( &vex_arch, &vex_archinfo );
VG_(message)(
extern Int VG_(system) ( const HChar* cmd );
extern Int VG_(fork) ( void);
extern void VG_(execv) ( const HChar* filename, HChar** argv );
+extern Int VG_(sysctl) ( Int *name, UInt namelen, void *oldp, SizeT *oldlenp, void *newp, SizeT newlen );
/* ---------------------------------------------------------------------
Resource limits and capabilities