From 7f283980f00f0543e97f46567fbe5bdd4d732724 Mon Sep 17 00:00:00 2001 From: rustyx Date: Sat, 30 Jan 2016 14:51:16 +0100 Subject: [PATCH] getpid() fix for Win32 --- include/msvc_compat/windows_extra.h | 2 ++ src/prof.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/msvc_compat/windows_extra.h b/include/msvc_compat/windows_extra.h index 0c5e323f..114f43b1 100644 --- a/include/msvc_compat/windows_extra.h +++ b/include/msvc_compat/windows_extra.h @@ -23,4 +23,6 @@ # define ERANGE ERROR_INVALID_DATA #endif +#define getpid() GetCurrentProcessId() + #endif /* MSVC_COMPAT_WINDOWS_EXTRA_H */ diff --git a/src/prof.c b/src/prof.c index 31f5e601..3abb38e2 100644 --- a/src/prof.c +++ b/src/prof.c @@ -1384,6 +1384,8 @@ prof_dump_maps(bool propagate_err) cassert(config_prof); #ifdef __FreeBSD__ mfd = prof_open_maps("/proc/curproc/map"); +#elif defined(_WIN32) + mfd = -1; // Not implemented #else { int pid = getpid();