mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Improve coverage in Fs Access
- Added ULTS to improve the code coverage in fs_access. - Used the shared functions in the ULTs. - Added the function for pwrite in the shared code. Related-To: LOCI-2117 Signed-off-by: Bari, Pratik <pratik.bari@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
52f21464cd
commit
b161af5886
@@ -55,6 +55,7 @@ uint32_t munmapFuncCalled = 0u;
|
||||
|
||||
int (*sysCallsOpen)(const char *pathname, int flags) = nullptr;
|
||||
ssize_t (*sysCallsPread)(int fd, void *buf, size_t count, off_t offset) = nullptr;
|
||||
ssize_t (*sysCallsPwrite)(int fd, const void *buf, size_t count, off_t offset) = nullptr;
|
||||
int (*sysCallsReadlink)(const char *path, char *buf, size_t bufsize) = nullptr;
|
||||
int (*sysCallsIoctl)(int fileDescriptor, unsigned long int request, void *arg) = nullptr;
|
||||
int (*sysCallsPoll)(struct pollfd *pollFd, unsigned long int numberOfFds, int timeout) = nullptr;
|
||||
@@ -189,6 +190,9 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
|
||||
}
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) {
|
||||
if (sysCallsPwrite != nullptr) {
|
||||
return sysCallsPwrite(fd, buf, count, offset);
|
||||
}
|
||||
pwriteFuncCalled++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace SysCalls {
|
||||
|
||||
extern int (*sysCallsOpen)(const char *pathname, int flags);
|
||||
extern ssize_t (*sysCallsPread)(int fd, void *buf, size_t count, off_t offset);
|
||||
extern ssize_t (*sysCallsPwrite)(int fd, const void *buf, size_t count, off_t offset);
|
||||
extern int (*sysCallsReadlink)(const char *path, char *buf, size_t bufsize);
|
||||
extern int (*sysCallsIoctl)(int fileDescriptor, unsigned long int request, void *arg);
|
||||
extern int (*sysCallsPoll)(struct pollfd *pollFd, unsigned long int numberOfFds, int timeout);
|
||||
|
||||
Reference in New Issue
Block a user