File: gnu-hurd.patch

package info (click to toggle)
qemu 1%3A10.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 415,896 kB
  • sloc: ansic: 4,763,546; pascal: 115,134; python: 105,698; asm: 68,664; sh: 53,146; makefile: 27,519; perl: 18,863; cpp: 11,443; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (50 lines) | stat: -rw-r--r-- 1,585 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Sat, 24 Aug 2024 08:00:35 +0300
Updated: Sun, 27 Jul 2025 13:22:10 +0300
Subject: Add OS detection and support for GNU/Hurd
Forwarded: not-needed

Adds minimal (just OS detection) "support" for
GNU/Hurd.  Just a test for now.

--- a/configure
+++ b/configure
@@ -363,2 +363,4 @@ elif check_define __NetBSD__; then
   host_os=netbsd
+elif check_define __GNU__; then
+  host_os=hurd
 elif check_define __APPLE__; then
--- a/meson.build
+++ b/meson.build
@@ -52,3 +52,3 @@ qapi_trace_events = []
 bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
-supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux', 'emscripten']
+supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux', 'emscripten', 'hurd']
 supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -135,4 +135,11 @@ QEMU_EXTERN_C int daemon(int, int);
 
+#if defined(__GNU__) && !defined(PATH_MAX) /* GNU Hurd */
+# define PATH_MAX 4096
+#endif
+
 #ifdef CONFIG_IOVEC
 #include <sys/uio.h>
+# if defined(__GNU__) && !defined(IOV_MAX) /* GNU Hurd */
+#  define IOV_MAX 1024
+# endif
 #endif
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -118,2 +118,6 @@
 
+#ifdef __GNU__
+#include <sys/ioctl.h>
+#endif
+
 /* OS X does not have O_DSYNC */
@@ -2090,2 +2094,3 @@ static int handle_aiocb_write_zeroes_unm
 #ifndef HAVE_COPY_FILE_RANGE
+#define copy_file_range qemu_copy_file_range
 #ifndef EMSCRIPTEN