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.h55
1 files changed, 8 insertions, 47 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1e4743ee6831..877ba039e6a4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -15,9 +15,6 @@
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
18 ** For new interfaces unless you really need a binary number
19 ** please use CTL_UNNUMBERED.
20 **
21 **************************************************************** 18 ****************************************************************
22 **************************************************************** 19 ****************************************************************
23 */ 20 */
@@ -50,12 +47,6 @@ struct __sysctl_args {
50 47
51/* Top-level names: */ 48/* Top-level names: */
52 49
53/* For internal pattern-matching use only: */
54#ifdef __KERNEL__
55#define CTL_NONE 0
56#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
57#endif
58
59enum 50enum
60{ 51{
61 CTL_KERN=1, /* General kernel info and control */ 52 CTL_KERN=1, /* General kernel info and control */
@@ -98,8 +89,8 @@ enum
98 KERN_VERSION=4, /* string: compile time info */ 89 KERN_VERSION=4, /* string: compile time info */
99 KERN_SECUREMASK=5, /* struct: maximum rights mask */ 90 KERN_SECUREMASK=5, /* struct: maximum rights mask */
100 KERN_PROF=6, /* table: profiling information */ 91 KERN_PROF=6, /* table: profiling information */
101 KERN_NODENAME=7, 92 KERN_NODENAME=7, /* string: hostname */
102 KERN_DOMAINNAME=8, 93 KERN_DOMAINNAME=8, /* string: domainname */
103 94
104 KERN_PANIC=15, /* int: panic timeout */ 95 KERN_PANIC=15, /* int: panic timeout */
105 KERN_REALROOTDEV=16, /* real root device to mount after initrd */ 96 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
@@ -111,8 +102,8 @@ enum
111 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ 102 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
112 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ 103 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
113 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ 104 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
114 KERN_MODPROBE=28, 105 KERN_MODPROBE=28, /* string: modprobe path */
115 KERN_SG_BIG_BUFF=29, 106 KERN_SG_BIG_BUFF=29, /* int: sg driver reserved buffer size */
116 KERN_ACCT=30, /* BSD process accounting parameters */ 107 KERN_ACCT=30, /* BSD process accounting parameters */
117 KERN_PPC_L2CR=31, /* l2cr register on PPC */ 108 KERN_PPC_L2CR=31, /* l2cr register on PPC */
118 109
@@ -159,7 +150,7 @@ enum
159 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ 150 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
160 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ 151 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
161 KERN_COMPAT_LOG=73, /* int: print compat layer messages */ 152 KERN_COMPAT_LOG=73, /* int: print compat layer messages */
162 KERN_MAX_LOCK_DEPTH=74, 153 KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
163 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ 154 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
164 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ 155 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
165}; 156};
@@ -490,6 +481,7 @@ enum
490 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
491 NET_IPV4_CONF_ARP_ACCEPT=21, 482 NET_IPV4_CONF_ARP_ACCEPT=21,
492 NET_IPV4_CONF_ARP_NOTIFY=22, 483 NET_IPV4_CONF_ARP_NOTIFY=22,
484 NET_IPV4_CONF_ACCEPT_LOCAL=23,
493 __NET_IPV4_CONF_MAX 485 __NET_IPV4_CONF_MAX
494}; 486};
495 487
@@ -972,10 +964,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
972 964
973typedef struct ctl_table ctl_table; 965typedef struct ctl_table ctl_table;
974 966
975typedef int ctl_handler (struct ctl_table *table,
976 void __user *oldval, size_t __user *oldlenp,
977 void __user *newval, size_t newlen);
978
979typedef int proc_handler (struct ctl_table *ctl, int write, 967typedef int proc_handler (struct ctl_table *ctl, int write,
980 void __user *buffer, size_t *lenp, loff_t *ppos); 968 void __user *buffer, size_t *lenp, loff_t *ppos);
981 969
@@ -996,21 +984,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
996extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 984extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
997 void __user *, size_t *, loff_t *); 985 void __user *, size_t *, loff_t *);
998 986
999extern int do_sysctl (int __user *name, int nlen,
1000 void __user *oldval, size_t __user *oldlenp,
1001 void __user *newval, size_t newlen);
1002
1003extern ctl_handler sysctl_data;
1004extern ctl_handler sysctl_string;
1005extern ctl_handler sysctl_intvec;
1006extern ctl_handler sysctl_jiffies;
1007extern ctl_handler sysctl_ms_jiffies;
1008
1009
1010/* 987/*
1011 * Register a set of sysctl names by calling register_sysctl_table 988 * Register a set of sysctl names by calling register_sysctl_table
1012 * with an initialised array of struct ctl_table's. An entry with zero 989 * with an initialised array of struct ctl_table's. An entry with
1013 * ctl_name and NULL procname terminates the table. table->de will be 990 * NULL procname terminates the table. table->de will be
1014 * set up by the registration and need not be initialised in advance. 991 * set up by the registration and need not be initialised in advance.
1015 * 992 *
1016 * sysctl names can be mirrored automatically under /proc/sys. The 993 * sysctl names can be mirrored automatically under /proc/sys. The
@@ -1023,24 +1000,11 @@ extern ctl_handler sysctl_ms_jiffies;
1023 * under /proc; non-leaf nodes will be represented by directories. A 1000 * under /proc; non-leaf nodes will be represented by directories. A
1024 * null procname disables /proc mirroring at this node. 1001 * null procname disables /proc mirroring at this node.
1025 * 1002 *
1026 * sysctl entries with a zero ctl_name will not be available through
1027 * the binary sysctl interface.
1028 *
1029 * sysctl(2) can automatically manage read and write requests through 1003 * sysctl(2) can automatically manage read and write requests through
1030 * the sysctl table. The data and maxlen fields of the ctl_table 1004 * the sysctl table. The data and maxlen fields of the ctl_table
1031 * struct enable minimal validation of the values being written to be 1005 * struct enable minimal validation of the values being written to be
1032 * performed, and the mode field allows minimal authentication. 1006 * performed, and the mode field allows minimal authentication.
1033 * 1007 *
1034 * More sophisticated management can be enabled by the provision of a
1035 * strategy routine with the table entry. This will be called before
1036 * any automatic read or write of the data is performed.
1037 *
1038 * The strategy routine may return:
1039 * <0: Error occurred (error is passed to user process)
1040 * 0: OK - proceed with automatic read or write.
1041 * >0: OK - read or write has been done by the strategy routine, so
1042 * return immediately.
1043 *
1044 * There must be a proc_handler routine for any terminal nodes 1008 * There must be a proc_handler routine for any terminal nodes
1045 * mirrored under /proc/sys (non-terminals are handled by a built-in 1009 * mirrored under /proc/sys (non-terminals are handled by a built-in
1046 * directory handler). Several default handlers are available to 1010 * directory handler). Several default handlers are available to
@@ -1050,7 +1014,6 @@ extern ctl_handler sysctl_ms_jiffies;
1050/* A sysctl table is an array of struct ctl_table: */ 1014/* A sysctl table is an array of struct ctl_table: */
1051struct ctl_table 1015struct ctl_table
1052{ 1016{
1053 int ctl_name; /* Binary ID */
1054 const char *procname; /* Text ID for /proc/sys, or zero */ 1017 const char *procname; /* Text ID for /proc/sys, or zero */
1055 void *data; 1018 void *data;
1056 int maxlen; 1019 int maxlen;
@@ -1058,7 +1021,6 @@ struct ctl_table
1058 struct ctl_table *child; 1021 struct ctl_table *child;
1059 struct ctl_table *parent; /* Automatically set */ 1022 struct ctl_table *parent; /* Automatically set */
1060 proc_handler *proc_handler; /* Callback for text formatting */ 1023 proc_handler *proc_handler; /* Callback for text formatting */
1061 ctl_handler *strategy; /* Callback function for all r/w */
1062 void *extra1; 1024 void *extra1;
1063 void *extra2; 1025 void *extra2;
1064}; 1026};
@@ -1092,7 +1054,6 @@ struct ctl_table_header
1092/* struct ctl_path describes where in the hierarchy a table is added */ 1054/* struct ctl_path describes where in the hierarchy a table is added */
1093struct ctl_path { 1055struct ctl_path {
1094 const char *procname; 1056 const char *procname;
1095 int ctl_name;
1096}; 1057};
1097 1058
1098void register_sysctl_root(struct ctl_table_root *root); 1059void register_sysctl_root(struct ctl_table_root *root);