this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support for generating Mach-O core dumps.

One day, when Linux finally supports per-container core_pattern setting, core dumps will be saved into /cores/core.XXX as on macOS.

+15
+13
src/startup/darling.c
··· 769 769 setresuid(g_originalUid, g_originalUid, g_originalUid); 770 770 prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); 771 771 772 + setupCoredumpPattern(); 773 + 772 774 // Set name to darling-init 773 775 prctl(PR_SET_NAME, DARLING_INIT_COMM, 0, 0); 774 776 p = stpcpy(g_argv[0], DARLING_INIT_COMM); ··· 1218 1220 exit(1); 1219 1221 } 1220 1222 } 1223 + 1224 + void setupCoredumpPattern(void) 1225 + { 1226 + FILE* f = fopen("/proc/sys/kernel/core_pattern", "w"); 1227 + if (f != NULL) 1228 + { 1229 + // This is how macOS saves core dumps 1230 + fputs("/cores/core.%p\n", f); 1231 + fclose(f); 1232 + } 1233 + }
+2
src/startup/darling.h
··· 66 66 void loadKernelModule(void); 67 67 void joinNamespace(pid_t pid, int type, const char* typeName); 68 68 69 + void setupCoredumpPattern(void); 70 + 69 71 #endif