Re: [PATCH] sysctl: add support for poll()

From: Kay Sievers
Date: Thu Jun 02 2011 - 08:07:02 EST

On Thu, Jun 2, 2011 at 05:31, Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
> Lucas De Marchi <lucas.demarchi@xxxxxxxxxxxxxx> writes:
>> CC'ing people as suggested by
>> On Wed, Jun 1, 2011 at 9:14 AM, Lucas De Marchi
>> <lucas.demarchi@xxxxxxxxxxxxxx> wrote:
>>> Adding support for poll() in sysctl fs allows userspace to receive
>>> notifications when an entry in sysctl changes. This way it's possible to
>>> know when hostname/domainname is changed due to the respective syscall
>>> has been called or its file under /proc/sys has been written to.
> Why do you want to do this? ÂWhat advantage does this bring to
> userspace?

Host names are dynamic, can change during system runtime by dhcp or
similar setups, or just get changed by the user.

System management tools/services needs to track these changes to
propagate the actual host name into the running services. It's the
same like we dynamically track /proc/mounts, /proc/swaps, or any other
stuff that can change underneath us, and forces other things to adapt
to the changing environment.

> That feels like a pretty big special case.

The alternative is to have a process constantly polling and reading
the file, which is nothing we even want to think about in 2011.

It's just another special case to bring us out of the UNIX stone age
of doing things. :)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at