Skip to content

Commit 53db662

Browse files
authored
Merge pull request #4091 from tgross35/backport-scallion
[0.2] Backports
2 parents 78d6dcb + 4f2cde3 commit 53db662

File tree

22 files changed

+90
-29
lines changed

22 files changed

+90
-29
lines changed

libc-test/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ fn test_android(target: &str) {
20752075
"__system_property_wait" => true,
20762076

20772077
// Added in API level 30, but tests use level 28.
2078-
"mlock2" => true,
2078+
"memfd_create" | "mlock2" | "renameat2" | "statx" | "statx_timestamp" => true,
20792079

20802080
// Added in glibc 2.25.
20812081
"getentropy" => true,

libc-test/semver/android.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,6 +3469,7 @@ memalign
34693469
memchr
34703470
memcmp
34713471
memcpy
3472+
memfd_create
34723473
memmem
34733474
memmove
34743475
memrchr
@@ -3484,6 +3485,7 @@ mknodat
34843485
mkstemp
34853486
mktime
34863487
mlock
3488+
mlock2
34873489
mlockall
34883490
mmap
34893491
mmap64
@@ -3672,6 +3674,7 @@ remove
36723674
removexattr
36733675
rename
36743676
renameat
3677+
renameat2
36753678
res_init
36763679
rewind
36773680
rewinddir
@@ -3797,6 +3800,8 @@ statfs
37973800
statfs64
37983801
statvfs
37993802
statvfs64
3803+
statx
3804+
statx_timestamp
38003805
strcasecmp
38013806
strcasestr
38023807
strcat

libc-test/semver/unix.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ accept
453453
access
454454
addrinfo
455455
alarm
456+
aligned_alloc
456457
atexit
457458
atof
458459
atoi

src/fuchsia/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ s! {
382382
}
383383

384384
pub struct fd_set {
385-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
385+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
386386
}
387387

388388
pub struct tm {

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ cfg_if! {
4646
#[allow(unused_imports)]
4747
use core::clone::Clone;
4848
#[allow(unused_imports)]
49+
use core::ffi;
50+
#[allow(unused_imports)]
4951
use core::fmt;
5052
#[allow(unused_imports)]
5153
use core::hash;

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ macro_rules! s_paren {
9898
($(
9999
$(#[$attr:meta])*
100100
pub struct $i:ident ( $($field:tt)* );
101-
)* ) => ($(
101+
)*) => ($(
102102
__item! {
103103
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
104104
#[derive(Copy, Clone)]

src/unix/aix/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub type posix_spawn_file_actions_t = *mut ::c_char;
6060
pub type iconv_t = *mut ::c_void;
6161

6262
e! {
63+
#[repr(u32)]
6364
pub enum uio_rw {
6465
UIO_READ = 0,
6566
UIO_WRITE,
@@ -573,7 +574,7 @@ cfg_if! {
573574
}
574575
impl Eq for __sigaction_sa_union {}
575576
impl ::fmt::Debug for __sigaction_sa_union {
576-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
577+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
577578
f.debug_struct("__sigaction_sa_union")
578579
.field("__su_handler", unsafe { &self.__su_handler })
579580
.field("__su_sigaction", unsafe { &self.__su_sigaction })
@@ -598,7 +599,7 @@ cfg_if! {
598599
}
599600
impl Eq for sigaction {}
600601
impl ::fmt::Debug for sigaction {
601-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
602+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
602603
f.debug_struct("sigaction")
603604
.field("sa_union", &self.sa_union)
604605
.field("sa_mask", &self.sa_mask)
@@ -625,7 +626,7 @@ cfg_if! {
625626
}
626627
impl Eq for __poll_ctl_ext_u {}
627628
impl ::fmt::Debug for __poll_ctl_ext_u {
628-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
629+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
629630
f.debug_struct("__poll_ctl_ext_u")
630631
.field("addr", unsafe { &self.addr })
631632
.field("data32", unsafe { &self.data32 })
@@ -655,7 +656,7 @@ cfg_if! {
655656
}
656657
impl Eq for poll_ctl_ext {}
657658
impl ::fmt::Debug for poll_ctl_ext {
658-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
659+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
659660
f.debug_struct("poll_ctl_ext")
660661
.field("version", &self.version)
661662
.field("command", &self.command)

src/unix/aix/powerpc64.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ cfg_if! {
307307
}
308308
impl Eq for siginfo_t {}
309309
impl ::fmt::Debug for siginfo_t {
310-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
310+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
311311
f.debug_struct("siginfo_t")
312312
.field("si_signo", &self.si_signo)
313313
.field("si_errno", &self.si_errno)
@@ -347,7 +347,7 @@ cfg_if! {
347347
}
348348
impl Eq for _kernel_simple_lock {}
349349
impl ::fmt::Debug for _kernel_simple_lock {
350-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
350+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
351351
f.debug_struct("_kernel_simple_lock")
352352
.field("_slock", unsafe { &self._slock })
353353
.field("_slockp", unsafe { &self._slockp })
@@ -410,12 +410,12 @@ cfg_if! {
410410
&& self.f_fnamep == other.f_fnamep
411411
&& self.f_fdata == other.f_fdata
412412
&& self.f_lock == other.f_lock
413-
&& self.f_offset_lock == other.f_offset_lock;
413+
&& self.f_offset_lock == other.f_offset_lock
414414
}
415415
}
416416
impl Eq for file {}
417417
impl ::fmt::Debug for file {
418-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
418+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
419419
f.debug_struct("file")
420420
.field("f_flag", &self.f_flag)
421421
.field("f_count", &self.f_count)
@@ -466,7 +466,7 @@ cfg_if! {
466466
}
467467
impl Eq for __ld_info_file {}
468468
impl ::fmt::Debug for __ld_info_file {
469-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
469+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
470470
f.debug_struct("__ld_info_file")
471471
.field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
472472
.field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
@@ -498,7 +498,7 @@ cfg_if! {
498498
}
499499
impl Eq for ld_info {}
500500
impl ::fmt::Debug for ld_info {
501-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
501+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
502502
f.debug_struct("ld_info")
503503
.field("ldinfo_next", &self.ldinfo_next)
504504
.field("ldinfo_flags", &self.ldinfo_flags)
@@ -535,7 +535,7 @@ cfg_if! {
535535
}
536536
impl Eq for __pollfd_ext_u {}
537537
impl ::fmt::Debug for __pollfd_ext_u {
538-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
538+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
539539
f.debug_struct("__pollfd_ext_u")
540540
.field("addr", unsafe { &self.addr })
541541
.field("data32", unsafe { &self.data32 })
@@ -563,7 +563,7 @@ cfg_if! {
563563
}
564564
impl Eq for pollfd_ext {}
565565
impl ::fmt::Debug for pollfd_ext {
566-
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
566+
fn fmt(&self, f: &mut ::fmt::Formatter<'_>) -> ::fmt::Result {
567567
f.debug_struct("pollfd_ext")
568568
.field("fd", &self.fd)
569569
.field("events", &self.events)

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ s_no_extra_traits! {
15951595
_os_unfair_lock_opaque: u32,
15961596
}
15971597

1598-
#[repr(packed(1))]
1598+
#[repr(packed(1))]
15991599
pub struct sockaddr_vm {
16001600
pub svm_len: ::c_uchar,
16011601
pub svm_family: ::sa_family_t,
@@ -1722,8 +1722,7 @@ cfg_if! {
17221722
}
17231723
impl Eq for semun {}
17241724
impl ::fmt::Debug for semun {
1725-
fn fmt(&self, f: &mut ::fmt::Formatter)
1726-
-> ::fmt::Result {
1725+
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
17271726
f.debug_struct("semun")
17281727
.field("val", unsafe { &self.val })
17291728
.finish()
@@ -1775,7 +1774,6 @@ cfg_if! {
17751774
&& self.udata == other.udata
17761775
}
17771776
}
1778-
17791777
impl Eq for kevent {}
17801778
impl ::fmt::Debug for kevent {
17811779
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {

src/unix/bsd/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ s! {
6060
pub struct fd_set {
6161
#[cfg(all(target_pointer_width = "64",
6262
any(target_os = "freebsd", target_os = "dragonfly")))]
63-
fds_bits: [i64; FD_SETSIZE / 64],
63+
fds_bits: [i64; FD_SETSIZE as usize / 64],
6464
#[cfg(not(all(target_pointer_width = "64",
6565
any(target_os = "freebsd", target_os = "dragonfly"))))]
66-
fds_bits: [i32; FD_SETSIZE / 32],
66+
fds_bits: [i32; FD_SETSIZE as usize / 32],
6767
}
6868

6969
pub struct tm {
@@ -129,7 +129,7 @@ s_no_extra_traits! {
129129
pub struct sockaddr_un {
130130
pub sun_len: u8,
131131
pub sun_family: sa_family_t,
132-
pub sun_path: [c_char; 104]
132+
pub sun_path: [::c_char; 104]
133133
}
134134

135135
pub struct utsname {

0 commit comments

Comments
 (0)