mmap_plan9.go raw

   1  /*
   2   * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
   3   * SPDX-License-Identifier: Apache-2.0
   4   */
   5  
   6  package z
   7  
   8  import (
   9  	"os"
  10  	"syscall"
  11  )
  12  
  13  // Mmap uses the mmap system call to memory-map a file. If writable is true,
  14  // memory protection of the pages is set so that they may be written to as well.
  15  func mmap(fd *os.File, writable bool, size int64) ([]byte, error) {
  16  	return nil, syscall.EPLAN9
  17  }
  18  
  19  // Munmap unmaps a previously mapped slice.
  20  func munmap(b []byte) error {
  21  	return syscall.EPLAN9
  22  }
  23  
  24  // Madvise uses the madvise system call to give advise about the use of memory
  25  // when using a slice that is memory-mapped to a file. Set the readahead flag to
  26  // false if page references are expected in random order.
  27  func madvise(b []byte, readahead bool) error {
  28  	return syscall.EPLAN9
  29  }
  30  
  31  func msync(b []byte) error {
  32  	return syscall.EPLAN9
  33  }
  34