Skip to content

Commit 8443c0f

Browse files
committed
Record reason for ccall-ing jl_mmap instead of mmap
1 parent 4e9e0d3 commit 8443c0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mmap.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ function _sys_mmap(ptr::Ptr{Cvoid}, len::Int,
4747
ArgumentError("requested size must be < $(typemax(Int)-PAGESIZE), got $len"))
4848
offset >= 0 || throw(ArgumentError("requested offset must be ≥ 0, got $offset"))
4949

50+
# N.B. mmap may be a C header macro to another name, so use Julia's wrapper (just as
51+
# Mmap.mmap does)
5052
ret = ccall(:jl_mmap, Ptr{Cvoid}, (Ptr{Cvoid}, Csize_t, Cint, Cint, RawFD, Int64),
5153
ptr, len, prot, flags, fd, offset)
5254
Base.systemerror("mmap", reinterpret(Int, ret) == -1)

0 commit comments

Comments
 (0)