mmap_plan9.go 856 B

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