@@ -9,7 +9,8 @@ use crate::backend::c;
99#[ cfg( target_arch = "x86" ) ]
1010use crate :: backend:: conv:: by_mut;
1111use crate :: backend:: conv:: {
12- by_ref, c_int, c_uint, ret, ret_c_int, ret_c_int_infallible, ret_error, size_of, zero,
12+ by_ref, c_int, c_uint, ret, ret_c_int, ret_c_int_infallible, ret_error, ret_void_star, size_of,
13+ zero,
1314} ;
1415#[ cfg( feature = "fs" ) ]
1516use crate :: fd:: BorrowedFd ;
@@ -22,6 +23,7 @@ use crate::runtime::{How, Sigaction, Siginfo, Sigset, Stack};
2223use crate :: signal:: Signal ;
2324use crate :: timespec:: Timespec ;
2425use crate :: utils:: option_as_ptr;
26+ use core:: ffi:: c_void;
2527use core:: mem:: MaybeUninit ;
2628#[ cfg( target_pointer_width = "32" ) ]
2729use linux_raw_sys:: general:: __kernel_old_timespec;
@@ -263,3 +265,9 @@ unsafe fn sigtimedwait_old(
263265pub ( crate ) fn exit_group ( code : c:: c_int ) -> ! {
264266 unsafe { syscall_noreturn ! ( __NR_exit_group, c_int( code) ) }
265267}
268+
269+ #[ inline]
270+ pub ( crate ) unsafe fn brk ( addr : * mut c:: c_void ) -> io:: Result < * mut c_void > {
271+ // Don't mark this `readonly`, so that loads don't get reordered past it.
272+ ret_void_star ( syscall ! ( __NR_brk, addr) )
273+ }
0 commit comments