[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1d3aanzci.fsf@fess.ebiederm.org>
Date: Mon, 23 Jan 2012 08:43:57 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Earl Chew <echew@...acom.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Paris <eparis@...hat.com>,
"Serge E. Hallyn" <serge.hallyn@...onical.com>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
<adobriyan@...il.com>
Subject: Re: [PATCH] Support single byte reads from integers published in procfs by kernel/sysctl.c
ebiederm@...ssion.com (Eric W. Biederman) writes:
>>
>> [ I also note that the patch allows multiple short reads (not necessarily
>> just a single byte at a time) from these entries in procfs. ]
>>
>> I think there is a reasonable userspace expectation that entities
>> that present themselves as text files to produce results that are
>> consistent with the userspace model of a text file.
>>
>> For a more concrete example, consider the following BusyBox ash(1) code:
>>
>> read X < /proc/sys/kernel/threads-max
>> Y=$(cat /proc/sys/kernel/threads-max)
>>
>> read A < /proc/sys/kernel/core_pattern
>> B=$(cat /proc/sys/kernel/core_pattern)
>
>
>> The fact that these yield different results is surprising given that
>> the user sees these as text files.
To be precise /proc/sys/kernel/threads-max does not present itself as
an ordinary text file. It reports that it's file length is 0 bytes
long. That is different from an ordinary text file.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists