| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 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/sysutils/cpuid/files/ |
Upload File : |
--- cpuid.c.orig 2021-11-01 17:25:27 UTC
+++ cpuid.c
@@ -73,6 +73,8 @@
#define USE_CPUID_COUNT
#endif
+#define CPUID_MAJOR 0
+
#if defined(__GNUC__)
#define UNUSED __attribute((unused))
#else
@@ -9485,12 +9487,17 @@ real_setup(unsigned int cpu,
pthread_t thread = pthread_self();
int status = processor_bind(P_LWPID, thread, cpu, NULL);
#else
- cpu_set_t cpuset;
+ cpuset_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(cpu, &cpuset);
int status;
- status = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
+#if defined(__FreeBSD__)
+ status = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
+ -1, sizeof(cpuset_t), &cpuset);
+#else
+ status = sched_setaffinity(0, sizeof(cpuset_t), &cpuset);
#endif
+#endif
if (status == -1) {
if (cpu > 0) {
if (errno == EINVAL) return -1;
@@ -9613,11 +9620,14 @@ static int real_get (int cpuid_fd,
"c" (ecx));
#endif
} else {
- off64_t result;
- off64_t offset = ((off64_t)ecx << 32) + reg;
+// off64_t result;
+// off64_t offset = ((off64_t)ecx << 32) + reg;
+ int32_t result;
+ int32_t offset = (int32_t)ecx + reg;
int status;
- result = lseek64(cpuid_fd, offset, SEEK_SET);
+// result = lseek64(cpuid_fd, offset, SEEK_SET);
+ result = lseek(cpuid_fd, offset, SEEK_SET);
if (result == -1) {
if (quiet) {
return FALSE;