+ meta_printf("exitsig:%d\n", SIGINT);
+ err("SG: Interrupted");
+}
+
+#define PROC_BUF_SIZE 4096
+static void
+read_proc_file(char *buf, char *name, int *fdp)
+{
+ int c;
+
+ if (!*fdp)
+ {
+ sprintf(buf, "/proc/%d/%s", (int) box_pid, name);
+ *fdp = open(buf, O_RDONLY);
+ if (*fdp < 0)
+ die("open(%s): %m", buf);
+ }
+ lseek(*fdp, 0, SEEK_SET);
+ if ((c = read(*fdp, buf, PROC_BUF_SIZE-1)) < 0)
+ die("read on /proc/$pid/%s: %m", name);
+ if (c >= PROC_BUF_SIZE-1)
+ die("/proc/$pid/%s too long", name);
+ buf[c] = 0;