posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
mman.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024, Tenstorrent AI ULC
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
18#ifndef ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_
19#define ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_
20
21#include <stddef.h>
22#include <sys/types.h>
23
25#define PROT_NONE 0x0
27#define PROT_READ 0x1
29#define PROT_WRITE 0x2
31#define PROT_EXEC 0x4
32
34#define MAP_SHARED 0x1
36#define MAP_PRIVATE 0x2
38#define MAP_FIXED 0x4
39
41#define MAP_ANONYMOUS 0x20
42
44#define MS_SYNC 0x0
46#define MS_ASYNC 0x1
48#define MS_INVALIDATE 0x2
49
51#define MAP_FAILED ((void *)-1)
52
54#define MCL_CURRENT 0
56#define MCL_FUTURE 1
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
70int mlock(const void *addr, size_t len);
71
79int mlockall(int flags);
80
93void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);
94
104int msync(void *addr, size_t length, int flags);
105
114int munlock(const void *addr, size_t len);
115
122int munlockall(void);
123
132int munmap(void *addr, size_t len);
133
143int shm_open(const char *name, int oflag, mode_t mode);
144
152int shm_unlink(const char *name);
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_ */
int mode_t
File permission bits type.
Definition fcntl.h:178
long off_t
File offset type.
Definition aio.h:36
int munmap(void *addr, size_t len)
Unmap a previously mapped region.
int msync(void *addr, size_t length, int flags)
Synchronise a memory mapping with the underlying storage.
void * mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
Map a file or device into memory.
int mlock(const void *addr, size_t len)
Lock a range of the calling process's address space into memory.
int munlock(const void *addr, size_t len)
Unlock a range of the calling process's address space.
int munlockall(void)
Unlock all memory locked by the calling process.
int mlockall(int flags)
Lock all current and/or future memory mappings of the calling process.
int shm_open(const char *name, int oflag, mode_t mode)
Open or create a shared memory object.
int shm_unlink(const char *name)
Remove a shared memory object.
POSIX fundamental types (<sys/types.h>)