From b7e8d3947175a08a9e20bdf9c2e8d76f568a82aa Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 24 Sep 2024 11:34:11 -0400 Subject: [PATCH] Apple: fix bus error on smaller readonly file in unix Enables the fix for #28245 in #44354 for Apple now that the Julia bug is fixed by #55641. Closes #28245 --- stdlib/Mmap/src/Mmap.jl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stdlib/Mmap/src/Mmap.jl b/stdlib/Mmap/src/Mmap.jl index df2f4f1a19991b..7d57bf053940d4 100644 --- a/stdlib/Mmap/src/Mmap.jl +++ b/stdlib/Mmap/src/Mmap.jl @@ -213,9 +213,7 @@ function mmap(io::IO, szfile = convert(Csize_t, len + offset) requestedSizeLarger = false if !(io isa Mmap.Anonymous) - @static if !Sys.isapple() - requestedSizeLarger = szfile > filesize(io) - end + requestedSizeLarger = szfile > filesize(io) end # platform-specific mmapping @static if Sys.isunix() @@ -231,9 +229,6 @@ function mmap(io::IO, throw(ArgumentError("unable to increase file size to $szfile due to read-only permissions")) end end - @static if Sys.isapple() - iswrite && grow && grow!(io, offset, len) - end # mmap the file ptr = ccall(:jl_mmap, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Cint, Cint, RawFD, Int64), C_NULL, mmaplen, prot, flags, file_desc, offset_page)