lkml.org 
[lkml]   [1997]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbug in /dev/full ??

A friend of mine noticed these [probably incorrect] permissions on /dev/full
cr--r--r-- 1 root sys 1, 7 Jul 17 1994 /dev/full
(Redhat 4.x) and wondered what reading from /dev/full meant...
He tried it, and got random junk...

Looking at 2.0.28/drivers/char/mem.c, I find this:

static int read_full(struct inode * node, struct file * file, char * buf,int count)
{
file->f_pos += count;
return count;
}


It appears that read_full advances the file position as if data had been
read, but doesn't put any data in the buffer... So whatever data was
last read on this file descriptor shows up over and over.

Is this what /dev/full should do on read?
What would a more correct behavior be?

I searched the kernel archives, and found that someone else posted
about this bug around January 7, but there were no replies, and
the bug was not fixed. There are no patches to mem.c in 2.0.29.

Steve
ssd@nevets.oau.org


\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.029 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site