LOG("CORE DUMPS: Your current working directory is \"%s\".\n", cwd);
int patternfd;
if ((patternfd = open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0) {
LOG("CORE DUMPS: Your current working directory is \"%s\".\n", cwd);
int patternfd;
if ((patternfd = open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0) {
if (read(patternfd, cwd, sizeof(cwd)) > 0)
/* a trailing newline is included in cwd */
LOG("CORE DUMPS: Your core_pattern is: %s", cwd);
if (read(patternfd, cwd, sizeof(cwd)) > 0)
/* a trailing newline is included in cwd */
LOG("CORE DUMPS: Your core_pattern is: %s", cwd);