Skip to content

Commit ea3cd02

Browse files
committed
Auto merge of #27762 - alexcrichton:fix-libc, r=aturon
The corrected signature of `ioctl` broke some crates on crates.io, and it's not currently worth the major version bump of libc, so for now keep the old signature around for crates.io builds only with a comment to remove it at a future date. This should allow libc on crates.io to update to the master version in-tree. I've verified that this was the only breakage of substance between the version libc is currently built with and today's master branch.
2 parents 2da80ef + 872f8c3 commit ea3cd02

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/liblibc/lib.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -6263,11 +6263,22 @@ pub mod funcs {
62636263
#[cfg(any(target_os = "linux", target_os = "android"))]
62646264
pub mod bsd44 {
62656265
use types::common::c95::{c_void};
6266-
use types::os::arch::c95::{c_uchar, c_int, c_ulong, size_t};
6266+
use types::os::arch::c95::{c_uchar, c_int, size_t};
6267+
#[cfg(not(feature = "cargo-build"))]
6268+
use types::os::arch::c95::c_ulong;
62676269

62686270
extern {
62696271
#[cfg(not(all(target_os = "android", target_arch = "aarch64")))]
62706272
pub fn getdtablesize() -> c_int;
6273+
6274+
// Note that the correct signature of ioctl broke some crates on
6275+
// crates.io, so for now we keep the broken signature for crates.io
6276+
// but we fix it locally in the main Rust distribution. Once a new
6277+
// major version of libc is released on crates.io this #[cfg] should
6278+
// go away.
6279+
#[cfg(feature = "cargo-build")]
6280+
pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int;
6281+
#[cfg(not(feature = "cargo-build"))]
62716282
pub fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int;
62726283
pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
62736284
-> c_int;

0 commit comments

Comments
 (0)