pthread: Implement pthread_{set,get}affinity_np
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 Jan 2017 08:12:40 +0000 (16:12 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 Jan 2017 08:55:25 +0000 (16:55 +0800)
14 files changed:
include/pthread_np.h
lib/libc/gen/Symbol.map
lib/libc/gen/_pthread_stubs.c
lib/libc/include/namespace.h
lib/libc/include/un-namespace.h
lib/libc_r/uthread/Makefile.inc
lib/libc_r/uthread/uthread_affinity.c [copied from include/pthread_np.h with 51% similarity]
lib/libpthread/Makefile
lib/libpthread/pthread_setaffinity_np.3 [new file with mode: 0644]
lib/libthread_xu/pthread.map
lib/libthread_xu/thread/Makefile.inc
lib/libthread_xu/thread/thr_affinity.c [new file with mode: 0644]
lib/libthread_xu/thread/thr_init.c
sys/sys/param.h

index 423dbdf..d6753a5 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef _PTHREAD_NP_H_
 #define _PTHREAD_NP_H_
 
+#include <sched.h>
+
 /*
  * 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);
index c105b09..dff18d2 100644 (file)
@@ -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;
index 9f6c7af..dd3e603 100644 (file)
@@ -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);
index 680e7f2..0c51d1a 100644 (file)
 #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
 #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
index 04f0a3c..881c30b 100644 (file)
 #undef         pthread_detach
 #undef         pthread_equal
 #undef         pthread_exit
+#undef         pthread_getaffinity_np
 #undef         pthread_getconcurrency
 #undef         pthread_getprio
 #undef         pthread_getschedparam
 #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
index 2471c8a..200921c 100644 (file)
@@ -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 \
similarity index 51%
copy from include/pthread_np.h
copy to lib/libc_r/uthread/uthread_affinity.c
index 423dbdf..eec8393 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996-98 John Birrell <jb@cimlogic.com.au>.
+ * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * 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)
  * 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 <sys/types.h>
+#include <sys/usched.h>
+#include <errno.h>
+#include <string.h>
+#include <pthread.h>
+#include <pthread_np.h>
+#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);
index 213ae85..88a75e8 100644 (file)
@@ -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 (file)
index 0000000..5e971a8
--- /dev/null
@@ -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 <sepherosa@gmail.com>.
+.\"
+.\" 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 .
index e38cc19..71f0720 100644 (file)
@@ -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;
index aa97f6d..4ed06da 100644 (file)
@@ -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 (file)
index 0000000..309342c
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
+ * 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 <sys/types.h>
+#include <sys/usched.h>
+#include <errno.h>
+#include <string.h>
+#include <pthread.h>
+#include <pthread_np.h>
+#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);
index 16b93c4..7a3ae5e 100644 (file)
@@ -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 */
index a964931..5199b7e 100644 (file)
  * 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 <sys/_null.h>