Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

24 lignes
542 B

  1. // Copyright 2014 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. // +build darwin dragonfly freebsd linux netbsd openbsd solaris
  5. package unix_test
  6. import (
  7. "testing"
  8. "golang.org/x/sys/unix"
  9. )
  10. func TestMmap(t *testing.T) {
  11. b, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)
  12. if err != nil {
  13. t.Fatalf("Mmap: %v", err)
  14. }
  15. if err := unix.Munmap(b); err != nil {
  16. t.Fatalf("Munmap: %v", err)
  17. }
  18. }