403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
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/lang/intel-compute-runtime/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/lang/intel-compute-runtime/files/patch-device_path
/sys is Linux-specific. FreeBSD has linsysfs(5) but not mounted by default.

--- shared/source/os_interface/linux/sys_calls_linux.cpp.orig	2021-02-22 20:55:37 UTC
+++ shared/source/os_interface/linux/sys_calls_linux.cpp
@@ -12,7 +12,11 @@
 #include <stdio.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#if defined(__linux__)
 #include <sys/sysmacros.h>
+#elif defined(__DragonFly__) || defined(__FreeBSD__)
+#include <cstdlib>
+#endif
 #include <unistd.h>
 
 namespace NEO {
@@ -36,6 +40,7 @@ int readlink(const char *path, char *buf, size_t bufsi
 }
 
 int getDevicePath(int deviceFd, char *buf, size_t &bufSize) {
+#if defined(__linux__)
     struct stat st;
     if (fstat(deviceFd, &st)) {
         return -1;
@@ -45,6 +50,12 @@ int getDevicePath(int deviceFd, char *buf, size_t &buf
              major(st.st_rdev), minor(st.st_rdev));
 
     return 0;
+#elif defined(__DragonFly__) || defined(__FreeBSD__)
+    return fdevname_r(deviceFd, buf, (int)bufSize) ? 0 : -1;
+#else
+    // Extract drmGetDeviceNameFromFd2 from libdrm
+    return -1;
+#endif
 }
 } // namespace SysCalls
 } // namespace NEO

Youez - 2016 - github.com/yon3zu
LinuXploit