summaryrefslogtreecommitdiff
path: root/contrib/jemalloc/src/prof.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/jemalloc/src/prof.c')
-rw-r--r--contrib/jemalloc/src/prof.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/jemalloc/src/prof.c b/contrib/jemalloc/src/prof.c
index 1d8ccbd60ae0..7722b7b43739 100644
--- a/contrib/jemalloc/src/prof.c
+++ b/contrib/jemalloc/src/prof.c
@@ -935,9 +935,12 @@ prof_dump_maps(bool propagate_err)
char filename[PATH_MAX + 1];
cassert(config_prof);
-
+#ifdef __FreeBSD__
+ malloc_snprintf(filename, sizeof(filename), "/proc/curproc/map");
+#else
malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps",
(int)getpid());
+#endif
mfd = open(filename, O_RDONLY);
if (mfd != -1) {
ssize_t nread;