diff options
Diffstat (limited to 'include/linux/sysctl.h')
-rw-r--r-- | include/linux/sysctl.h | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 9f047d73a216..56af3ca75e24 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 | |||
59 | enum | 50 | enum |
60 | { | 51 | { |
61 | CTL_KERN=1, /* General kernel info and control */ | 52 | CTL_KERN=1, /* General kernel info and control */ |
@@ -973,10 +964,6 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
973 | 964 | ||
974 | typedef struct ctl_table ctl_table; | 965 | typedef struct ctl_table ctl_table; |
975 | 966 | ||
976 | typedef int ctl_handler (struct ctl_table *table, | ||
977 | void __user *oldval, size_t __user *oldlenp, | ||
978 | void __user *newval, size_t newlen); | ||
979 | |||
980 | typedef int proc_handler (struct ctl_table *ctl, int write, | 967 | typedef int proc_handler (struct ctl_table *ctl, int write, |
981 | void __user *buffer, size_t *lenp, loff_t *ppos); | 968 | void __user *buffer, size_t *lenp, loff_t *ppos); |
982 | 969 | ||
@@ -997,21 +984,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int, | |||
997 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 984 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
998 | void __user *, size_t *, loff_t *); | 985 | void __user *, size_t *, loff_t *); |
999 | 986 | ||
1000 | extern int do_sysctl (int __user *name, int nlen, | ||
1001 | void __user *oldval, size_t __user *oldlenp, | ||
1002 | void __user *newval, size_t newlen); | ||
1003 | |||
1004 | extern ctl_handler sysctl_data; | ||
1005 | extern ctl_handler sysctl_string; | ||
1006 | extern ctl_handler sysctl_intvec; | ||
1007 | extern ctl_handler sysctl_jiffies; | ||
1008 | extern ctl_handler sysctl_ms_jiffies; | ||
1009 | |||
1010 | |||
1011 | /* | 987 | /* |
1012 | * Register a set of sysctl names by calling register_sysctl_table | 988 | * Register a set of sysctl names by calling register_sysctl_table |
1013 | * 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 |
1014 | * ctl_name and NULL procname terminates the table. table->de will be | 990 | * NULL procname terminates the table. table->de will be |
1015 | * 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. |
1016 | * | 992 | * |
1017 | * sysctl names can be mirrored automatically under /proc/sys. The | 993 | * sysctl names can be mirrored automatically under /proc/sys. The |
@@ -1024,24 +1000,11 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1024 | * under /proc; non-leaf nodes will be represented by directories. A | 1000 | * under /proc; non-leaf nodes will be represented by directories. A |
1025 | * null procname disables /proc mirroring at this node. | 1001 | * null procname disables /proc mirroring at this node. |
1026 | * | 1002 | * |
1027 | * sysctl entries with a zero ctl_name will not be available through | ||
1028 | * the binary sysctl interface. | ||
1029 | * | ||
1030 | * sysctl(2) can automatically manage read and write requests through | 1003 | * sysctl(2) can automatically manage read and write requests through |
1031 | * 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 |
1032 | * struct enable minimal validation of the values being written to be | 1005 | * struct enable minimal validation of the values being written to be |
1033 | * performed, and the mode field allows minimal authentication. | 1006 | * performed, and the mode field allows minimal authentication. |
1034 | * | 1007 | * |
1035 | * More sophisticated management can be enabled by the provision of a | ||
1036 | * strategy routine with the table entry. This will be called before | ||
1037 | * any automatic read or write of the data is performed. | ||
1038 | * | ||
1039 | * The strategy routine may return: | ||
1040 | * <0: Error occurred (error is passed to user process) | ||
1041 | * 0: OK - proceed with automatic read or write. | ||
1042 | * >0: OK - read or write has been done by the strategy routine, so | ||
1043 | * return immediately. | ||
1044 | * | ||
1045 | * There must be a proc_handler routine for any terminal nodes | 1008 | * There must be a proc_handler routine for any terminal nodes |
1046 | * 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 |
1047 | * directory handler). Several default handlers are available to | 1010 | * directory handler). Several default handlers are available to |
@@ -1051,7 +1014,6 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1051 | /* A sysctl table is an array of struct ctl_table: */ | 1014 | /* A sysctl table is an array of struct ctl_table: */ |
1052 | struct ctl_table | 1015 | struct ctl_table |
1053 | { | 1016 | { |
1054 | int ctl_name; /* Binary ID */ | ||
1055 | const char *procname; /* Text ID for /proc/sys, or zero */ | 1017 | const char *procname; /* Text ID for /proc/sys, or zero */ |
1056 | void *data; | 1018 | void *data; |
1057 | int maxlen; | 1019 | int maxlen; |
@@ -1059,7 +1021,6 @@ struct ctl_table | |||
1059 | struct ctl_table *child; | 1021 | struct ctl_table *child; |
1060 | struct ctl_table *parent; /* Automatically set */ | 1022 | struct ctl_table *parent; /* Automatically set */ |
1061 | proc_handler *proc_handler; /* Callback for text formatting */ | 1023 | proc_handler *proc_handler; /* Callback for text formatting */ |
1062 | ctl_handler *strategy; /* Callback function for all r/w */ | ||
1063 | void *extra1; | 1024 | void *extra1; |
1064 | void *extra2; | 1025 | void *extra2; |
1065 | }; | 1026 | }; |
@@ -1093,7 +1054,6 @@ struct ctl_table_header | |||
1093 | /* 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 */ |
1094 | struct ctl_path { | 1055 | struct ctl_path { |
1095 | const char *procname; | 1056 | const char *procname; |
1096 | int ctl_name; | ||
1097 | }; | 1057 | }; |
1098 | 1058 | ||
1099 | void register_sysctl_root(struct ctl_table_root *root); | 1059 | void register_sysctl_root(struct ctl_table_root *root); |