lkml.org 
[lkml]   [2006]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbug reading /proc/sys/kernel/*: only first byte read.
I were debugging a weird problem with busybox, and come across
this chunk of strace output:

open("/proc/sys/kernel/osrelease", O_RDONLY) = 3
read(3, "2", 1) = 1
read(3, "", 1) = 0
close(3) = 0

As you can see, after reading one byte from /proc/sys/kernel/osrelease,
next read() returns 0, which is treated as end-of-file by an application.

Why busybox does this single-byte reads is another question (many
shells does that, in order to be able to stop reading at newline).

But this is definitely a bug in kernel, and should be fixed....

It exists in 2.6.17 and 2.6.18

Thanks.

/mjt
-
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/

\
 
 \ /
  Last update: 2006-10-20 14:47    [W:0.083 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site