| 1 |
/* go-mmap.c -- functions for calling C mmap functions. |
| 2 |
|
| 3 |
Copyright 2023 The Go Authors. All rights reserved. |
| 4 |
Use of this source code is governed by a BSD-style |
| 5 |
license that can be found in the LICENSE file. */ |
| 6 |
|
| 7 |
#include "config.h" |
| 8 |
|
| 9 |
#include <stdint.h> |
| 10 |
#include <sys/mman.h> |
| 11 |
|
| 12 |
/* The exact C function to call varies between mmap and mmap64, and |
| 13 |
the size of the off_t argument also varies. Here we provide a |
| 14 |
function that Go code can call with consistent types. */ |
| 15 |
|
| 16 |
void * |
| 17 |
__go_mmap(void *addr, uintptr_t length, int32_t prot, int32_t flags, |
| 18 |
int32_t fd, uintptr_t offset) |
| 19 |
{ |
| 20 |
return mmap(addr, length, prot, flags, fd, offset); |
| 21 |
} |