diff lib/lib.c @ 1030:9686469a857a draft

Rewrite pmap to be simpler and match other implementation's output more closely.
author Rob Landley <rob@landley.net>
date Tue, 27 Aug 2013 23:48:54 -0500
parents 910f35ff76be
children cbc467592b2e
line wrap: on
line diff
--- a/lib/lib.c	Tue Aug 27 03:31:27 2013 -0500
+++ b/lib/lib.c	Tue Aug 27 23:48:54 2013 -0500
@@ -325,6 +325,8 @@
   fd = open(name, O_RDONLY);
   if (fd == -1) return 0;
   len = fdlength(fd);
+  // proc files don't report a length, so try 1 page minimum.
+  if (len<4096) len = 4095;
   buf = xmalloc(len+1);
   buf[readall(fd, buf, len)] = 0;