===================================================================
@@ -469,7 +479,20 @@
(thread : pthread_t;
cpusetsize : size_t;
cpuset : access cpu_set_t) return int;
- pragma Import (C, pthread_setaffinity_np, "__gnat_pthread_setaffinity_np");
+ pragma Import (C, pthread_setaffinity_np, "pthread_setaffinity_np");
+ pragma Weak_External (pthread_setaffinity_np);
+ -- Use a weak symbol because this function may be available or not,
+ -- depending on the version of the system.
+
+ function pthread_attr_setaffinity_np
+ (attr : access pthread_attr_t;
+ cpusetsize : size_t;
+ cpuset : access cpu_set_t) return int;
+ pragma Import (C, pthread_attr_setaffinity_np,
+ "pthread_attr_setaffinity_np");
+ pragma Weak_External (pthread_attr_setaffinity_np);
+ -- Use a weak symbol because this function may be available or not,
+ -- depending on the version of the system.
private
===================================================================
@@ -0,0 +1,15 @@
+2011-08-02 Ludovic Brenta <ludovic@ludovic-brenta.org>
+
+ PR ada/49944
+ * s-osinte-kfreebsd-gnu.ads (pthread_setaffinity_np): import
+ pthread_setaffinity_np instead of __gnat_pthread_setaffinity_np,
+ which no longer exists; and use a Weak_External reference, like we
+ do on Linux.
+ (pthread_attr_setaffinity_np): new, copy from s-osinte-linux.ads.
+