git: 3369af6f98ca - main - cpuset(2): add kern_cpuset
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 07 Nov 2026 12:11:03 UTC
The branch main has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=3369af6f98ca606877e2c6c96e67f082d3f0f25d
commit 3369af6f98ca606877e2c6c96e67f082d3f0f25d
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-11-07 12:10:46 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-11-07 12:10:46 +0000
cpuset(2): add kern_cpuset
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
---
sys/kern/kern_cpuset.c | 9 +++++++--
sys/sys/syscallsubr.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c
index d7eb82d5f259..41d1805c14a4 100644
--- a/sys/kern/kern_cpuset.c
+++ b/sys/kern/kern_cpuset.c
@@ -1843,6 +1843,12 @@ struct cpuset_args {
#endif
int
sys_cpuset(struct thread *td, struct cpuset_args *uap)
+{
+ return (kern_cpuset(td, uap->setid));
+}
+
+int
+kern_cpuset(struct thread *td, cpusetid_t *setid)
{
struct cpuset *root;
struct cpuset *set;
@@ -1856,7 +1862,7 @@ sys_cpuset(struct thread *td, struct cpuset_args *uap)
cpuset_rel(root);
if (error)
return (error);
- error = copyout(&set->cs_id, uap->setid, sizeof(set->cs_id));
+ error = copyout(&set->cs_id, setid, sizeof(set->cs_id));
if (error == 0)
error = cpuset_setproc(-1, set, NULL, NULL, false);
cpuset_rel(set);
@@ -1873,7 +1879,6 @@ struct cpuset_setid_args {
int
sys_cpuset_setid(struct thread *td, struct cpuset_setid_args *uap)
{
-
return (kern_cpuset_setid(td, uap->which, uap->id, uap->setid));
}
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h
index c4e842d64893..7f07e200ec58 100644
--- a/sys/sys/syscallsubr.h
+++ b/sys/sys/syscallsubr.h
@@ -151,6 +151,7 @@ int kern_connectat(struct thread *td, int dirfd, int fd,
struct sockaddr *sa);
int kern_copy_file_range(struct thread *td, int infd, off_t *inoffp,
int outfd, off_t *outoffp, size_t len, unsigned int flags);
+int kern_cpuset(struct thread *td, cpusetid_t *setid);
int kern_cpuset_getaffinity(struct thread *td, cpulevel_t level,
cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask);
int kern_cpuset_setaffinity(struct thread *td, cpulevel_t level,