lkml.org 
[lkml]   [2010]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
FromKay Sievers <>
DateFri, 6 Aug 2010 00:39:54 +0200
SubjectRe: [PATCH] [RFC] notify userspace about time changes
On Fri, Aug 6, 2010 at 00:34, H. Peter Anvin <hpa@zytor.com> wrote:
> On 08/05/2010 03:22 PM, Kay Sievers wrote:
>>
>> I think that's really awkward interface, to pass file descriptor
>> numbers around and write them to magic sysfs files.
>>
>> I would very much prefer a file that contains the current time, and
>> wakes up possible users with a POLL_ERR on changes caused by some
>> other process. That works very well for things like /proc/mounts, is
>> easy to get, and does not need a full page of weird instructions to
>> get stuff done. :)
>>
>
> Okay, what's wrong with having a file descriptor that gets *written to*
> on a notification?

Because it needs documentation, and is just not needed for such a
simple thing, I think. Why would you want to write a fd number to a
magic file, which can be your fd right away, even passing you the data
on read().

> Why POLL_ERR?

Because normal files can not be poll()ed, and it's not that new data
has arrived, it just tells you to rewind and read it again. It's
commonly used:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5addc5dd8836aa061f6efc4a0d9ba6323726297a

Kay


\
 
 \ /
  Last update: 2010-08-06 00:43    [from the cache]
©2003-2010