diff --git a/stdlib/SharedArrays/src/SharedArrays.jl b/stdlib/SharedArrays/src/SharedArrays.jl index 1348a68dca9571..a961be4e534b36 100644 --- a/stdlib/SharedArrays/src/SharedArrays.jl +++ b/stdlib/SharedArrays/src/SharedArrays.jl @@ -693,9 +693,15 @@ function _shm_mmap_array(T, dims, shm_seg_name, mode) end shm_unlink(shm_seg_name) = ccall(:shm_unlink, Cint, (Cstring,), shm_seg_name) -shm_open(shm_seg_name, oflags, permissions) = ccall(:shm_open, Cint, - (Cstring, Cint, Base.Cmode_t), shm_seg_name, oflags, permissions) - +function shm_open(shm_seg_name, oflags, permissions) + # On macOS, `shm_open()` is a variadic function, so to properly match + # calling ABI, we must declare our arguments as variadic as well. + @static if Sys.isapple() + return ccall(:shm_open, Cint, (Cstring, Cint, Base.Cmode_t...), shm_seg_name, oflags, permissions) + else + return ccall(:shm_open, Cint, (Cstring, Cint, Base.Cmode_t), shm_seg_name, oflags, permissions) + end +end end # os-test end # module