mmap_plan9.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. package z
  17. import (
  18. "os"
  19. "syscall"
  20. )
  21. // Mmap uses the mmap system call to memory-map a file. If writable is true,
  22. // memory protection of the pages is set so that they may be written to as well.
  23. func mmap(fd *os.File, writable bool, size int64) ([]byte, error) {
  24. return nil, syscall.EPLAN9
  25. }
  26. // Munmap unmaps a previously mapped slice.
  27. func munmap(b []byte) error {
  28. return syscall.EPLAN9
  29. }
  30. // Madvise uses the madvise system call to give advise about the use of memory
  31. // when using a slice that is memory-mapped to a file. Set the readahead flag to
  32. // false if page references are expected in random order.
  33. func madvise(b []byte, readahead bool) error {
  34. return syscall.EPLAN9
  35. }
  36. func msync(b []byte) error {
  37. return syscall.EPLAN9
  38. }