Skip to content

Instantly share code, notes, and snippets.

@christopherdeutsch
Created April 29, 2015 22:31
Show Gist options
  • Select an option

  • Save christopherdeutsch/677d0db3b760c6dc1185 to your computer and use it in GitHub Desktop.

Select an option

Save christopherdeutsch/677d0db3b760c6dc1185 to your computer and use it in GitHub Desktop.
test core dump limits
#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