Re: Reading empty file (was: Re: /dev/full)

James H. Cloos Jr. (cloos@jhcloos.com)
24 Dec 1998 00:16:03 -0600


>>>>> "Brandon" == Brandon S Allbery KF8NH <allbery@kf8nh.apk.net> writes:

Brandon> Reading from /dev/full gives bytes=0, error=ENOSPC, ... a
Brandon> program which gets the same results from /dev/full as
Brandon> /dev/zero has a bug.

Nope. Fuzzy Fox <fox@dallas.net> had it right; reading from /dev/full
is the same as reading from /dev/zero:

linux/drivers/char/mem.c> #define read_full read_zero

linux/drivers/char/mem.c> static struct file_operations zero_fops = {
linux/drivers/char/mem.c> zero_lseek,
linux/drivers/char/mem.c> read_zero,
linux/drivers/char/mem.c> write_zero,

linux/drivers/char/mem.c> static struct file_operations full_fops = {
linux/drivers/char/mem.c> full_lseek,
linux/drivers/char/mem.c> read_full,
linux/drivers/char/mem.c> write_full,

-JimC

-- 
James H. Cloos, Jr.       <http://www.jhcloos.com/cloos/pgp_public_key.txt>
<cloos@jhcloos.com>      E9E9 F828 61A4 6EA9 0F2B  63E7 997A 9F17 ED7D AEA6

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/