MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prof_open_maps

Function prof_open_maps

deps/jemalloc/src/prof.c:1674–1694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1672#ifndef _WIN32
1673JEMALLOC_FORMAT_PRINTF(1, 2)
1674static int
1675prof_open_maps(const char *format, ...) {
1676 int mfd;
1677 va_list ap;
1678 char filename[PATH_MAX + 1];
1679
1680 va_start(ap, format);
1681 malloc_vsnprintf(filename, sizeof(filename), format, ap);
1682 va_end(ap);
1683
1684#if defined(O_CLOEXEC)
1685 mfd = open(filename, O_RDONLY | O_CLOEXEC);
1686#else
1687 mfd = open(filename, O_RDONLY);
1688 if (mfd != -1) {
1689 fcntl(mfd, F_SETFD, fcntl(mfd, F_GETFD) | FD_CLOEXEC);
1690 }
1691#endif
1692
1693 return mfd;
1694}
1695#endif
1696
1697static int

Callers 1

prof_dump_mapsFunction · 0.70

Calls 1

malloc_vsnprintfFunction · 0.70

Tested by

no test coverage detected