Skip to content

Commit de6475f

Browse files
committed
Added missing mmap messages
1 parent 50fef82 commit de6475f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/ImageBuildtimePosixSupport.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,48 @@ final int system(Object command,
602602
return nativeLib.system(nativePosixSupport, command);
603603
}
604604

605+
@ExportMessage
606+
final Object mmap(long length, int prot, int flags, int fd, long offset,
607+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
608+
checkNotInImageBuildtime();
609+
return nativeLib.mmap(nativePosixSupport, length, prot, flags, fd, offset);
610+
}
611+
612+
@ExportMessage
613+
final byte mmapReadByte(Object mmap, long index,
614+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
615+
checkNotInImageBuildtime();
616+
return nativeLib.mmapReadByte(nativePosixSupport, mmap, index);
617+
}
618+
619+
@ExportMessage
620+
final int mmapReadBytes(Object mmap, long index, byte[] bytes, int length,
621+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
622+
checkNotInImageBuildtime();
623+
return nativeLib.mmapReadBytes(nativePosixSupport, mmap, index, bytes, length);
624+
}
625+
626+
@ExportMessage
627+
final void mmapWriteBytes(Object mmap, long index, byte[] bytes, int length,
628+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
629+
checkNotInImageBuildtime();
630+
nativeLib.mmapWriteBytes(nativePosixSupport, mmap, index, bytes, length);
631+
}
632+
633+
@ExportMessage
634+
final void mmapFlush(Object mmap, long offset, long length,
635+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
636+
checkNotInImageBuildtime();
637+
nativeLib.mmapFlush(nativePosixSupport, mmap, offset, length);
638+
}
639+
640+
@ExportMessage
641+
final void mmapUnmap(Object mmap, long length,
642+
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) throws PosixException {
643+
checkNotInImageBuildtime();
644+
nativeLib.mmapUnmap(nativePosixSupport, mmap, length);
645+
}
646+
605647
@ExportMessage
606648
final Object createPathFromString(String path,
607649
@CachedLibrary("this.nativePosixSupport") PosixSupportLibrary nativeLib) {

0 commit comments

Comments
 (0)