git: 8b4b995effb7 - main - cpuset: Move userspace declarations out of _cpuset.h
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 12 May 2026 20:06:07 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=8b4b995effb7911cc13706dc309d5e03c83b9a94
commit 8b4b995effb7911cc13706dc309d5e03c83b9a94
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-05-12 17:47:25 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-05-12 20:05:19 +0000
cpuset: Move userspace declarations out of _cpuset.h
The _*.h headers are for structure definitions and should avoid
dependencies on other headers. This convention is violated by using
__BEGIN_DECLS/__END_DECLS.
Move the declarations to cpuset.h, I see no reason they can't be there.
Reviewed by: olce, brooks, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56856
---
sys/sys/_cpuset.h | 7 -------
sys/sys/cpuset.h | 7 ++++++-
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/sys/sys/_cpuset.h b/sys/sys/_cpuset.h
index b87cfb5d3f80..157192ed65ba 100644
--- a/sys/sys/_cpuset.h
+++ b/sys/sys/_cpuset.h
@@ -49,11 +49,4 @@
__BITSET_DEFINE(_cpuset, CPU_SETSIZE);
typedef struct _cpuset cpuset_t;
-#ifndef _KERNEL
-__BEGIN_DECLS
-cpuset_t *__cpuset_alloc(size_t set_size);
-void __cpuset_free(cpuset_t *ptr);
-__END_DECLS
-#endif
-
#endif /* !_SYS__CPUSET_H_ */
diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h
index e861321586db..92c14b0de5eb 100644
--- a/sys/sys/cpuset.h
+++ b/sys/sys/cpuset.h
@@ -181,8 +181,13 @@ int cpusetobj_strscan(cpuset_t *, const char *);
void ddb_display_cpuset(const cpuset_t *);
#endif
-#else
+#else /* !_KERNEL */
+#include <sys/cdefs.h>
+
__BEGIN_DECLS
+cpuset_t *__cpuset_alloc(size_t set_size);
+void __cpuset_free(cpuset_t *ptr);
+
int cpuset(cpusetid_t *);
int cpuset_setid(cpuwhich_t, id_t, cpusetid_t);
int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *);