MCPcopy Create free account
hub / github.com/F-Stack/f-stack / prof_open_maps

Function prof_open_maps

app/redis-6.2.6/deps/jemalloc/src/prof.c:1403–1423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1401#ifndef _WIN32
1402JEMALLOC_FORMAT_PRINTF(1, 2)
1403static int
1404prof_open_maps(const char *format, ...) {
1405 int mfd;
1406 va_list ap;
1407 char filename[PATH_MAX + 1];
1408
1409 va_start(ap, format);
1410 malloc_vsnprintf(filename, sizeof(filename), format, ap);
1411 va_end(ap);
1412
1413#if defined(O_CLOEXEC)
1414 mfd = open(filename, O_RDONLY | O_CLOEXEC);
1415#else
1416 mfd = open(filename, O_RDONLY);
1417 if (mfd != -1) {
1418 fcntl(mfd, F_SETFD, fcntl(mfd, F_GETFD) | FD_CLOEXEC);
1419 }
1420#endif
1421
1422 return mfd;
1423}
1424#endif
1425
1426static int

Callers 1

prof_dump_mapsFunction · 0.85

Calls 2

malloc_vsnprintfFunction · 0.85
fcntlFunction · 0.50

Tested by

no test coverage detected