#include <unistd.h>
#include <fcntl.h>
#include <getopt.h>
+#include <limits.h>
#define NELEMS(arr) (sizeof(arr)/sizeof(arr[0]))
#define PROC_READ_MAX 16384 /* 4 pages should be enough for any process */
char proc_readbuf[PROC_READ_MAX];
+ char exe_link[PATH_MAX];
+ char exe_file[PATH_MAX];
- printf("Crash report for: %s\n\n", exestr);
+ snprintf(exe_link, PATH_MAX, "/proc/%s/exe", pidstr);
+ if (readlink(exe_link, exe_file, PATH_MAX) > 0) {
+ printf("Executable File Path: %s\n", exe_file);
+ }
printf(" - passed from kernel -\n"
"%16s: %s\n"