summarylogtreecommitdiffstats
path: root/wine-futex_waitv.patch
blob: bf1445fd50d662fb42cf07a63f887b92d13c71f7 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From 3196885798787b6a52dbef0f3968f6b5e0216c56 Mon Sep 17 00:00:00 2001
From: Dmitry Skvortsov <lvb.crd@protonmail.com>
Date: Sun, 26 Dec 2021 16:32:58 +0300
Subject: [PATCH 1/2] Separate check for definition of FUTEX_32 and struct futex_waitv

---
 dlls/ntdll/unix/fsync.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c
index 39d969f061d..c6869b62b4b 100644
--- a/dlls/ntdll/unix/fsync.c
+++ b/dlls/ntdll/unix/fsync.c
@@ -64,8 +64,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(fsync);
 /* futex_waitv interface */

 #ifndef __NR_futex_waitv
-
 # define __NR_futex_waitv 449
+#endif
+
+#ifndef FUTEX_32
 # define FUTEX_32 2
 struct futex_waitv {
     uint64_t   val;
@@ -73,7 +75,6 @@ struct futex_waitv {
     uint32_t   flags;
     uint32_t __reserved;
 };
-
 #endif

 #define u64_to_ptr(x) (void *)(uintptr_t)(x)
-- 
2.34.1

From 2c15b20ad7dd57778ad2354a14dd441d1cd6cf4f Mon Sep 17 00:00:00 2001
From: Dmitry Skvortsov <lvb.crd@protonmail.com>
Date: Sun, 26 Dec 2021 16:45:21 +0300
Subject: [PATCH 2/2] Add check for linux/futex.h

---
 configure               | 6 ++++++
 configure.ac            | 1 +
 dlls/ntdll/unix/fsync.c | 3 +++
 include/config.h.in     | 3 +++
 4 files changed, 13 insertions(+)

diff --git a/configure b/configure
index ab3aa34a922..d2bcd778c59 100755
--- a/configure
+++ b/configure
@@ -8317,6 +8317,12 @@ if test "x$ac_cv_header_linux_filter_h" = xyes
 then :
   printf "%s\n" "#define HAVE_LINUX_FILTER_H 1" >>confdefs.h

+fi
+ac_fn_c_check_header_compile "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_futex_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_LINUX_FUTEX_H 1" >>confdefs.h
+
 fi
 ac_fn_c_check_header_compile "$LINENO" "linux/hdreg.h" "ac_cv_header_linux_hdreg_h" "$ac_includes_default"
 if test "x$ac_cv_header_linux_hdreg_h" = xyes
diff --git a/include/config.h.in b/include/config.h.in
index 9eb052c6248..910cce10693 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -200,6 +200,9 @@
 /* Define to 1 if you have the <linux/filter.h> header file. */
 #undef HAVE_LINUX_FILTER_H

+/* Define to 1 if you have the <linux/futex.h> header file. */
+#undef HAVE_LINUX_FUTEX_H
+
 /* Define if Linux-style gethostbyname_r and gethostbyaddr_r are available */
 #undef HAVE_LINUX_GETHOSTBYNAME_R_6

diff --git a/configure.ac b/configure.ac
index 3071da61b62..cfe27460a96 100644
--- a/configure.ac
+++ b/configure.ac
@@ -450,2 +450,3 @@ AC_CHECK_HEADERS(\
 	linux/filter.h \
+	linux/futex.h \
 	linux/hdreg.h \
diff --git a/dlls/ntdll/unix/fsync.c b/dlls/ntdll/unix/fsync.c
index c6869b62b4b..6d69c643244 100644
--- a/dlls/ntdll/unix/fsync.c
+++ b/dlls/ntdll/unix/fsync.c
@@ -27,6 +27,9 @@
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
+#ifdef HAVE_LINUX_FUTEX_H
+# include <linux/futex.h>
+#endif
 #include <limits.h>
 #include <stdarg.h>
 #include <stdio.h>
-- 
2.34.1