diff options
| author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-11-25 10:48:00 -0800 |
|---|---|---|
| committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-11-25 10:48:00 -0800 |
| commit | 27f6cbecbf60e2dd2be49a945e9966ed6b20b2de (patch) | |
| tree | 2416ab37445ec5ec8e669016a2d1f5573863d73c /include/linux/sysctl.h | |
| parent | 7cf095f46f0ca52773a431db8ac0bf4a07a3501b (diff) | |
| parent | eb1852b10593dc3ca73e02bf9ac4753a5a464905 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into wireless-next
Diffstat (limited to 'include/linux/sysctl.h')
| -rw-r--r-- | include/linux/sysctl.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 9a1ec10fd504..703cfa33a3ca 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -931,6 +931,7 @@ enum #ifdef __KERNEL__ #include <linux/list.h> #include <linux/rcupdate.h> +#include <linux/wait.h> /* For the /proc/sys support */ struct ctl_table; @@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int, * cover common cases. */ +/* Support for userspace poll() to watch for changes */ +struct ctl_table_poll { + atomic_t event; + wait_queue_head_t wait; +}; + +static inline void *proc_sys_poll_event(struct ctl_table_poll *poll) +{ + return (void *)(unsigned long)atomic_read(&poll->event); +} + +void proc_sys_poll_notify(struct ctl_table_poll *poll); + +#define __CTL_TABLE_POLL_INITIALIZER(name) { \ + .event = ATOMIC_INIT(0), \ + .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) } + +#define DEFINE_CTL_TABLE_POLL(name) \ + struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) + /* A sysctl table is an array of struct ctl_table: */ struct ctl_table { @@ -1021,6 +1042,7 @@ struct ctl_table struct ctl_table *child; struct ctl_table *parent; /* Automatically set */ proc_handler *proc_handler; /* Callback for text formatting */ + struct ctl_table_poll *poll; void *extra1; void *extra2; }; |
