Add mmap and munmap to SysCalls

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-06-17 18:25:55 +00:00
committed by Compute-Runtime-Automation
parent 8523747f91
commit 3c1288de09
3 changed files with 22 additions and 0 deletions

View File

@ -40,6 +40,8 @@ constexpr unsigned long int invalidIoctl = static_cast<unsigned long int>(-1);
int setErrno = 0;
int fstatFuncRetVal = 0;
uint32_t preadFuncCalled = 0u;
uint32_t mmapFuncCalled = 0u;
uint32_t munmapFuncCalled = 0u;
int close(int fileDescriptor) {
closeFuncCalled++;
@ -137,5 +139,15 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
return 0;
}
void *mmap(void *addr, size_t size, int prot, int flags, int fd, off_t off) {
mmapFuncCalled++;
return 0;
}
int munmap(void *addr, size_t size) {
munmapFuncCalled++;
return 0;
}
} // namespace SysCalls
} // namespace NEO