From b29203807e853904a3411f05fdeebb0c3b0cab90 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 14 Jan 2017 16:12:40 +0800 Subject: [PATCH] pthread: Implement pthread_{set,get}affinity_np --- include/pthread_np.h | 4 + lib/libc/gen/Symbol.map | 4 + lib/libc/gen/_pthread_stubs.c | 2 + lib/libc/include/namespace.h | 2 + lib/libc/include/un-namespace.h | 2 + lib/libc_r/uthread/Makefile.inc | 1 + .../libc_r/uthread/uthread_affinity.c | 80 +++++++----- lib/libpthread/Makefile | 2 + lib/libpthread/pthread_setaffinity_np.3 | 134 +++++++++++++++++++++ lib/libthread_xu/pthread.map | 4 + lib/libthread_xu/thread/Makefile.inc | 1 + lib/libthread_xu/thread/thr_affinity.c | 112 +++++++++++++++++ lib/libthread_xu/thread/thr_init.c | 4 + sys/sys/param.h | 3 +- 14 files changed, 322 insertions(+), 33 deletions(-) copy include/pthread_np.h => lib/libc_r/uthread/uthread_affinity.c (51%) create mode 100644 lib/libpthread/pthread_setaffinity_np.3 create mode 100644 lib/libthread_xu/thread/thr_affinity.c diff --git a/include/pthread_np.h b/include/pthread_np.h index 423dbdfa44..d6753a5e39 100644 --- a/include/pthread_np.h +++ b/include/pthread_np.h @@ -31,6 +31,8 @@ #ifndef _PTHREAD_NP_H_ #define _PTHREAD_NP_H_ +#include + /* * Non-POSIX type definitions: */ @@ -42,6 +44,7 @@ typedef void (*pthread_switch_routine_t)(pthread_t, pthread_t); __BEGIN_DECLS int pthread_attr_setcreatesuspend_np(pthread_attr_t *); int pthread_attr_get_np(pthread_t, pthread_attr_t *); +int pthread_getaffinity_np(pthread_t, size_t, cpu_set_t *); int pthread_main_np(void); int pthread_multi_np(void); int pthread_mutexattr_getkind_np(pthread_mutexattr_t); @@ -49,6 +52,7 @@ int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int); void pthread_resume_all_np(void); int pthread_resume_np(pthread_t); void pthread_set_name_np(pthread_t, const char *); +int pthread_setaffinity_np(pthread_t, size_t, const cpu_set_t *); int pthread_single_np(void); void pthread_suspend_all_np(void); int pthread_suspend_np(pthread_t); diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index c105b09191..dff18d24ab 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -70,6 +70,7 @@ DF404.0 { pthread_detach; pthread_equal; pthread_exit; + pthread_getaffinity_np; pthread_getconcurrency; pthread_getprio; pthread_getschedparam; @@ -120,6 +121,7 @@ DF404.0 { pthread_rwlockattr_setpshared; pthread_self; pthread_set_name_np; + pthread_setaffinity_np; pthread_setcancelstate; pthread_setcanceltype; pthread_setconcurrency; @@ -505,6 +507,7 @@ DFprivate_1.0 { _pthread_detach; _pthread_equal; _pthread_exit; + _pthread_getaffinity_np; _pthread_getconcurrency; _pthread_getprio; _pthread_getschedparam; @@ -555,6 +558,7 @@ DFprivate_1.0 { _pthread_rwlockattr_setpshared; _pthread_self; _pthread_set_name_np; + _pthread_setaffinity_np; _pthread_setcancelstate; _pthread_setcanceltype; _pthread_setconcurrency; diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 9f6c7afb22..dd3e603b4a 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -95,6 +95,7 @@ WR(stub_zero, pthread_condattr_setpshared); WR(stub_zero, pthread_detach); WR(stub_true, pthread_equal); WR(stub_exit, pthread_exit); +WR(stub_zero, pthread_getaffinity_np); WR(stub_zero, pthread_getconcurrency); WR(stub_zero, pthread_getprio); WR(stub_zero, pthread_getschedparam); @@ -144,6 +145,7 @@ WR(stub_zero, pthread_rwlockattr_init); WR(stub_zero, pthread_rwlockattr_setpshared); WR(stub_self, pthread_self); WR(stub_zero, pthread_set_name_np); +WR(stub_zero, pthread_setaffinity_np); WR(stub_zero, pthread_setcancelstate); WR(stub_zero, pthread_setcanceltype); WR(stub_zero, pthread_setconcurrency); diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 680e7f21df..0c51d1a094 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -124,6 +124,7 @@ #define pthread_detach _pthread_detach #define pthread_equal _pthread_equal #define pthread_exit _pthread_exit +#define pthread_getaffinity_np _pthread_getaffinity_np #define pthread_getconcurrency _pthread_getconcurrency #define pthread_getprio _pthread_getprio #define pthread_getschedparam _pthread_getschedparam @@ -172,6 +173,7 @@ #define pthread_rwlockattr_setpshared _pthread_rwlockattr_setpshared #define pthread_self _pthread_self #define pthread_set_name_np _pthread_set_name_np +#define pthread_setaffinity_np _pthread_setaffinity_np #define pthread_setcancelstate _pthread_setcancelstate #define pthread_setcanceltype _pthread_setcanceltype #define pthread_setconcurrency _pthread_setconcurrency diff --git a/lib/libc/include/un-namespace.h b/lib/libc/include/un-namespace.h index 04f0a3c68e..881c30b96a 100644 --- a/lib/libc/include/un-namespace.h +++ b/lib/libc/include/un-namespace.h @@ -105,6 +105,7 @@ #undef pthread_detach #undef pthread_equal #undef pthread_exit +#undef pthread_getaffinity_np #undef pthread_getconcurrency #undef pthread_getprio #undef pthread_getschedparam @@ -153,6 +154,7 @@ #undef pthread_rwlockattr_setpshared #undef pthread_self #undef pthread_set_name_np +#undef pthread_setaffinity_np #undef pthread_setcancelstate #undef pthread_setcanceltype #undef pthread_setconcurrency diff --git a/lib/libc_r/uthread/Makefile.inc b/lib/libc_r/uthread/Makefile.inc index 2471c8aecd..200921c9e3 100644 --- a/lib/libc_r/uthread/Makefile.inc +++ b/lib/libc_r/uthread/Makefile.inc @@ -7,6 +7,7 @@ SRCS+= \ uthread_accept.c \ uthread_aio_suspend.c \ + uthread_affinity.c \ uthread_atfork.c \ uthread_attr_destroy.c \ uthread_attr_get_np.c \ diff --git a/include/pthread_np.h b/lib/libc_r/uthread/uthread_affinity.c similarity index 51% copy from include/pthread_np.h copy to lib/libc_r/uthread/uthread_affinity.c index 423dbdfa44..eec8393add 100644 --- a/include/pthread_np.h +++ b/lib/libc_r/uthread/uthread_affinity.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996-98 John Birrell . + * Copyright (c) 1995-1998 John Birrell * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,14 +10,17 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by John Birrell. + * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -25,36 +28,49 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD: src/include/pthread_np.h,v 1.7.2.4 2003/01/10 15:41:17 fjoe Exp $ */ -#ifndef _PTHREAD_NP_H_ -#define _PTHREAD_NP_H_ -/* - * Non-POSIX type definitions: - */ -typedef void (*pthread_switch_routine_t)(pthread_t, pthread_t); +#include +#include +#include +#include +#include +#include +#include "pthread_private.h" -/* - * Non-POSIX thread function prototype definitions: - */ -__BEGIN_DECLS -int pthread_attr_setcreatesuspend_np(pthread_attr_t *); -int pthread_attr_get_np(pthread_t, pthread_attr_t *); -int pthread_main_np(void); -int pthread_multi_np(void); -int pthread_mutexattr_getkind_np(pthread_mutexattr_t); -int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int); -void pthread_resume_all_np(void); -int pthread_resume_np(pthread_t); -void pthread_set_name_np(pthread_t, const char *); -int pthread_single_np(void); -void pthread_suspend_all_np(void); -int pthread_suspend_np(pthread_t); -int pthread_switch_add_np(pthread_switch_routine_t); -int pthread_switch_delete_np(pthread_switch_routine_t); -int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); -__END_DECLS +int +_pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, + cpu_set_t *mask) +{ + + /* Check if the caller has specified a valid thread: */ + if (thread != NULL && thread->magic == PTHREAD_MAGIC) { + cpu_set_t mask1; + int ret; + + ret = 0; + if (lwp_getaffinity(0, -1, &mask1) < 0) { + ret = errno; + return (ret); + } + + if (cpusetsize > sizeof(mask1)) { + memset(mask, 0, cpusetsize); + memcpy(mask, &mask1, sizeof(mask1)); + } else { + memcpy(mask, &mask1, cpusetsize); + } + return (0); + } + return (ESRCH); +} +__strong_reference(_pthread_getaffinity_np, pthread_getaffinity_np); + +int +_pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, + const cpu_set_t *mask) +{ -#endif + return (EOPNOTSUPP); +} +__strong_reference(_pthread_setaffinity_np, pthread_setaffinity_np); diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index 213ae85a93..88a75e8b74 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -60,6 +60,7 @@ MAN+= \ pthread_schedparam.3 \ pthread_self.3 \ pthread_set_name_np.3 \ + pthread_setaffinity_np.3 \ pthread_setspecific.3 \ pthread_sigmask.3 \ pthread_spin_init.3 \ @@ -122,6 +123,7 @@ MLINKS+= \ pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3 \ pthread_schedparam.3 pthread_getschedparam.3 \ pthread_schedparam.3 pthread_setschedparam.3 \ + pthread_setaffinity_np.3 pthread_getaffinity_np.3 \ pthread_spin_init.3 pthread_spin_destroy.3 \ pthread_spin_lock.3 pthread_spin_trylock.3 \ pthread_spin_lock.3 pthread_spin_unlock.3 \ diff --git a/lib/libpthread/pthread_setaffinity_np.3 b/lib/libpthread/pthread_setaffinity_np.3 new file mode 100644 index 0000000000..5e971a8b13 --- /dev/null +++ b/lib/libpthread/pthread_setaffinity_np.3 @@ -0,0 +1,134 @@ +.\" Copyright (c) 2017 The DragonFly Project. All rights reserved. +.\" +.\" This code is derived from software contributed to The DragonFly Project +.\" by Sepherosa Ziehau . +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" 3. Neither the name of The DragonFly Project nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific, prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd January 14, 2017 +.Dt PTHREAD_SETAFFINITY_NP 2 +.Os +.Sh NAME +.Nm pthread_setaffinity_np, +.Nm pthread_getaffinity_np +.Nd set and get the thread's CPU affinity mask +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread.h +.In pthread_np.h +.Ft int +.Fn pthread_setaffinity_np "pthread_t tid" "size_t cpusetsize" "const cpu_set_t *mask" +.Ft int +.Fn pthread_getaffinity_np "pthread_t tid" "size_t cpusetsize" "cpu_set_t *mask" +.Sh DESCRIPTION +.Pp +The +.Fn pthread_setaffinity_np +sets the CPU affinity mask of the thread identified by +.Fa tid +to the value specified by the +.Fa mask . +The +.Fa cpusetsize +is the length (in bytes) of the data pointed to by +.Fa mask . +Normally this argument would be specified as sizeof(cpu_set_t). +If the thread specified by the +.Fa tid +is the current thread, +it will be migrated immediately, +if necessary, otherwise it will be migrated by the scheduler later. +.Pp +A process created by +.Xr fork 2 , +.Xr vfork 2 , +and +.Xr rfork 2 +inherits the calling thread's CPU affinity mask. +Same applies to the threads created by +.Xr lwp_create 2 , +and the threads created by +.Xr pthread_create 3 . +.Pp +.Fn pthread_getaffinity_np +writes the affinity mask of the thread +identified by the +.Fa tid +to the cpu_set_t structure pointed to by +.Fa mask . +.Pp +The cpu_set_t data structure represents a set of CPUs. +See +.Xr sched_setaffinity 2 +for details. +.Sh RETURN VALUES +If successful, +these functions will return zero. +Otherwise an error number will be returned to indicate the error. +.Sh ERRORS +The +.Fn pthread_setaffinity_np +and +.Fn pthread_getaffinity_np +will fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa mask +parameter is outside the process's allocated address space. +.It Bq Er EINVAL +The +.Fa tid +parameter is invalid. +.It Bq Er ESRCH +The thread identified by the +.Fa tid +does not exist. +.It Bq Er EPERM +The +.Fa mask +does not contain a valid CPU. +.El +.Sh SEE ALSO +.Xr fork 2 +.Xr lwp_create 2 +.Xr lwp_getaffinity 2 +.Xr lwp_setaffinity 2 +.Xr pthread_create 3 +.Xr rfork 2 +.Xr sched_getaffinity 2 +.Xr sched_setaffinity 2 +.Xr vfork 2 +.Sh HISTORY +The +.Fn pthread_setaffinity_np +and +.Fn pthread_getaffinity_np +functions first appeared in +.Dx 4.7 . diff --git a/lib/libthread_xu/pthread.map b/lib/libthread_xu/pthread.map index e38cc19631..71f0720cc9 100644 --- a/lib/libthread_xu/pthread.map +++ b/lib/libthread_xu/pthread.map @@ -87,6 +87,7 @@ global: _pthread_detach; _pthread_equal; _pthread_exit; + _pthread_getaffinity_np; _pthread_getconcurrency; _pthread_getprio; _pthread_getschedparam; @@ -136,6 +137,7 @@ global: _pthread_rwlockattr_setpshared; _pthread_self; _pthread_set_name_np; + _pthread_setaffinity_np; _pthread_setcancelstate; _pthread_setcanceltype; _pthread_setconcurrency; @@ -246,6 +248,7 @@ global: pthread_detach; pthread_equal; pthread_exit; + pthread_getaffinity_np; pthread_getconcurrency; pthread_getprio; pthread_getschedparam; @@ -294,6 +297,7 @@ global: pthread_rwlockattr_setpshared; pthread_self; pthread_set_name_np; + pthread_setaffinity_np; pthread_setcancelstate; pthread_setcanceltype; pthread_setconcurrency; diff --git a/lib/libthread_xu/thread/Makefile.inc b/lib/libthread_xu/thread/Makefile.inc index aa97f6d7e0..4ed06da895 100644 --- a/lib/libthread_xu/thread/Makefile.inc +++ b/lib/libthread_xu/thread/Makefile.inc @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/thread SRCS+= \ + thr_affinity.c \ thr_attr.c \ thr_barrier.c \ thr_barrierattr.c \ diff --git a/lib/libthread_xu/thread/thr_affinity.c b/lib/libthread_xu/thread/thr_affinity.c new file mode 100644 index 0000000000..309342cbc0 --- /dev/null +++ b/lib/libthread_xu/thread/thr_affinity.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 1995-1998 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +#include "thr_private.h" + +int +_pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, + cpu_set_t *mask) +{ + struct pthread *curthread = tls_get_curthread(); + cpu_set_t mask1; + int ret; + + if (curthread == thread) { + ret = 0; + if (lwp_getaffinity(0, thread->tid, &mask1) < 0) + ret = errno; + } else { + ret = ESRCH; + if (_thr_ref_add(curthread, thread, 0) == 0) { + THR_THREAD_LOCK(curthread, thread); + if (thread->state != PS_DEAD) { + ret = 0; + if (lwp_getaffinity(0, thread->tid, &mask1) < 0) + ret = errno; + } + THR_THREAD_UNLOCK(curthread, thread); + _thr_ref_delete(curthread, thread); + } + } + if (ret != 0) + return (ret); + + if (cpusetsize > sizeof(mask1)) { + memset(mask, 0, cpusetsize); + memcpy(mask, &mask1, sizeof(mask1)); + } else { + memcpy(mask, &mask1, cpusetsize); + } + return (0); +} +__strong_reference(_pthread_getaffinity_np, pthread_getaffinity_np); + +int +_pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, + const cpu_set_t *mask) +{ + struct pthread *curthread = tls_get_curthread(); + size_t cplen = cpusetsize; + cpu_set_t mask1; + int ret; + + if (cplen > sizeof(mask1)) + cplen = sizeof(mask1); + CPU_ZERO(&mask1); + memcpy(&mask1, mask, cplen); + + if (curthread == thread) { + ret = 0; + if (lwp_setaffinity(0, thread->tid, &mask1) < 0) + ret = errno; + } else { + ret = ESRCH; + if (_thr_ref_add(curthread, thread, 0) == 0) { + THR_THREAD_LOCK(curthread, thread); + if (thread->state != PS_DEAD) { + ret = 0; + if (lwp_setaffinity(0, thread->tid, &mask1) < 0) + ret = errno; + } + THR_THREAD_UNLOCK(curthread, thread); + _thr_ref_delete(curthread, thread); + } + } + return (ret); +} +__strong_reference(_pthread_setaffinity_np, pthread_setaffinity_np); diff --git a/lib/libthread_xu/thread/thr_init.c b/lib/libthread_xu/thread/thr_init.c index 16b93c4a87..7a3ae5ed65 100644 --- a/lib/libthread_xu/thread/thr_init.c +++ b/lib/libthread_xu/thread/thr_init.c @@ -105,6 +105,8 @@ STATIC_LIB_REQUIRE(_pthread_exit); /* thr_fork.c */ STATIC_LIB_REQUIRE(_pthread_atfork); STATIC_LIB_REQUIRE(_fork); +/* thr_affinity.c */ +STATIC_LIB_REQUIRE(_pthread_getaffinity_np); /* thr_getprio.c */ STATIC_LIB_REQUIRE(_pthread_getprio); /* thr_getschedparam.c */ @@ -143,6 +145,8 @@ STATIC_LIB_REQUIRE(_pthread_rwlockattr_init); STATIC_LIB_REQUIRE(_pthread_self); /* thr_sem.c */ STATIC_LIB_REQUIRE(_sem_init); +/* thr_affinity.c */ +STATIC_LIB_REQUIRE(_pthread_setaffinity_np); /* thr_setprio.c */ STATIC_LIB_REQUIRE(_pthread_setprio); /* thr_setschedparam.c */ diff --git a/sys/sys/param.h b/sys/sys/param.h index a964931882..5199b7e681 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -141,9 +141,10 @@ * 400704 - binutils update to 2.27 * 400705 - lwp_{set,get}affinity() * 400706 - sched_{set,get}affinity() + * 400707 - pthread_{set,get}affinity_np() */ #undef __DragonFly_version -#define __DragonFly_version 400706 /* propagated to newvers */ +#define __DragonFly_version 400707 /* propagated to newvers */ #include -- 2.11.4.GIT