Skip to content

Commit

Permalink
Apple: fix bus error on smaller readonly file in unix
Browse files Browse the repository at this point in the history
Enables the fix for #28245 in #44354 for Apple now that the Julia bug is
fixed by #55641.

Closes #28245
  • Loading branch information
vtjnash committed Sep 26, 2024
1 parent ec8d193 commit f85e5e7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions stdlib/Mmap/src/Mmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit f85e5e7

Please sign in to comment.