Messages in this thread |  | | Date | Mon, 24 Sep 2001 18:35:55 -0700 (PDT) | Subject | Re: read() called twice for /proc files | From | "David S. Miller" <> |
| |
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/
|  |