public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug reading /proc/sys/kernel/*: only first byte read.
@ 2006-10-20 12:43 Michael Tokarev
  2007-01-30 10:24 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Tokarev @ 2006-10-20 12:43 UTC (permalink / raw)
  To: Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-30 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20 12:43 bug reading /proc/sys/kernel/*: only first byte read Michael Tokarev
2007-01-30 10:24 ` Andrew Morton
2007-01-30 13:25   ` Oleg Nesterov
2007-01-30 14:00     ` Oleg Nesterov
2007-01-30 15:07       ` Eric W. Biederman
2007-01-30 15:57         ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox