Brad Fitzpatrick | 5194744 | 2016-03-01 22:57:46 +0000 | [diff] [blame] | 1 | // Copyright 2015 The Go Authors. All rights reserved. |
Ian Lance Taylor | 0c1f054 | 2015-09-29 21:24:13 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // +build !plan9 |
| 6 | // +build !solaris |
| 7 | // +build !windows |
| 8 | // +build !nacl |
| 9 | // +build !linux !amd64 |
Fangming.Fang | e8d417d | 2018-04-08 07:32:43 +0000 | [diff] [blame] | 10 | // +build !linux !arm64 |
Richard Musiol | 35ea624 | 2018-03-31 23:14:17 +0200 | [diff] [blame] | 11 | // +build !js |
Elias Naur | c8d0729 | 2018-05-01 10:48:19 +0200 | [diff] [blame] | 12 | // +build !darwin |
Ian Lance Taylor | 0c1f054 | 2015-09-29 21:24:13 -0700 | [diff] [blame] | 13 | |
| 14 | package runtime |
| 15 | |
| 16 | import "unsafe" |
| 17 | |
Brad Fitzpatrick | 5fea2cc | 2016-03-01 23:21:55 +0000 | [diff] [blame] | 18 | // mmap calls the mmap system call. It is implemented in assembly. |
Jeremy Jackins | 02b8e69 | 2016-04-13 18:16:21 +0900 | [diff] [blame] | 19 | // We only pass the lower 32 bits of file offset to the |
| 20 | // assembly routine; the higher bits (if required), should be provided |
| 21 | // by the assembly routine as 0. |
Austin Clements | 193088b | 2017-10-16 20:28:29 -0400 | [diff] [blame] | 22 | // The err result is an OS error code such as ENOMEM. |
| 23 | func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int) |
Ian Lance Taylor | f425f54 | 2017-06-06 15:08:59 -0700 | [diff] [blame] | 24 | |
| 25 | // munmap calls the munmap system call. It is implemented in assembly. |
| 26 | func munmap(addr unsafe.Pointer, n uintptr) |