[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/16] bsd-user: Implement sysctl kern.proc, except kern.proc.ful
From: |
Warner Losh |
Subject: |
[PATCH 13/16] bsd-user: Implement sysctl kern.proc, except kern.proc.full_path |
Date: |
Wed, 5 Apr 2023 15:36:09 -0600 |
From: Stacey Son <sson@FreeBSD.org>
Use the recently committed conversion routines to implement all the
kern.proc flavors, except for the full path (the prereqs of which aren't
yet in qemu-project's master branch).
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-sys.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/bsd-user/freebsd/os-sys.c b/bsd-user/freebsd/os-sys.c
index 418358adc1e..3772cf500ba 100644
--- a/bsd-user/freebsd/os-sys.c
+++ b/bsd-user/freebsd/os-sys.c
@@ -753,6 +753,41 @@ static abi_long do_freebsd_sysctl_oid(CPUArchState *env,
int32_t *snamep,
ret = 0;
goto out;
+ case KERN_PROC:
+ switch (snamep[2]) {
+ case KERN_PROC_ALL:
+ case KERN_PROC_PROC:
+ case KERN_PROC_PID:
+ case KERN_PROC_PID | KERN_PROC_INC_THREAD:
+ case KERN_PROC_PGRP:
+ case KERN_PROC_PGRP | KERN_PROC_INC_THREAD:
+ case KERN_PROC_SESSION:
+ case KERN_PROC_SESSION | KERN_PROC_INC_THREAD:
+ case KERN_PROC_TTY:
+ case KERN_PROC_TTY | KERN_PROC_INC_THREAD:
+ case KERN_PROC_UID:
+ case KERN_PROC_UID | KERN_PROC_INC_THREAD:
+ case KERN_PROC_RUID:
+ case KERN_PROC_RUID | KERN_PROC_INC_THREAD:
+ ret = do_sysctl_kern_getprocs(snamep[2], snamep[3], oldlen,
+ holdp, &holdlen);
+ goto out;
+
+ case KERN_PROC_FILEDESC:
+ ret = do_sysctl_kern_proc_filedesc(snamep[3], oldlen, holdp,
+ &holdlen);
+ goto out;
+
+ case KERN_PROC_VMMAP:
+ ret = do_sysctl_kern_proc_vmmap(snamep[3], oldlen, holdp,
+ &holdlen);
+ goto out;
+
+ default:
+ break;
+ }
+ break;
+
default:
break;
}
--
2.40.0
- [PATCH 08/16] bsd-user: Remove useless mmap definitions, (continued)
- [PATCH 08/16] bsd-user: Remove useless mmap definitions, Warner Losh, 2023/04/05
- [PATCH 09/16] bsd-user: h2g_rusage, Warner Losh, 2023/04/05
- [PATCH 03/16] bsd-user: Cleanup style., Warner Losh, 2023/04/05
- [PATCH 05/16] bsd-user: Remove NetBSD specific syscall printing, Warner Losh, 2023/04/05
- [PATCH 06/16] bsd-user: Remove OpenBSD specific syscall printing, Warner Losh, 2023/04/05
- [PATCH 13/16] bsd-user: Implement sysctl kern.proc, except kern.proc.full_path,
Warner Losh <=
- [PATCH 11/16] bsd-user: Implement do_sysctl_kern_proc_filedesc, Warner Losh, 2023/04/05
- [PATCH 07/16] bsd-user: Move system call include to os-syscall.h, Warner Losh, 2023/04/05
- [PATCH 10/16] bsd-user: Implmenet do_sysctl_kern_getprocs, Warner Losh, 2023/04/05
- [PATCH 12/16] bsd-user: Implement do_sysctl_kern_proc_vmmap, Warner Losh, 2023/04/05