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/graphics/igt-gpu-tools/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/graphics/igt-gpu-tools/files/patch-lib_igt__core.c
--- lib/igt_core.c.orig	2022-08-31 20:00:01 UTC
+++ lib/igt_core.c
@@ -43,7 +43,7 @@
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/types.h>
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
 #include <sys/syscall.h>
 #endif
 #include <pthread.h>
@@ -85,6 +85,12 @@
 #include <libgen.h>   /* for basename() on Solaris */
 #endif
 
+#ifdef __FreeBSD__
+#define	gettid()				getpid()
+#define	pthread_sigqueue(pid, signo, value)	sigqueue(pid, signo, value)
+#define	sighandler_t				sig_t
+#endif
+
 /**
  * SECTION:igt_core
  * @short_description: Core i-g-t testing support
@@ -786,6 +792,7 @@ static void oom_adjust_for_doom(void)
 
 static void oom_adjust_for_doom(void)
 {
+#ifdef __linux__
 	int fd;
 	const char always_kill[] = "1000";
 
@@ -793,7 +800,7 @@ static void oom_adjust_for_doom(void)
 	igt_assert(fd != -1);
 	igt_assert(write(fd, always_kill, sizeof(always_kill)) == sizeof(always_kill));
 	close(fd);
-
+#endif
 }
 
 /**
@@ -2223,7 +2230,12 @@ bool __igt_fork_helper(struct igt_helper_process *proc
 		igt_assert(0);
 	case 0:
 		reset_helper_process_list();
+#ifdef __linux__
 		oom_adjust_for_doom();
+#elif defined(__FreeBSD__)
+		/* not a great substitution for oom_adjust_for_doom() */
+		raise(SIGTERM);
+#endif
 
 		return true;
 	default:

Youez - 2016 - github.com/yon3zu
LinuXploit