Source
35
35
#include <linux/async.h>
36
36
#include <linux/delay.h>
37
37
#include <linux/vmalloc.h>
38
38
39
39
static int i_zero;
40
40
static int i_one_hundred = 100;
41
41
42
42
struct test_sysctl_data {
43
43
int int_0001;
44
44
int int_0002;
45
+
int int_0003[4];
45
46
46
47
unsigned int uint_0001;
47
48
48
49
char string_0001[65];
49
50
};
50
51
51
52
static struct test_sysctl_data test_data = {
52
53
.int_0001 = 60,
53
54
.int_0002 = 1,
54
55
56
+
.int_0003[0] = 0,
57
+
.int_0003[1] = 1,
58
+
.int_0003[2] = 2,
59
+
.int_0003[3] = 3,
60
+
55
61
.uint_0001 = 314,
56
62
57
63
.string_0001 = "(none)",
58
64
};
59
65
60
66
/* These are all under /proc/sys/debug/test_sysctl/ */
61
67
static struct ctl_table test_table[] = {
62
68
{
63
69
.procname = "int_0001",
64
70
.data = &test_data.int_0001,
68
74
.extra1 = &i_zero,
69
75
.extra2 = &i_one_hundred,
70
76
},
71
77
{
72
78
.procname = "int_0002",
73
79
.data = &test_data.int_0002,
74
80
.maxlen = sizeof(int),
75
81
.mode = 0644,
76
82
.proc_handler = proc_dointvec,
77
83
},
84
+
{
85
+
.procname = "int_0003",
86
+
.data = &test_data.int_0003,
87
+
.maxlen = sizeof(test_data.int_0003),
88
+
.mode = 0644,
89
+
.proc_handler = proc_dointvec,
90
+
},
78
91
{
79
92
.procname = "uint_0001",
80
93
.data = &test_data.uint_0001,
81
94
.maxlen = sizeof(unsigned int),
82
95
.mode = 0644,
83
96
.proc_handler = proc_douintvec,
84
97
},
85
98
{
86
99
.procname = "string_0001",
87
100
.data = &test_data.string_0001,