File: fix-mq_attr-partialeq.patch

package info (click to toggle)
rust-libc 0.2.178-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,612 kB
  • sloc: makefile: 4
file content (72 lines) | stat: -rw-r--r-- 2,794 bytes parent folder | download
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
commit f609034528d2c122f46c2e00887e886a998c3c61
Author: Marco Trevisan (TreviƱo) <mail@3v1n0.net>
Date:   Tue Dec 2 19:21:51 2025 +0100

    linux, fuchsia: Mark mq_attr padding area as such
    
    As per commit c100954964 the hard-coded partial equality implementations
    have been dropped in favor for auto-generated ones, but they did not
    work for mq_attr, since the padding area was not typed correctly.
    
    Fix this, using the Padding type.
    
    (backport <https://github.com/rust-lang/libc/pull/4858>)
    (cherry picked from commit d5b0f290a1c464fecc9710bb7fb1c8e011c1314a)

diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index 4ba381cbb6..dde162827e 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -946,7 +946,7 @@ s! {
         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
         pub mq_curmsgs: i64,
         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
-        pad: [i64; 4],
+        pad: Padding<[i64; 4]>,
 
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
         pub mq_flags: c_long,
@@ -957,7 +957,7 @@ s! {
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
         pub mq_curmsgs: c_long,
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
-        pad: [c_long; 4],
+        pad: Padding<[c_long; 4]>,
     }
 
     pub struct sockaddr_nl {
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index 8996527e2e..6bb961520d 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -365,7 +365,7 @@ s! {
         pub mq_maxmsg: c_long,
         pub mq_msgsize: c_long,
         pub mq_curmsgs: c_long,
-        pad: [c_long; 4],
+        pad: Padding<[c_long; 4]>,
     }
 
     #[cfg_attr(target_pointer_width = "32", repr(align(4)))]
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 3a757ee8d2..8a0b836d4c 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1426,7 +1426,7 @@ s! {
         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
         pub mq_curmsgs: i64,
         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
-        pad: [i64; 4],
+        pad: Padding<[i64; 4]>,
 
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
         pub mq_flags: c_long,
@@ -1437,7 +1437,7 @@ s! {
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
         pub mq_curmsgs: c_long,
         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
-        pad: [c_long; 4],
+        pad: Padding<[c_long; 4]>,
     }
 
     pub struct hwtstamp_config {