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 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
17#ifndef ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_
18#define ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_
19
20#include <stddef.h>
21#include <sys/types.h>
22
24#define PROT_NONE 0x0
26#define PROT_READ 0x1
28#define PROT_WRITE 0x2
30#define PROT_EXEC 0x4
31
33#define MAP_SHARED 0x1
35#define MAP_PRIVATE 0x2
37#define MAP_FIXED 0x4
38
40#define MAP_ANONYMOUS 0x20
41
46#define MS_ASYNC 0x1
51#define MS_INVALIDATE 0x2
56#define MS_SYNC 0x4
57
59#define MAP_FAILED ((void *)-1)
60
62#define MCL_CURRENT 1
64#define MCL_FUTURE 2
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
78int mlock(const void *addr, size_t len);
79
87int mlockall(int flags);
88
101void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);
102
112int mprotect(void *addr, size_t len, int prot);
113
123int msync(void *addr, size_t length, int flags);
124
133int munlock(const void *addr, size_t len);
134
141int munlockall(void);
142
151int munmap(void *addr, size_t len);
152
162int shm_open(const char *name, int oflag, mode_t mode);
163
171int shm_unlink(const char *name);
172
173#ifdef __cplusplus
174}
175#endif
176
177#endif /* ZEPHYR_INCLUDE_ZEPHYR_POSIX_SYS_MMAN_H_ */
int mode_t
File permission bits type.
Definition fcntl.h:178
int munmap(void *addr, size_t len)
Unmap a previously mapped region.
void * mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
Map a file or device into memory.
int mprotect(void *addr, size_t len, int prot)
Change the protection of a memory mapping.
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.
int msync(void *addr, size_t length, int flags)
Synchronise a memory mapping with the underlying storage.
POSIX fundamental types (<sys/types.h>)