-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemoryLock.hpp
More file actions
33 lines (27 loc) · 901 Bytes
/
MemoryLock.hpp
File metadata and controls
33 lines (27 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************************************
* libunix++: C++ wrapper for Linux system calls
* Memory locking operations
*
* © 2019—2021, Sauron <libunixpp@saur0n.science>
******************************************************************************/
#ifndef __UNIXPP_MEMORYLOCK_HPP
#define __UNIXPP_MEMORYLOCK_HPP
#include "MemoryRegion.hpp"
#include <sys/mman.h>
namespace upp {
/**/
class MemoryLock : public MemoryRegion {
public:
/** Lock an area of memory **/
MemoryLock(void * addr, size_t length);
/** Lock an area of memory **/
MemoryLock(void * addr, size_t length, int flags);
/** Unlock the area of memory **/
~MemoryLock();
/** Lock all the virtual address space into RAM **/
static void lockAll(int flags=0);
/** Unlock all the virtual address space **/
static void unlockAll();
};
}
#endif