about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unix/kernel_copy.rs
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2025-03-26 15:23:47 +0100
committerMads Marquart <mads@marquart.dk>2025-03-26 16:25:05 +0100
commita7bafc0afc3dba988a7bf85198c493b20523eaa0 (patch)
tree2a9a10286c82bd6a31ef625602c960e2b6f5f42e /library/std/src/sys/pal/unix/kernel_copy.rs
parent65899c06f117ddac9c8399479ddcdc122c92fddf (diff)
downloadrust-a7bafc0afc3dba988a7bf85198c493b20523eaa0.tar.gz
rust-a7bafc0afc3dba988a7bf85198c493b20523eaa0.zip
Change the syntax of the internal `weak!` macro
Change the syntax to include parameter names and a trailing semicolon.

Motivation:
- Mirror the `syscall!` macro.
- Allow rustfmt to format it (when wrapped in parentheses).
- For better documentation (having the parameter names available in
  the source code is a bit nicer).
- Allow future improvements to this macro where we can sometimes use the
  symbol directly when it's statically known to be available.
Diffstat (limited to 'library/std/src/sys/pal/unix/kernel_copy.rs')
-rw-r--r--library/std/src/sys/pal/unix/kernel_copy.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/std/src/sys/pal/unix/kernel_copy.rs b/library/std/src/sys/pal/unix/kernel_copy.rs
index bbf29f32523..d42a7e2a7fc 100644
--- a/library/std/src/sys/pal/unix/kernel_copy.rs
+++ b/library/std/src/sys/pal/unix/kernel_copy.rs
@@ -604,16 +604,16 @@ pub(super) fn copy_regular_files(reader: RawFd, writer: RawFd, max_len: u64) ->
         _ => true,
     };
 
-    syscall! {
+    syscall!(
         fn copy_file_range(
             fd_in: libc::c_int,
             off_in: *mut libc::loff_t,
             fd_out: libc::c_int,
             off_out: *mut libc::loff_t,
             len: libc::size_t,
-            flags: libc::c_uint
-        ) -> libc::ssize_t
-    }
+            flags: libc::c_uint,
+        ) -> libc::ssize_t;
+    );
 
     fn probe_copy_file_range_support() -> u8 {
         // In some cases, we cannot determine availability from the first
@@ -727,16 +727,16 @@ fn sendfile_splice(mode: SpliceMode, reader: RawFd, writer: RawFd, len: u64) ->
     // Android builds use feature level 14, but the libc wrapper for splice is
     // gated on feature level 21+, so we have to invoke the syscall directly.
     #[cfg(target_os = "android")]
-    syscall! {
+    syscall!(
         fn splice(
             srcfd: libc::c_int,
             src_offset: *const i64,
             dstfd: libc::c_int,
             dst_offset: *const i64,
             len: libc::size_t,
-            flags: libc::c_int
-        ) -> libc::ssize_t
-    }
+            flags: libc::c_int,
+        ) -> libc::ssize_t;
+    );
 
     #[cfg(target_os = "linux")]
     use libc::splice;