1 #include <libcrash-service.h>
3 #include <linux/limits.h>
8 void help(char *argv_0)
10 printf("Usage: %s [-r dump_reason] pid\n", argv_0);
13 int main(int argc, char *argv[])
16 const char *dump_reason = NULL;
18 while ((opt = getopt(argc, argv, "r:")) != -1) {
29 if (dump_reason == NULL)
30 dump_reason = "no reason";
36 pid_t pid = strtol(argv[optind], NULL, 10);
38 printf("ERROR: pid must be a number\n");
44 bool res = livedump_pid(pid, dump_reason, BUFF, PATH_MAX);
45 printf("res: %s\nreport_path: %s\n", res ? "true" : "false", BUFF);
46 return res ? EXIT_SUCCESS : EXIT_FAILURE;