Export via sysctl:
* all members of msginfo from sysv_msg.c; * msqids from sysv_msg.c; * sema from sysv_sem.c; and * shmsegs from sysv_shm.c; These will be used by ipcs(1) in non-kvm mode. Reviewed by: tmm
This commit is contained in:
parent
91a086eaf5
commit
a723c4e173
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77461
@ -1166,3 +1166,21 @@ msgrcv(p, uap)
|
||||
p->p_retval[0] = msgsz;
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_msqids(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
||||
return (SYSCTL_OUT(req, msqids,
|
||||
sizeof(struct msqid_ds) * msginfo.msgmni));
|
||||
}
|
||||
|
||||
SYSCTL_DECL(_kern_ipc);
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgmni, CTLFLAG_RD, &msginfo.msgmni, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgmnb, CTLFLAG_RD, &msginfo.msgmnb, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgtql, CTLFLAG_RD, &msginfo.msgtql, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, CTLFLAG_RD, &msginfo.msgssz, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RD, &msginfo.msgseg, 0, "")
|
||||
SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
|
||||
NULL, 0, sysctl_msqids, "", "Message queue IDs");
|
||||
|
@ -28,6 +28,7 @@ static void seminit __P((void));
|
||||
static int sysvsem_modload __P((struct module *, int, void *));
|
||||
static int semunload __P((void));
|
||||
static void semexit_myhook __P((struct proc *p));
|
||||
static int sysctl_sema __P((SYSCTL_HANDLER_ARGS));
|
||||
|
||||
#ifndef _SYS_SYSPROTO_H_
|
||||
struct __semctl_args;
|
||||
@ -148,6 +149,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semume, CTLFLAG_RD, &seminfo.semume, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RD, &seminfo.semusz, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RW, &seminfo.semvmx, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RW, &seminfo.semaem, 0, "");
|
||||
SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLFLAG_RD,
|
||||
NULL, 0, sysctl_sema, "", "");
|
||||
|
||||
#if 0
|
||||
RO seminfo.semmap /* SEMMAP unused */
|
||||
@ -1066,3 +1069,11 @@ semexit_myhook(p)
|
||||
suptr->un_proc = NULL;
|
||||
*supptr = suptr->un_next;
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_sema(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
||||
return (SYSCTL_OUT(req, sema,
|
||||
sizeof(struct semid_ds) * seminfo.semmni));
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ static int sysvshm_modload __P((struct module *, int, void *));
|
||||
static int shmunload __P((void));
|
||||
static void shmexit_myhook __P((struct proc *p));
|
||||
static void shmfork_myhook __P((struct proc *p1, struct proc *p2));
|
||||
static int sysctl_shmsegs __P((SYSCTL_HANDLER_ARGS));
|
||||
|
||||
/*
|
||||
* Tuneable values.
|
||||
@ -145,6 +146,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, shmseg, CTLFLAG_RD, &shminfo.shmseg, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, shmall, CTLFLAG_RW, &shminfo.shmall, 0, "");
|
||||
SYSCTL_INT(_kern_ipc, OID_AUTO, shm_use_phys, CTLFLAG_RW,
|
||||
&shm_use_phys, 0, "");
|
||||
SYSCTL_PROC(_kern_ipc, OID_AUTO, shmsegs, CTLFLAG_RD,
|
||||
NULL, 0, sysctl_shmsegs, "", "");
|
||||
|
||||
static int
|
||||
shm_find_segment_by_key(key)
|
||||
@ -742,6 +745,13 @@ shmunload()
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_shmsegs(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
||||
return (SYSCTL_OUT(req, shmsegs, shmalloced * sizeof(shmsegs[0])));
|
||||
}
|
||||
|
||||
static int
|
||||
sysvshm_modload(struct module *module, int cmd, void *arg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user