Source file src/crypto/internal/entropy/scratch/scratch_unix.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build unix && !linux
     6  
     7  package scratch
     8  
     9  import "syscall"
    10  
    11  func mmap(n int) ([]byte, error) {
    12  	return syscall.Mmap(-1, 0, n, syscall.PROT_READ|syscall.PROT_WRITE,
    13  		syscall.MAP_ANON|syscall.MAP_PRIVATE)
    14  }
    15  
    16  func munmap(b []byte) {
    17  	syscall.Munmap(b)
    18  }
    19  

View as plain text