diff toys/other/pmap.c @ 1043:acf7bb2b99e2 draft

Introduce libbuf analogous to toybuf but for use by lib/*.c. Change readfile() semantics to be able to read into an existing buffer, or malloc its own if that's NULL.
author Rob Landley <rob@landley.net>
date Tue, 03 Sep 2013 17:56:28 -0500
parents 9686469a857a
children ac4a0cde89c2
line wrap: on
line diff
--- a/toys/other/pmap.c	Tue Sep 03 08:30:47 2013 -0500
+++ b/toys/other/pmap.c	Tue Sep 03 17:56:28 2013 -0500
@@ -35,7 +35,7 @@
     int count, xx = 0;
 
     snprintf(toybuf, sizeof(toybuf), "/proc/%u/cmdline", pid);
-    line = readfile(toybuf);
+    line = readfile(toybuf, 0, 0);
     if (!line) error_msg("No %lu", (long)pid);
     xprintf("%u: %s\n", (int)pid, line);
     free(line);