Re: read() called twice for /proc files

From: David S. Miller (davem@redhat.com)
Date: Mon Sep 24 2001 - 20:35:55 EST


   From: Tim Hockin <thockin@sun.com>
   Date: Mon, 24 Sep 2001 18:29:49 -0700
   
   This results in the actual read taking twice as long. Perhaps I am missing
   something...

EOF isn't known until you return the zero. You can watch the loff_t
arg to the read operation to see if it is at the end, and if so just
avoid retouching the device or whatever and go straight to returning
0.

Franks a lot,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 30 2001 - 21:00:28 EST