Deleted Added
full compact
sysv_msg.c (137613) sysv_msg.c (139436)
1/*
2 * Implementation of SVID messages
3 *
4 * Author: Daniel Boulet
5 *
6 * Copyright 1993 Daniel Boulet and RTMX Inc.
7 *
8 * This system call was implemented by Daniel Boulet under contract from RTMX.

--- 4 unchanged lines hidden (view full) ---

13 * Redistribution in binary form may occur without any restrictions.
14 * Obviously, it would be nice if you gave credit where credit is due
15 * but requiring it would be too onerous.
16 *
17 * This software is provided ``AS IS'' without any warranties of any kind.
18 */
19
20#include <sys/cdefs.h>
1/*
2 * Implementation of SVID messages
3 *
4 * Author: Daniel Boulet
5 *
6 * Copyright 1993 Daniel Boulet and RTMX Inc.
7 *
8 * This system call was implemented by Daniel Boulet under contract from RTMX.

--- 4 unchanged lines hidden (view full) ---

13 * Redistribution in binary form may occur without any restrictions.
14 * Obviously, it would be nice if you gave credit where credit is due
15 * but requiring it would be too onerous.
16 *
17 * This software is provided ``AS IS'' without any warranties of any kind.
18 */
19
20#include <sys/cdefs.h>
21__FBSDID("$FreeBSD: head/sys/kern/sysv_msg.c 137613 2004-11-12 13:23:47Z rwatson $");
21__FBSDID("$FreeBSD: head/sys/kern/sysv_msg.c 139436 2004-12-30 13:56:34Z rwatson $");
22
23#include "opt_sysvipc.h"
24
25#include <sys/param.h>
26#include <sys/systm.h>
27#include <sys/sysproto.h>
28#include <sys/kernel.h>
29#include <sys/proc.h>

--- 97 unchanged lines hidden (view full) ---

127msginit()
128{
129 register int i;
130
131 TUNABLE_INT_FETCH("kern.ipc.msgseg", &msginfo.msgseg);
132 TUNABLE_INT_FETCH("kern.ipc.msgssz", &msginfo.msgssz);
133 msginfo.msgmax = msginfo.msgseg * msginfo.msgssz;
134 TUNABLE_INT_FETCH("kern.ipc.msgmni", &msginfo.msgmni);
22
23#include "opt_sysvipc.h"
24
25#include <sys/param.h>
26#include <sys/systm.h>
27#include <sys/sysproto.h>
28#include <sys/kernel.h>
29#include <sys/proc.h>

--- 97 unchanged lines hidden (view full) ---

127msginit()
128{
129 register int i;
130
131 TUNABLE_INT_FETCH("kern.ipc.msgseg", &msginfo.msgseg);
132 TUNABLE_INT_FETCH("kern.ipc.msgssz", &msginfo.msgssz);
133 msginfo.msgmax = msginfo.msgseg * msginfo.msgssz;
134 TUNABLE_INT_FETCH("kern.ipc.msgmni", &msginfo.msgmni);
135 TUNABLE_INT_FETCH("kern.ipc.msgmnb", &msginfo.msgmnb);
136 TUNABLE_INT_FETCH("kern.ipc.msgtql", &msginfo.msgtql);
135
136 msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
137 if (msgpool == NULL)
138 panic("msgpool is NULL");
139 msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK);
140 if (msgmaps == NULL)
141 panic("msgmaps is NULL");
142 msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK);

--- 988 unchanged lines hidden (view full) ---

1131
1132 return (SYSCTL_OUT(req, msqids,
1133 sizeof(struct msqid_kernel) * msginfo.msgmni));
1134}
1135
1136SYSCTL_DECL(_kern_ipc);
1137SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "");
1138SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RDTUN, &msginfo.msgmni, 0, "");
137
138 msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
139 if (msgpool == NULL)
140 panic("msgpool is NULL");
141 msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK);
142 if (msgmaps == NULL)
143 panic("msgmaps is NULL");
144 msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK);

--- 988 unchanged lines hidden (view full) ---

1133
1134 return (SYSCTL_OUT(req, msqids,
1135 sizeof(struct msqid_kernel) * msginfo.msgmni));
1136}
1137
1138SYSCTL_DECL(_kern_ipc);
1139SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "");
1140SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RDTUN, &msginfo.msgmni, 0, "");
1139SYSCTL_INT(_kern_ipc, OID_AUTO, msgmnb, CTLFLAG_RD, &msginfo.msgmnb, 0, "");
1140SYSCTL_INT(_kern_ipc, OID_AUTO, msgtql, CTLFLAG_RD, &msginfo.msgtql, 0, "");
1141SYSCTL_INT(_kern_ipc, OID_AUTO, msgmnb, CTLFLAG_RDTUN, &msginfo.msgmnb, 0, "");
1142SYSCTL_INT(_kern_ipc, OID_AUTO, msgtql, CTLFLAG_RDTUN, &msginfo.msgtql, 0, "");
1141SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, CTLFLAG_RDTUN, &msginfo.msgssz, 0, "");
1142SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, "");
1143SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
1144 NULL, 0, sysctl_msqids, "", "Message queue IDs");
1143SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, CTLFLAG_RDTUN, &msginfo.msgssz, 0, "");
1144SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, "");
1145SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
1146 NULL, 0, sysctl_msqids, "", "Message queue IDs");