github.com/fiatjaf/generic-ristretto@v0.0.1/z/mmap_plan9.go (about) 1 /* 2 * Copyright 2020 Dgraph Labs, Inc. and Contributors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package z 18 19 import ( 20 "os" 21 "syscall" 22 ) 23 24 // Mmap uses the mmap system call to memory-map a file. If writable is true, 25 // memory protection of the pages is set so that they may be written to as well. 26 func mmap(fd *os.File, writable bool, size int64) ([]byte, error) { 27 return nil, syscall.EPLAN9 28 } 29 30 // Munmap unmaps a previously mapped slice. 31 func munmap(b []byte) error { 32 return syscall.EPLAN9 33 } 34 35 // Madvise uses the madvise system call to give advise about the use of memory 36 // when using a slice that is memory-mapped to a file. Set the readahead flag to 37 // false if page references are expected in random order. 38 func madvise(b []byte, readahead bool) error { 39 return syscall.EPLAN9 40 } 41 42 func msync(b []byte) error { 43 return syscall.EPLAN9 44 }