summaryrefslogtreecommitdiff
path: root/lang/rust188/files/patch-vendor_libc-0.2.155
blob: 69c2a03f70628e3e244a678d384d979775023abf (plain) (blame)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
https://github.com/rust-lang/rust/issues/130677

From 9049542fabce9eea669d1fe3d4d973931c9d7d23 Mon Sep 17 00:00:00 2001
From: Alan Somers <asomers@gmail.com>
Date: Mon, 23 Sep 2024 10:22:32 -0600
Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+

Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64.
Nobody noticed the mistake, probably because it was only tested on
64-bit architectures, where those are equivalent.  But it's a problem
now, after #3723 , which switched the standard library to a FreeBSD 12
ABI.

Issue https://github.com/rust-lang/rust/issues/130677
---
 src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +-
 src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +-
 src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +-
 src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +-
 src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
index de34069eabdf2..68a8364194607 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -4,7 +4,7 @@
 pub type nlink_t = u16;
 // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12:
 pub type dev_t = u32;
-// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12:
+// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12:
 pub type ino_t = u32;
 
 s! {
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 10fcaa03a4ef6..197400ffb4e28 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -2,7 +2,7 @@
 
 pub type nlink_t = u64;
 pub type dev_t = u64;
-pub type ino_t = ::c_ulong;
+pub type ino_t = u64;
 pub type shmatt_t = ::c_uint;
 
 s! {
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
index ec6bce2a03091..d3a77d03c48d0 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -2,7 +2,7 @@
 
 pub type nlink_t = u64;
 pub type dev_t = u64;
-pub type ino_t = ::c_ulong;
+pub type ino_t = u64;
 pub type shmatt_t = ::c_uint;
 pub type kpaddr_t = u64;
 pub type kssize_t = i64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
index 160a4baae481b..9d65317d29cb4 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
@@ -2,7 +2,7 @@
 
 pub type nlink_t = u64;
 pub type dev_t = u64;
-pub type ino_t = ::c_ulong;
+pub type ino_t = u64;
 pub type shmatt_t = ::c_uint;
 pub type kpaddr_t = u64;
 pub type kssize_t = i64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
index d73215a68ec33..f76208400f324 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
@@ -2,7 +2,7 @@
 
 pub type nlink_t = u64;
 pub type dev_t = u64;
-pub type ino_t = ::c_ulong;
+pub type ino_t = u64;
 pub type shmatt_t = ::c_uint;
 pub type kpaddr_t = u64;
 pub type kssize_t = i64;


From 8aca9c0126f3aa5a7dce1ad7fc016b4a0d6af70a Mon Sep 17 00:00:00 2001
From: Alan Somers <asomers@gmail.com>
Date: Mon, 23 Sep 2024 10:44:13 -0600
Subject: [PATCH] Fix the definition of "struct stat" on 32-bit FreeBSD 12+

The original definitions were never correct.  But nobody noticed because
we don't do CI on 32-bit FreeBSD.  The problem is apparent now due to
 #3723 , which caused the nightly toolchain to switch to a FreeBSD 12
ABI.

Fixes https://github.com/rust-lang/rust/issues/130677
---
 .../{freebsd12/b64.rs => freebsd11/b32.rs}    | 13 +++---
 .../bsd/freebsdlike/freebsd/freebsd11/mod.rs  |  7 +--
 .../bsd/freebsdlike/freebsd/freebsd12/mod.rs  | 43 +++++++++++++++----
 .../bsd/freebsdlike/freebsd/freebsd13/b64.rs  | 34 ---------------
 .../bsd/freebsdlike/freebsd/freebsd13/mod.rs  | 43 +++++++++++++++----
 .../bsd/freebsdlike/freebsd/freebsd14/b64.rs  | 34 ---------------
 .../bsd/freebsdlike/freebsd/freebsd14/mod.rs  | 43 +++++++++++++++----
 .../bsd/freebsdlike/freebsd/freebsd15/b64.rs  | 34 ---------------
 .../bsd/freebsdlike/freebsd/freebsd15/mod.rs  | 43 +++++++++++++++----
 src/unix/bsd/freebsdlike/freebsd/x86.rs       | 25 -----------
 10 files changed, 146 insertions(+), 173 deletions(-)
 rename src/unix/bsd/freebsdlike/freebsd/{freebsd12/b64.rs => freebsd11/b32.rs} (89%)
 delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
 delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
 delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs

diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs
similarity index 89%
rename from src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
rename to src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs

--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs.orig	2024-10-24 17:21:07.154172000 +0200
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs	2024-10-24 17:21:02.029962000 +0200
@@ -0,0 +1,34 @@
+#[repr(C)]
+#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
+pub struct stat {
+    pub st_dev: ::dev_t,
+    pub st_ino: ::ino_t,
+    pub st_nlink: ::nlink_t,
+    pub st_mode: ::mode_t,
+    st_padding0: i16,
+    pub st_uid: ::uid_t,
+    pub st_gid: ::gid_t,
+    st_padding1: i32,
+    pub st_rdev: ::dev_t,
+    pub st_atime: ::time_t,
+    pub st_atime_nsec: ::c_long,
+    pub st_mtime: ::time_t,
+    pub st_mtime_nsec: ::c_long,
+    pub st_ctime: ::time_t,
+    pub st_ctime_nsec: ::c_long,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    pub st_size: ::off_t,
+    pub st_blocks: ::blkcnt_t,
+    pub st_blksize: ::blksize_t,
+    pub st_flags: ::fflags_t,
+    pub st_gen: u64,
+    pub st_spare: [u64; 10],
+}
+
+impl ::Copy for ::stat {}
+impl ::Clone for ::stat {
+    fn clone(&self) -> ::stat {
+        *self
+    }
+}


index 80c6fa1684530..5c1156581fd61 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs
@@ -3,12 +3,10 @@
 pub struct stat {
     pub st_dev: ::dev_t,
     pub st_ino: ::ino_t,
-    pub st_nlink: ::nlink_t,
     pub st_mode: ::mode_t,
-    st_padding0: i16,
+    pub st_nlink: ::nlink_t,
     pub st_uid: ::uid_t,
     pub st_gid: ::gid_t,
-    st_padding1: i32,
     pub st_rdev: ::dev_t,
     pub st_atime: ::time_t,
     pub st_atime_nsec: ::c_long,
@@ -16,14 +14,15 @@ pub struct stat {
     pub st_mtime_nsec: ::c_long,
     pub st_ctime: ::time_t,
     pub st_ctime_nsec: ::c_long,
-    pub st_birthtime: ::time_t,
-    pub st_birthtime_nsec: ::c_long,
     pub st_size: ::off_t,
     pub st_blocks: ::blkcnt_t,
     pub st_blksize: ::blksize_t,
     pub st_flags: ::fflags_t,
-    pub st_gen: u64,
-    pub st_spare: [u64; 10],
+    pub st_gen: u32,
+    pub st_lspare: i32,
+    pub st_birthtime: ::time_t,
+    pub st_birthtime_nsec: ::c_long,
+    __unused: [u8; 8],
 }
 
 impl ::Copy for ::stat {}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
index 68a8364194607..e416ebf745841 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -479,10 +479,11 @@ extern "C" {
 }
 
 cfg_if! {
-    if #[cfg(any(target_arch = "x86_64",
-                 target_arch = "aarch64",
-                 target_arch = "riscv64"))] {
+    if #[cfg(target_pointer_width = "64")] {
         mod b64;
         pub use self::b64::*;
+    } else {
+        mod b32;
+        pub use self::b32::*;
     }
 }
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 197400ffb4e28..c4431a6458e8f 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -218,6 +218,40 @@ s! {
         /// kthread flag.
         pub ki_tdflags: ::c_long,
     }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        st_padding0: i16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_padding1: i32,
+        pub st_rdev: ::dev_t,
+        #[cfg(target_arch = "x86")]
+        st_atim_ext: i32,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_mtim_ext: i32,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_ctim_ext: i32,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_btim_ext: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u64,
+        pub st_spare: [u64; 10],
+    }
 }
 
 s_no_extra_traits! {
@@ -488,15 +522,6 @@ extern "C" {
     pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
 }
 
-cfg_if! {
-    if #[cfg(any(target_arch = "x86_64",
-                 target_arch = "aarch64",
-                 target_arch = "riscv64"))] {
-        mod b64;
-        pub use self::b64::*;
-    }
-}
-
 cfg_if! {
     if #[cfg(target_arch = "x86_64")] {
         mod x86_64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
deleted file mode 100644
index 80c6fa1684530..0000000000000
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-#[repr(C)]
-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
-pub struct stat {
-    pub st_dev: ::dev_t,
-    pub st_ino: ::ino_t,
-    pub st_nlink: ::nlink_t,
-    pub st_mode: ::mode_t,
-    st_padding0: i16,
-    pub st_uid: ::uid_t,
-    pub st_gid: ::gid_t,
-    st_padding1: i32,
-    pub st_rdev: ::dev_t,
-    pub st_atime: ::time_t,
-    pub st_atime_nsec: ::c_long,
-    pub st_mtime: ::time_t,
-    pub st_mtime_nsec: ::c_long,
-    pub st_ctime: ::time_t,
-    pub st_ctime_nsec: ::c_long,
-    pub st_birthtime: ::time_t,
-    pub st_birthtime_nsec: ::c_long,
-    pub st_size: ::off_t,
-    pub st_blocks: ::blkcnt_t,
-    pub st_blksize: ::blksize_t,
-    pub st_flags: ::fflags_t,
-    pub st_gen: u64,
-    pub st_spare: [u64; 10],
-}
-
-impl ::Copy for ::stat {}
-impl ::Clone for ::stat {
-    fn clone(&self) -> ::stat {
-        *self
-    }
-}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
index d3a77d03c48d0..118404e8b089b 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -228,6 +228,40 @@ s! {
         /// kthread flag.
         pub ki_tdflags: ::c_long,
     }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        st_padding0: i16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_padding1: i32,
+        pub st_rdev: ::dev_t,
+        #[cfg(target_arch = "x86")]
+        st_atim_ext: i32,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_mtim_ext: i32,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_ctim_ext: i32,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_btim_ext: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u64,
+        pub st_spare: [u64; 10],
+    }
 }
 
 s_no_extra_traits! {
@@ -529,15 +563,6 @@ extern "C" {
     pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
 }
 
-cfg_if! {
-    if #[cfg(any(target_arch = "x86_64",
-                 target_arch = "aarch64",
-                 target_arch = "riscv64"))] {
-        mod b64;
-        pub use self::b64::*;
-    }
-}
-
 cfg_if! {
     if #[cfg(target_arch = "x86_64")] {
         mod x86_64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
deleted file mode 100644
index 80c6fa1684530..0000000000000
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-#[repr(C)]
-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
-pub struct stat {
-    pub st_dev: ::dev_t,
-    pub st_ino: ::ino_t,
-    pub st_nlink: ::nlink_t,
-    pub st_mode: ::mode_t,
-    st_padding0: i16,
-    pub st_uid: ::uid_t,
-    pub st_gid: ::gid_t,
-    st_padding1: i32,
-    pub st_rdev: ::dev_t,
-    pub st_atime: ::time_t,
-    pub st_atime_nsec: ::c_long,
-    pub st_mtime: ::time_t,
-    pub st_mtime_nsec: ::c_long,
-    pub st_ctime: ::time_t,
-    pub st_ctime_nsec: ::c_long,
-    pub st_birthtime: ::time_t,
-    pub st_birthtime_nsec: ::c_long,
-    pub st_size: ::off_t,
-    pub st_blocks: ::blkcnt_t,
-    pub st_blksize: ::blksize_t,
-    pub st_flags: ::fflags_t,
-    pub st_gen: u64,
-    pub st_spare: [u64; 10],
-}
-
-impl ::Copy for ::stat {}
-impl ::Clone for ::stat {
-    fn clone(&self) -> ::stat {
-        *self
-    }
-}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
index 9d65317d29cb4..e624dd7201b0a 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
@@ -228,6 +228,40 @@ s! {
         /// kthread flag.
         pub ki_tdflags: ::c_long,
     }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        st_padding0: i16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_padding1: i32,
+        pub st_rdev: ::dev_t,
+        #[cfg(target_arch = "x86")]
+        st_atim_ext: i32,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_mtim_ext: i32,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_ctim_ext: i32,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_btim_ext: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u64,
+        pub st_spare: [u64; 10],
+    }
 }
 
 s_no_extra_traits! {
@@ -529,15 +563,6 @@ extern "C" {
     pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
 }
 
-cfg_if! {
-    if #[cfg(any(target_arch = "x86_64",
-                 target_arch = "aarch64",
-                 target_arch = "riscv64"))] {
-        mod b64;
-        pub use self::b64::*;
-    }
-}
-
 cfg_if! {
     if #[cfg(target_arch = "x86_64")] {
         mod x86_64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
deleted file mode 100644
index 80c6fa1684530..0000000000000
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-#[repr(C)]
-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
-pub struct stat {
-    pub st_dev: ::dev_t,
-    pub st_ino: ::ino_t,
-    pub st_nlink: ::nlink_t,
-    pub st_mode: ::mode_t,
-    st_padding0: i16,
-    pub st_uid: ::uid_t,
-    pub st_gid: ::gid_t,
-    st_padding1: i32,
-    pub st_rdev: ::dev_t,
-    pub st_atime: ::time_t,
-    pub st_atime_nsec: ::c_long,
-    pub st_mtime: ::time_t,
-    pub st_mtime_nsec: ::c_long,
-    pub st_ctime: ::time_t,
-    pub st_ctime_nsec: ::c_long,
-    pub st_birthtime: ::time_t,
-    pub st_birthtime_nsec: ::c_long,
-    pub st_size: ::off_t,
-    pub st_blocks: ::blkcnt_t,
-    pub st_blksize: ::blksize_t,
-    pub st_flags: ::fflags_t,
-    pub st_gen: u64,
-    pub st_spare: [u64; 10],
-}
-
-impl ::Copy for ::stat {}
-impl ::Clone for ::stat {
-    fn clone(&self) -> ::stat {
-        *self
-    }
-}
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
index f76208400f324..a299af7d5d53e 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
@@ -228,6 +228,40 @@ s! {
         /// kthread flag.
         pub ki_tdflags: ::c_long,
     }
+
+    pub struct stat {
+        pub st_dev: ::dev_t,
+        pub st_ino: ::ino_t,
+        pub st_nlink: ::nlink_t,
+        pub st_mode: ::mode_t,
+        st_padding0: i16,
+        pub st_uid: ::uid_t,
+        pub st_gid: ::gid_t,
+        st_padding1: i32,
+        pub st_rdev: ::dev_t,
+        #[cfg(target_arch = "x86")]
+        st_atim_ext: i32,
+        pub st_atime: ::time_t,
+        pub st_atime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_mtim_ext: i32,
+        pub st_mtime: ::time_t,
+        pub st_mtime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_ctim_ext: i32,
+        pub st_ctime: ::time_t,
+        pub st_ctime_nsec: ::c_long,
+        #[cfg(target_arch = "x86")]
+        st_btim_ext: i32,
+        pub st_birthtime: ::time_t,
+        pub st_birthtime_nsec: ::c_long,
+        pub st_size: ::off_t,
+        pub st_blocks: ::blkcnt_t,
+        pub st_blksize: ::blksize_t,
+        pub st_flags: ::fflags_t,
+        pub st_gen: u64,
+        pub st_spare: [u64; 10],
+    }
 }
 
 s_no_extra_traits! {
@@ -529,15 +563,6 @@ extern "C" {
     pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
 }
 
-cfg_if! {
-    if #[cfg(any(target_arch = "x86_64",
-                 target_arch = "aarch64",
-                 target_arch = "riscv64"))] {
-        mod b64;
-        pub use self::b64::*;
-    }
-}
-
 cfg_if! {
     if #[cfg(target_arch = "x86_64")] {
         mod x86_64;
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs
index c3c576ed66681..31a660e7d0a22 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -42,31 +42,6 @@ s_no_extra_traits! {
 }
 
 s! {
-    pub struct stat {
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::fflags_t,
-        pub st_gen: u32,
-        pub st_lspare: i32,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-        __unused: [u8; 8],
-    }
-
     pub struct ucontext_t {
         pub uc_sigmask: ::sigset_t,
         pub uc_mcontext: ::mcontext_t,


From f381e010b2439579c9f548ef86fb06409c2c55d2 Mon Sep 17 00:00:00 2001
From: Alan Somers <asomers@gmail.com>
Date: Mon, 23 Sep 2024 16:03:48 -0600
Subject: [PATCH] fixup: fix build on powerpc, powerpc64, and arm

---
 src/unix/bsd/freebsdlike/freebsd/arm.rs       | 30 -------------------
 src/unix/bsd/freebsdlike/freebsd/powerpc.rs   | 26 ----------------
 src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 26 ----------------
 3 files changed, 82 deletions(-)

diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs
index 300b3dd45ca9d..8ff500c65981c 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs
@@ -6,36 +6,6 @@ pub type time_t = i64;
 pub type suseconds_t = i32;
 pub type register_t = i32;
 
-s! {
-    pub struct stat {
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_atime_pad: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_mtime_pad: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_ctime_pad: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::fflags_t,
-        pub st_gen: u32,
-        pub st_lspare: i32,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-        pub st_birthtime_pad: ::c_long,
-    }
-}
-
 // should be pub(crate), but that requires Rust 1.18.0
 cfg_if! {
     if #[cfg(libc_const_size_of)] {
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
index a0120c337e0ad..f84062ba34b93 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs
@@ -6,32 +6,6 @@ pub type time_t = i64;
 pub type suseconds_t = i32;
 pub type register_t = i32;
 
-s! {
-    pub struct stat {
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::fflags_t,
-        pub st_gen: u32,
-        pub st_lspare: i32,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-    }
-}
-
 // should be pub(crate), but that requires Rust 1.18.0
 cfg_if! {
     if #[cfg(libc_const_size_of)] {
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
index 7f5b9752264e3..69cf4c5fc88c7 100644
--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
+++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
@@ -6,32 +6,6 @@ pub type time_t = i64;
 pub type suseconds_t = i64;
 pub type register_t = i64;
 
-s! {
-    pub struct stat {
-        pub st_dev: ::dev_t,
-        pub st_ino: ::ino_t,
-        pub st_mode: ::mode_t,
-        pub st_nlink: ::nlink_t,
-        pub st_uid: ::uid_t,
-        pub st_gid: ::gid_t,
-        pub st_rdev: ::dev_t,
-        pub st_atime: ::time_t,
-        pub st_atime_nsec: ::c_long,
-        pub st_mtime: ::time_t,
-        pub st_mtime_nsec: ::c_long,
-        pub st_ctime: ::time_t,
-        pub st_ctime_nsec: ::c_long,
-        pub st_size: ::off_t,
-        pub st_blocks: ::blkcnt_t,
-        pub st_blksize: ::blksize_t,
-        pub st_flags: ::fflags_t,
-        pub st_gen: u32,
-        pub st_lspare: i32,
-        pub st_birthtime: ::time_t,
-        pub st_birthtime_nsec: ::c_long,
-    }
-}
-
 // should be pub(crate), but that requires Rust 1.18.0
 cfg_if! {
     if #[cfg(libc_const_size_of)] {