2020-02-06 00:43:02 +08:00
|
|
|
/*
|
2023-02-14 23:03:52 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-02-06 00:43:02 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-07-09 01:19:43 +08:00
|
|
|
#include "shared/source/os_interface/sys_calls_common.h"
|
|
|
|
|
2023-03-09 06:15:36 +08:00
|
|
|
#include <dirent.h>
|
2021-02-18 05:17:01 +08:00
|
|
|
#include <iostream>
|
2021-04-02 22:19:00 +08:00
|
|
|
#include <poll.h>
|
2021-06-18 02:25:55 +08:00
|
|
|
#include <sys/mman.h>
|
2021-03-29 20:01:37 +08:00
|
|
|
#include <sys/stat.h>
|
2021-02-18 05:17:01 +08:00
|
|
|
|
2020-02-06 00:43:02 +08:00
|
|
|
namespace NEO {
|
|
|
|
namespace SysCalls {
|
|
|
|
int close(int fileDescriptor);
|
2020-02-07 21:32:02 +08:00
|
|
|
int open(const char *file, int flags);
|
2023-03-09 06:15:36 +08:00
|
|
|
int openWithMode(const char *file, int flags, int mode);
|
2021-02-23 21:03:54 +08:00
|
|
|
void *dlopen(const char *filename, int flag);
|
2020-02-13 20:26:40 +08:00
|
|
|
int ioctl(int fileDescriptor, unsigned long int request, void *arg);
|
2021-02-18 05:17:01 +08:00
|
|
|
int getDevicePath(int deviceFd, char *buf, size_t &bufSize);
|
|
|
|
int access(const char *pathname, int mode);
|
|
|
|
int readlink(const char *path, char *buf, size_t bufsize);
|
2021-04-02 22:19:00 +08:00
|
|
|
int poll(struct pollfd *pollFd, unsigned long int numberOfFds, int timeout);
|
2021-03-29 20:01:37 +08:00
|
|
|
int fstat(int fd, struct stat *buf);
|
2021-05-28 00:41:47 +08:00
|
|
|
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
|
2021-08-27 01:35:15 +08:00
|
|
|
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
|
2023-03-22 22:32:27 +08:00
|
|
|
void *mmap(void *addr, size_t size, int prot, int flags, int fd, off_t off) noexcept;
|
|
|
|
int munmap(void *addr, size_t size) noexcept;
|
2022-03-02 14:59:39 +08:00
|
|
|
ssize_t read(int fd, void *buf, size_t count);
|
2023-03-28 03:43:26 +08:00
|
|
|
ssize_t write(int fd, void *buf, size_t count);
|
2022-10-28 17:25:16 +08:00
|
|
|
int fcntl(int fd, int cmd);
|
|
|
|
int fcntl(int fd, int cmd, int arg);
|
2023-02-14 23:03:52 +08:00
|
|
|
char *realpath(const char *path, char *buf);
|
2023-03-09 06:15:36 +08:00
|
|
|
int stat(const std::string &filePath, struct stat *statbuf);
|
2023-03-28 03:43:26 +08:00
|
|
|
int pipe(int pipefd[2]);
|
2023-03-09 06:15:36 +08:00
|
|
|
int flock(int fd, int flag);
|
|
|
|
int mkstemp(char *filePath);
|
|
|
|
int rename(const char *currName, const char *dstName);
|
|
|
|
int scandir(const char *dirp,
|
|
|
|
struct dirent ***namelist,
|
|
|
|
int (*filter)(const struct dirent *),
|
|
|
|
int (*compar)(const struct dirent **,
|
|
|
|
const struct dirent **));
|
|
|
|
int unlink(const std::string &pathname);
|
2020-02-07 21:32:02 +08:00
|
|
|
} // namespace SysCalls
|
2020-02-06 00:43:02 +08:00
|
|
|
} // namespace NEO
|