Skip to content

Commit 7986e17

Browse files
authored
Apple: fix bus error on smaller readonly file in unix (#55859)
Enables the fix for #28245 in #44354 for Apple now that the Julia bugs are fixed by #55641 and #55877. Closes #28245
1 parent 7e2d803 commit 7986e17

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

stdlib/Mmap/src/Mmap.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ function mmap(io::IO,
213213
szfile = convert(Csize_t, len + offset)
214214
requestedSizeLarger = false
215215
if !(io isa Mmap.Anonymous)
216-
@static if !Sys.isapple()
217-
requestedSizeLarger = szfile > filesize(io)
218-
end
216+
requestedSizeLarger = szfile > filesize(io)
219217
end
220218
# platform-specific mmapping
221219
@static if Sys.isunix()
@@ -231,9 +229,6 @@ function mmap(io::IO,
231229
throw(ArgumentError("unable to increase file size to $szfile due to read-only permissions"))
232230
end
233231
end
234-
@static if Sys.isapple()
235-
iswrite && grow && grow!(io, offset, len)
236-
end
237232
# mmap the file
238233
ptr = ccall(:jl_mmap, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Cint, Cint, RawFD, Int64),
239234
C_NULL, mmaplen, prot, flags, file_desc, offset_page)

0 commit comments

Comments
 (0)