aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysctl.h')
-rw-r--r--include/linux/sysctl.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 11684d9e6bd2..703cfa33a3ca 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -435,7 +435,7 @@ enum {
435 NET_IPV4_ROUTE_MAX_SIZE=5, 435 NET_IPV4_ROUTE_MAX_SIZE=5,
436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, 436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
437 NET_IPV4_ROUTE_GC_TIMEOUT=7, 437 NET_IPV4_ROUTE_GC_TIMEOUT=7,
438 NET_IPV4_ROUTE_GC_INTERVAL=8, 438 NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
439 NET_IPV4_ROUTE_REDIRECT_LOAD=9, 439 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10, 440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11, 441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
@@ -931,6 +931,7 @@ enum
931#ifdef __KERNEL__ 931#ifdef __KERNEL__
932#include <linux/list.h> 932#include <linux/list.h>
933#include <linux/rcupdate.h> 933#include <linux/rcupdate.h>
934#include <linux/wait.h>
934 935
935/* For the /proc/sys support */ 936/* For the /proc/sys support */
936struct ctl_table; 937struct ctl_table;
@@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int,
1011 * cover common cases. 1012 * cover common cases.
1012 */ 1013 */
1013 1014
1015/* Support for userspace poll() to watch for changes */
1016struct ctl_table_poll {
1017 atomic_t event;
1018 wait_queue_head_t wait;
1019};
1020
1021static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
1022{
1023 return (void *)(unsigned long)atomic_read(&poll->event);
1024}
1025
1026void proc_sys_poll_notify(struct ctl_table_poll *poll);
1027
1028#define __CTL_TABLE_POLL_INITIALIZER(name) { \
1029 .event = ATOMIC_INIT(0), \
1030 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) }
1031
1032#define DEFINE_CTL_TABLE_POLL(name) \
1033 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
1034
1014/* A sysctl table is an array of struct ctl_table: */ 1035/* A sysctl table is an array of struct ctl_table: */
1015struct ctl_table 1036struct ctl_table
1016{ 1037{
@@ -1021,6 +1042,7 @@ struct ctl_table
1021 struct ctl_table *child; 1042 struct ctl_table *child;
1022 struct ctl_table *parent; /* Automatically set */ 1043 struct ctl_table *parent; /* Automatically set */
1023 proc_handler *proc_handler; /* Callback for text formatting */ 1044 proc_handler *proc_handler; /* Callback for text formatting */
1045 struct ctl_table_poll *poll;
1024 void *extra1; 1046 void *extra1;
1025 void *extra2; 1047 void *extra2;
1026}; 1048};