12 #include <linux/module.h>
13 #include <linux/ipc.h>
15 #include <linux/sysctl.h>
18 #include <linux/msg.h>
23 char *which = table->
data;
25 which = (which - (
char *)&
init_ipc_ns) + (
char *)ipc_ns;
29 #ifdef CONFIG_PROC_SYSCTL
31 void __user *
buffer,
size_t *lenp, loff_t *ppos)
35 memcpy(&ipc_table, table,
sizeof(ipc_table));
36 ipc_table.data = get_ipc(table);
42 void __user *buffer,
size_t *lenp, loff_t *ppos)
46 memcpy(&ipc_table, table,
sizeof(ipc_table));
47 ipc_table.data = get_ipc(table);
53 void __user *buffer,
size_t *lenp, loff_t *ppos)
66 void __user *buffer,
size_t *lenp, loff_t *ppos)
69 size_t lenp_bef = *lenp;
72 memcpy(&ipc_table, table,
sizeof(ipc_table));
73 ipc_table.data = get_ipc(table);
77 if (write && !rc && lenp_bef == *lenp)
89 void __user *buffer,
size_t *lenp, loff_t *ppos)
92 memcpy(&ipc_table, table,
sizeof(ipc_table));
93 ipc_table.data = get_ipc(table);
108 static void ipc_auto_callback(
int val)
123 void __user *buffer,
size_t *lenp, loff_t *ppos)
126 size_t lenp_bef = *lenp;
130 memcpy(&ipc_table, table,
sizeof(ipc_table));
131 ipc_table.data = get_ipc(table);
132 oldval = *((
int *)(ipc_table.data));
136 if (write && !rc && lenp_bef == *lenp) {
137 int newval = *((
int *)(ipc_table.data));
143 if (newval != oldval)
144 ipc_auto_callback(newval);
151 #define proc_ipc_doulongvec_minmax NULL
152 #define proc_ipc_dointvec NULL
153 #define proc_ipc_dointvec_minmax NULL
154 #define proc_ipc_dointvec_minmax_orphans NULL
155 #define proc_ipc_callback_dointvec NULL
156 #define proc_ipcauto_dointvec_minmax NULL
162 static struct ctl_table ipc_kern_table[] = {
164 .procname =
"shmmax",
171 .procname =
"shmall",
178 .procname =
"shmmni",
185 .procname =
"shm_rmid_forced",
194 .procname =
"msgmax",
201 .procname =
"msgmni",
208 .procname =
"msgmnb",
217 .maxlen = 4*
sizeof (
int),
222 .procname =
"auto_msgmni",
224 .maxlen =
sizeof(
int),
233 static struct ctl_table ipc_root_table[] = {
237 .child = ipc_kern_table,
242 static int __init ipc_sysctl_init(
void)