MCPcopy Create free account
hub / github.com/beefytech/Beef / prof_open_maps_internal

Function prof_open_maps_internal

BeefRT/JEMalloc/src/prof_sys.c:426–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424#ifndef _WIN32
425JEMALLOC_FORMAT_PRINTF(1, 2)
426static int
427prof_open_maps_internal(const char *format, ...) {
428 int mfd;
429 va_list ap;
430 char filename[PATH_MAX + 1];
431
432 va_start(ap, format);
433 malloc_vsnprintf(filename, sizeof(filename), format, ap);
434 va_end(ap);
435
436#if defined(O_CLOEXEC)
437 mfd = open(filename, O_RDONLY | O_CLOEXEC);
438#else
439 mfd = open(filename, O_RDONLY);
440 if (mfd != -1) {
441 fcntl(mfd, F_SETFD, fcntl(mfd, F_GETFD) | FD_CLOEXEC);
442 }
443#endif
444
445 return mfd;
446}
447#endif
448
449static int

Callers 1

prof_dump_open_maps_implFunction · 0.85

Calls 2

malloc_vsnprintfFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected