aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2011-11-02 16:39:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-02 19:07:02 -0400
commitf1ecf06854a66ee663f4d4cf029c78cd62a15e04 (patch)
treecbe863057fa14b9390746db6d2b1812a2f874b48 /kernel/sys.c
parent088024b1deee206cd37eff980138e918837aabdb (diff)
sysctl: add support for poll()
Adding support for poll() in sysctl fs allows userspace to receive notifications of changes in sysctl entries. This adds a infrastructure to allow files in sysctl fs to be pollable and implements it for hostname and domainname. [akpm@linux-foundation.org: s/declare/define/ for definitions] Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Greg KH <gregkh@suse.de> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 58459509b14c..d06c091e0345 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1286,6 +1286,7 @@ SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
1286 memset(u->nodename + len, 0, sizeof(u->nodename) - len); 1286 memset(u->nodename + len, 0, sizeof(u->nodename) - len);
1287 errno = 0; 1287 errno = 0;
1288 } 1288 }
1289 uts_proc_notify(UTS_PROC_HOSTNAME);
1289 up_write(&uts_sem); 1290 up_write(&uts_sem);
1290 return errno; 1291 return errno;
1291} 1292}
@@ -1336,6 +1337,7 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
1336 memset(u->domainname + len, 0, sizeof(u->domainname) - len); 1337 memset(u->domainname + len, 0, sizeof(u->domainname) - len);
1337 errno = 0; 1338 errno = 0;
1338 } 1339 }
1340 uts_proc_notify(UTS_PROC_DOMAINNAME);
1339 up_write(&uts_sem); 1341 up_write(&uts_sem);
1340 return errno; 1342 return errno;
1341} 1343}