Created
April 29, 2015 22:31
-
-
Save christopherdeutsch/677d0db3b760c6dc1185 to your computer and use it in GitHub Desktop.
test core dump limits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <sys/time.h> | |
| #include <sys/resource.h> | |
| int main(int argc, char **argv) { | |
| struct rlimit mylimits; | |
| getrlimit(RLIMIT_CORE, &mylimits); | |
| printf("running with pid %d\n", getpid()); | |
| printf("core limit is %d current / %d hard\n", (int) mylimits.rlim_cur, (int) mylimits.rlim_max); | |
| printf("sleeping until killed...\n"); | |
| while(1) { | |
| sleep(1); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment