Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163387965
D27307.id81434.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27307.id81434.diff
View Options
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c b/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c
--- a/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_cpuset.c
@@ -36,6 +36,46 @@
#include <stdio.h>
#include <sched.h>
+#ifdef __FreeBSD__
+#include <sys/cpuset.h>
+
+#include <stdlib.h>
+
+#define cpuset_create() calloc(1, sizeof(cpuset_t))
+#define cpuset_destroy(cs) free(cs)
+
+static inline int
+cpuset_set(size_t i, cpuset_t *cs)
+{
+
+ if (i > CPU_SETSIZE)
+ return (-1);
+ CPU_SET(i, cs);
+ return (0);
+}
+
+static inline int
+cpuset_clr(size_t i, cpuset_t *cs)
+{
+
+ if (i > CPU_SETSIZE)
+ return (-1);
+ CPU_CLR(i, cs);
+ return (0);
+}
+
+static inline int
+cpuset_isset(size_t i, cpuset_t *cs)
+{
+
+ if (i > CPU_SETSIZE)
+ return (-1);
+ return (CPU_ISSET(i, cs));
+}
+
+#define cpuset_size(cs) sizeof(*cs)
+#endif
+
ATF_TC(cpuset_err);
ATF_TC_HEAD(cpuset_err, tc)
{
diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile
--- a/lib/libc/tests/gen/Makefile
+++ b/lib/libc/tests/gen/Makefile
@@ -20,7 +20,7 @@
ATF_TESTS_C+= sigsetops_test
ATF_TESTS_C+= wordexp_test
-# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid,
+# TODO: t_closefrom, t_fmtcheck, t_randomid,
# TODO: t_siginfo (fixes require further inspection)
# TODO: t_sethostname_test (consistently screws up the hostname)
@@ -47,6 +47,7 @@
NETBSD_ATF_TESTS_C= alarm_test
NETBSD_ATF_TESTS_C+= assert_test
NETBSD_ATF_TESTS_C+= basedirname_test
+NETBSD_ATF_TESTS_C+= cpuset_test
NETBSD_ATF_TESTS_C+= dir_test
NETBSD_ATF_TESTS_C+= floatunditf_test
NETBSD_ATF_TESTS_C+= fnmatch_test
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 6:28 PM (11 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35411103
Default Alt Text
D27307.id81434.diff (1 KB)
Attached To
Mode
D27307: [3/2] tests: hook up some tests for cpuset(2) and CPUSET(9)
Attached
Detach File
Event Timeline
Log In to Comment