From 01a36171f2aa7e523dca7c632293f2c95f892eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Fri, 24 May 2024 19:56:35 +0000 Subject: [PATCH] Unify the ioctl declarations on linux This uses the existing Ioctl type to reduce the duplication. --- src/unix/linux_like/linux/gnu/mod.rs | 1 - src/unix/linux_like/linux/mod.rs | 2 ++ src/unix/linux_like/linux/musl/mod.rs | 1 - src/unix/linux_like/linux/uclibc/mod.rs | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 6d5deb6b24abd..1f742a7d88ee1 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -1396,7 +1396,6 @@ extern "C" { pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; - pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; pub fn glob64( pattern: *const ::c_char, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index ba68965174c09..2ce09ed168df8 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -6125,6 +6125,8 @@ extern "C" { ) -> ::ssize_t; pub fn klogctl(syslog_type: ::c_int, bufp: *mut ::c_char, len: ::c_int) -> ::c_int; + + pub fn ioctl(fd: ::c_int, request: ::Ioctl, ...) -> ::c_int; } // LFS64 extensions diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index f8a7a62b17d79..1a93c39fd3a0a 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -843,7 +843,6 @@ extern "C" { new_limit: *const ::rlimit, old_limit: *mut ::rlimit, ) -> ::c_int; - pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; pub fn ptrace(request: ::c_int, ...) -> ::c_long; pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index b3c126963e090..a8b6c6e763c18 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -353,7 +353,6 @@ pub const UDP_SEGMENT: ::c_int = 103; pub const YESEXPR: ::c_int = ((5) << 8) | (0); extern "C" { - pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; pub fn pthread_rwlockattr_getkind_np(