10d163575Sopenharmony_ci/*
20d163575Sopenharmony_ci * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
30d163575Sopenharmony_ci * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved.
40d163575Sopenharmony_ci *
50d163575Sopenharmony_ci * Redistribution and use in source and binary forms, with or without modification,
60d163575Sopenharmony_ci * are permitted provided that the following conditions are met:
70d163575Sopenharmony_ci *
80d163575Sopenharmony_ci * 1. Redistributions of source code must retain the above copyright notice, this list of
90d163575Sopenharmony_ci *    conditions and the following disclaimer.
100d163575Sopenharmony_ci *
110d163575Sopenharmony_ci * 2. Redistributions in binary form must reproduce the above copyright notice, this list
120d163575Sopenharmony_ci *    of conditions and the following disclaimer in the documentation and/or other materials
130d163575Sopenharmony_ci *    provided with the distribution.
140d163575Sopenharmony_ci *
150d163575Sopenharmony_ci * 3. Neither the name of the copyright holder nor the names of its contributors may be used
160d163575Sopenharmony_ci *    to endorse or promote products derived from this software without specific prior written
170d163575Sopenharmony_ci *    permission.
180d163575Sopenharmony_ci *
190d163575Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
200d163575Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
210d163575Sopenharmony_ci * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
220d163575Sopenharmony_ci * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
230d163575Sopenharmony_ci * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
240d163575Sopenharmony_ci * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
250d163575Sopenharmony_ci * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
260d163575Sopenharmony_ci * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
270d163575Sopenharmony_ci * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
280d163575Sopenharmony_ci * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
290d163575Sopenharmony_ci * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
300d163575Sopenharmony_ci */
310d163575Sopenharmony_ci
320d163575Sopenharmony_ci#ifndef _LOS_SYSCALL_H
330d163575Sopenharmony_ci#define _LOS_SYSCALL_H
340d163575Sopenharmony_ci
350d163575Sopenharmony_ci#include <sys/statfs.h>
360d163575Sopenharmony_ci#include "los_typedef.h"
370d163575Sopenharmony_ci#include "los_task.h"
380d163575Sopenharmony_ci#include "los_mux.h"
390d163575Sopenharmony_ci#include "los_signal.h"
400d163575Sopenharmony_ci#include "syscall.h"
410d163575Sopenharmony_ci#include "sysinfo.h"
420d163575Sopenharmony_ci#include "time_posix.h"
430d163575Sopenharmony_ci#ifdef LOSCFG_KERNEL_DYNLOAD
440d163575Sopenharmony_ci#include "los_exec_elf.h"
450d163575Sopenharmony_ci#endif
460d163575Sopenharmony_ci#include "sys/resource.h"
470d163575Sopenharmony_ci#include "sys/times.h"
480d163575Sopenharmony_ci#include "sys/utsname.h"
490d163575Sopenharmony_ci#include "sys/shm.h"
500d163575Sopenharmony_ci#include "poll.h"
510d163575Sopenharmony_ci#include "utime.h"
520d163575Sopenharmony_ci#ifdef LOSCFG_COMPAT_POSIX
530d163575Sopenharmony_ci#include "mqueue.h"
540d163575Sopenharmony_ci#endif
550d163575Sopenharmony_ci#include "time.h"
560d163575Sopenharmony_ci#include "sys/time.h"
570d163575Sopenharmony_ci#include "sys/stat.h"
580d163575Sopenharmony_ci#include "sys/kstat.h"
590d163575Sopenharmony_ci#ifdef LOSCFG_FS_VFS
600d163575Sopenharmony_ci#include "sys/socket.h"
610d163575Sopenharmony_ci#include "dirent.h"
620d163575Sopenharmony_ci#include "fs/file.h"
630d163575Sopenharmony_ci#include "epoll.h"
640d163575Sopenharmony_ci#endif
650d163575Sopenharmony_ci#include <sys/wait.h>
660d163575Sopenharmony_ci#ifdef LOSCFG_FS_VFS
670d163575Sopenharmony_ci#include "vnode.h"
680d163575Sopenharmony_ci#endif
690d163575Sopenharmony_ci
700d163575Sopenharmony_ci/* process */
710d163575Sopenharmony_ciextern unsigned int SysGetGroupId(void);
720d163575Sopenharmony_ciextern unsigned int SysGetTid(void);
730d163575Sopenharmony_ciextern void SysSchedYield(int type);
740d163575Sopenharmony_ciextern int SysSchedGetScheduler(int id, int flag);
750d163575Sopenharmony_ciextern int SysSchedSetScheduler(int id, int policy, const LosSchedParam *userParam, int flag);
760d163575Sopenharmony_ciextern int SysSchedGetParam(int id, LosSchedParam *userParam, int flag);
770d163575Sopenharmony_ciextern int SysSchedSetParam(int id, const LosSchedParam *userParam, int flag);
780d163575Sopenharmony_ciextern int SysSetProcessPriority(int which, int who, int prio);
790d163575Sopenharmony_ciextern int SysGetProcessPriority(int which, int who);
800d163575Sopenharmony_ciextern int SysSchedGetPriorityMin(int policy);
810d163575Sopenharmony_ciextern int SysSchedGetPriorityMax(int policy);
820d163575Sopenharmony_ciextern int SysSchedRRGetInterval(int pid, struct timespec *tp);
830d163575Sopenharmony_ciextern int SysWait(int pid, USER int *status, int options, void *rusage);
840d163575Sopenharmony_ciextern int SysWaitid(idtype_t type, int pid, USER siginfo_t *info, int options, void *rusage);
850d163575Sopenharmony_ciextern int SysFork(void);
860d163575Sopenharmony_ciextern int SysVfork(void);
870d163575Sopenharmony_ciextern int SysClone(int flags, void *stack, int *parentTid, unsigned long tls, int *childTid);
880d163575Sopenharmony_ciextern int SysUnshare(int flags);
890d163575Sopenharmony_ciextern int SysSetns(int fd, int type);
900d163575Sopenharmony_ciextern unsigned int SysGetPID(void);
910d163575Sopenharmony_ciextern unsigned int SysGetPPID(void);
920d163575Sopenharmony_ciextern int SysSetGroupID(unsigned int gid);
930d163575Sopenharmony_ciextern int SysGetGroupID(void);
940d163575Sopenharmony_ciextern int SysGetUserID(void);
950d163575Sopenharmony_ciextern int SysGetEffUserID(void);
960d163575Sopenharmony_ciextern int SysGetEffGID(void);
970d163575Sopenharmony_ciextern int SysSetUserID(int uid);
980d163575Sopenharmony_ciextern int SysGetRealEffSaveUserID(int *ruid, int *euid, int *suid);
990d163575Sopenharmony_ciextern int SysGetRealEffSaveGroupID(int *rgid, int *egid, int *sgid);
1000d163575Sopenharmony_ciextern int SysSetRealEffUserID(int ruid, int euid);
1010d163575Sopenharmony_ciextern int SysSetRealEffGroupID(int rgid, int egid);
1020d163575Sopenharmony_ciextern int SysSetRealEffSaveGroupID(int rgid, int egid, int sgid);
1030d163575Sopenharmony_ciextern int SysSetRealEffSaveUserID(int ruid, int euid, int suid);
1040d163575Sopenharmony_ciextern int SysGetGroups(int size, int list[]);
1050d163575Sopenharmony_ciextern int SysSetGroups(int size, int list[]);
1060d163575Sopenharmony_ciextern int SysGetCurrProcessGroupID(void);
1070d163575Sopenharmony_ciextern int SysGetProcessGroupID(unsigned int pid);
1080d163575Sopenharmony_ciextern int SysSetProcessGroupID(unsigned int pid, unsigned int gid);
1090d163575Sopenharmony_ciextern unsigned int SysCreateUserThread(const TSK_ENTRY_FUNC func, const UserTaskParam *userParam, bool joinable);
1100d163575Sopenharmony_ciextern int SysSetThreadArea(const char *area);
1110d163575Sopenharmony_ciextern char *SysGetThreadArea(void);
1120d163575Sopenharmony_ciextern int SysUserThreadSetDetach(unsigned int taskID);
1130d163575Sopenharmony_ciextern int SysUserThreadDetach(unsigned int taskID);
1140d163575Sopenharmony_ciextern int SysThreadJoin(unsigned int taskID);
1150d163575Sopenharmony_ciextern void SysUserExitGroup(int status);
1160d163575Sopenharmony_ciextern void SysThreadExit(int status);
1170d163575Sopenharmony_ciextern int SysFutex(const unsigned int *uAddr, unsigned int flags, int val,
1180d163575Sopenharmony_ci                    unsigned int absTime, const unsigned int *newUserAddr);
1190d163575Sopenharmony_ciextern int SysSchedGetAffinity(int id, unsigned int *cpuset, int flag);
1200d163575Sopenharmony_ciextern int SysSchedSetAffinity(int id, const unsigned short cpuset, int flag);
1210d163575Sopenharmony_ci
1220d163575Sopenharmony_ci#ifdef LOSCFG_COMPAT_POSIX
1230d163575Sopenharmony_ciextern mqd_t SysMqOpen(const char *mqName, int openFlag, mode_t mode, struct mq_attr *attr);
1240d163575Sopenharmony_ciextern int SysMqClose(mqd_t personal);
1250d163575Sopenharmony_ciextern int SysMqGetSetAttr(mqd_t mqd, const struct mq_attr *new, struct mq_attr *old);
1260d163575Sopenharmony_ciextern int SysMqUnlink(const char *mqName);
1270d163575Sopenharmony_ciextern int SysMqSend(mqd_t personal, const char *msgPtr, size_t msgLen, unsigned int msgPrio);
1280d163575Sopenharmony_ciextern int SysMqTimedSend(mqd_t personal, const char *msg, size_t msgLen, unsigned int msgPrio,
1290d163575Sopenharmony_ci                          const struct timespec *absTimeout);
1300d163575Sopenharmony_ciextern ssize_t SysMqTimedReceive(mqd_t personal, char *msg, size_t msgLen, unsigned int *msgPrio,
1310d163575Sopenharmony_ci                                 const struct timespec *absTimeout);
1320d163575Sopenharmony_ciextern int SysMqNotify(mqd_t personal, const struct sigevent *sigev);
1330d163575Sopenharmony_ci#endif
1340d163575Sopenharmony_ci
1350d163575Sopenharmony_ciextern int SysSigAction(int sig, const sigaction_t *restrict sa, sigaction_t *restrict old, size_t sigsetsize);
1360d163575Sopenharmony_ciextern int SysSigprocMask(int how, const sigset_t_l *restrict setl, sigset_t_l *restrict oldl, size_t sigsetsize);
1370d163575Sopenharmony_ciextern int SysKill(pid_t pid, int sig);
1380d163575Sopenharmony_ciextern int SysPthreadKill(pid_t pid, int sig);
1390d163575Sopenharmony_ciextern int SysSigTimedWait(const sigset_t_l *setl, siginfo_t *info,
1400d163575Sopenharmony_ci                           const struct timespec *timeout, size_t sigsetsize);
1410d163575Sopenharmony_ciextern int SysPause(void);
1420d163575Sopenharmony_ciextern int SysSigPending(sigset_t_l *setl);
1430d163575Sopenharmony_ciextern int SysSigSuspend(sigset_t_l *setl);
1440d163575Sopenharmony_ciextern int SysMkFifo(const char *pathName, mode_t mode);
1450d163575Sopenharmony_ci
1460d163575Sopenharmony_ci/* net */
1470d163575Sopenharmony_ci#ifdef LOSCFG_NET_LWIP_SACK
1480d163575Sopenharmony_ciextern int SysSocket(int domain, int type, int protocol);
1490d163575Sopenharmony_ciextern int SysBind(int s, const struct sockaddr *name, socklen_t namelen);
1500d163575Sopenharmony_ciextern int SysConnect(int s, const struct sockaddr *name, socklen_t namelen);
1510d163575Sopenharmony_ciextern int SysListen(int sockfd, int backlog);
1520d163575Sopenharmony_ciextern int SysAccept(int socket, struct sockaddr *address, socklen_t *addressLen);
1530d163575Sopenharmony_ciextern int SysGetSockName(int s, struct sockaddr *name, socklen_t *namelen);
1540d163575Sopenharmony_ciextern int SysGetPeerName(int s, struct sockaddr *name, socklen_t *namelen);
1550d163575Sopenharmony_ciextern ssize_t SysSend(int s, const void *dataptr, size_t size, int flags);
1560d163575Sopenharmony_ciextern ssize_t SysSendTo(int s, const void *dataptr, size_t size, int flags,
1570d163575Sopenharmony_ci                         const struct sockaddr *to, socklen_t tolen);
1580d163575Sopenharmony_ciextern ssize_t SysRecv(int socket, void *buffer, size_t length, int flags);
1590d163575Sopenharmony_ciextern ssize_t SysRecvFrom(int socket, void *buffer, size_t length, int flags,
1600d163575Sopenharmony_ci                           struct sockaddr *address, socklen_t *addressLen);
1610d163575Sopenharmony_ciextern int SysShutdown(int socket, int how);
1620d163575Sopenharmony_ciextern int SysSetSockOpt(int socket, int level, int optName,
1630d163575Sopenharmony_ci                         const void *optValue, socklen_t optLen);
1640d163575Sopenharmony_ciextern int SysGetSockOpt(int sockfd, int level, int optName,
1650d163575Sopenharmony_ci                         void *optValue, socklen_t *optLen);
1660d163575Sopenharmony_ciextern ssize_t SysSendMsg(int s, const struct msghdr *message, int flags);
1670d163575Sopenharmony_ciextern ssize_t SysRecvMsg(int s, struct msghdr *message, int flags);
1680d163575Sopenharmony_ci#endif
1690d163575Sopenharmony_ci
1700d163575Sopenharmony_ci/* vmm */
1710d163575Sopenharmony_ciextern void *SysMmap(void *addr, size_t size, int prot, int flags, int fd, size_t offset);
1720d163575Sopenharmony_ciextern int SysMunmap(void *addr, size_t size);
1730d163575Sopenharmony_ciextern int SysMprotect(void *vaddr, size_t len, int prot);
1740d163575Sopenharmony_ciextern void *SysMremap(void *oldAddr, size_t oldLen, size_t newLen, int flags, void *newAddr);
1750d163575Sopenharmony_ciextern void *SysBrk(void *addr);
1760d163575Sopenharmony_ciextern int SysShmGet(key_t key, size_t size, int shmflg);
1770d163575Sopenharmony_ciextern void *SysShmAt(int shmid, const void *shmaddr, int shmflg);
1780d163575Sopenharmony_ciextern int SysShmCtl(int shmid, int cmd, struct shmid_ds *buf);
1790d163575Sopenharmony_ciextern int SysShmDt(const void *shmaddr);
1800d163575Sopenharmony_ci
1810d163575Sopenharmony_ci/* misc */
1820d163575Sopenharmony_ci#ifdef LOSCFG_UTS_CONTAINER
1830d163575Sopenharmony_ciextern int SysSetHostName(const char *name, size_t len);
1840d163575Sopenharmony_ci#endif
1850d163575Sopenharmony_ciextern int SysUname(struct utsname *name);
1860d163575Sopenharmony_ciextern int SysInfo(struct sysinfo *info);
1870d163575Sopenharmony_ci
1880d163575Sopenharmony_ci/* time */
1890d163575Sopenharmony_ciextern int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp);
1900d163575Sopenharmony_ciextern clock_t SysTimes(struct tms *buf);
1910d163575Sopenharmony_ciextern time_t SysTime(time_t *tloc);
1920d163575Sopenharmony_ciextern int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ovalue);
1930d163575Sopenharmony_ciextern int SysGetiTimer(int which, struct itimerval *value);
1940d163575Sopenharmony_ciextern int SysTimerCreate(clockid_t clockID, struct ksigevent *evp, timer_t *timerID);
1950d163575Sopenharmony_ciextern int SysTimerGettime(timer_t timerID, struct itimerspec *value);
1960d163575Sopenharmony_ciextern int SysTimerGetoverrun(timer_t timerID);
1970d163575Sopenharmony_ciextern int SysTimerDelete(timer_t timerID);
1980d163575Sopenharmony_ciextern int SysClockSettime(clockid_t clockID, const struct timespec *tp);
1990d163575Sopenharmony_ciextern int SysClockGettime(clockid_t clockID, struct timespec *tp);
2000d163575Sopenharmony_ciextern int SysClockGetres(clockid_t clockID, struct timespec *tp);
2010d163575Sopenharmony_ciextern int SysClockNanoSleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem);
2020d163575Sopenharmony_ciextern int SysUtime(const char *path, const struct utimbuf *ptimes);
2030d163575Sopenharmony_ciextern int SysTimerSettime(timer_t timerID, int flags, const struct itimerspec *value, struct itimerspec *oldValue);
2040d163575Sopenharmony_ci
2050d163575Sopenharmony_ciextern int SysClockSettime64(clockid_t clockID, const struct timespec64 *tp);
2060d163575Sopenharmony_ciextern int SysClockGettime64(clockid_t clockID, struct timespec64 *tp);
2070d163575Sopenharmony_ciextern int SysClockGetres64(clockid_t clockID, struct timespec64 *tp);
2080d163575Sopenharmony_ciextern int SysClockNanoSleep64(clockid_t clk, int flags, const struct timespec64 *req, struct timespec64 *rem);
2090d163575Sopenharmony_ciextern int SysTimerGettime64(timer_t timerID, struct itimerspec64 *value);
2100d163575Sopenharmony_ciextern int SysTimerSettime64(timer_t timerID, int flags, const struct itimerspec64 *value, struct itimerspec64 *oldValue);
2110d163575Sopenharmony_ci
2120d163575Sopenharmony_ci/* filesystem */
2130d163575Sopenharmony_ci#ifdef LOSCFG_FS_VFS
2140d163575Sopenharmony_citypedef int (*PollFun)(struct pollfd *fds, nfds_t nfds, int timeout);
2150d163575Sopenharmony_ciextern int fp_open(char *fullpath, int oflags, mode_t mode);
2160d163575Sopenharmony_ciextern int do_open(int dirfd, const char *path, int oflags, mode_t mode);
2170d163575Sopenharmony_ciextern int do_unlink(int dirfd, const char *pathname);
2180d163575Sopenharmony_ciextern int do_mkdir(int dirfd, const char *pathname, mode_t mode);
2190d163575Sopenharmony_ciextern int do_rmdir(int dirfd, const char *pathname);
2200d163575Sopenharmony_ciextern int do_rename(int oldfd, const char *oldpath, int newfd, const char *newpath);
2210d163575Sopenharmony_ciextern int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
2220d163575Sopenharmony_ci                     struct timeval *timeout, PollFun poll);
2230d163575Sopenharmony_ciextern int do_readdir(int fd, struct dirent **de, unsigned int count);
2240d163575Sopenharmony_ciextern ssize_t preadv(int __fd, const struct iovec *__iov, int __count, off_t __offset);
2250d163575Sopenharmony_ciextern ssize_t pwritev(int __fd, const struct iovec *__iov, int __count, off_t __offset);
2260d163575Sopenharmony_ciextern int chattr(const char *pathname, struct IATTR *attr);
2270d163575Sopenharmony_ci
2280d163575Sopenharmony_ciextern int SysClose(int fd);
2290d163575Sopenharmony_ciextern ssize_t SysRead(int fd, void *buf, size_t nbytes);
2300d163575Sopenharmony_ciextern ssize_t SysWrite(int fd, const void *buf, size_t nbytes);
2310d163575Sopenharmony_ciextern int SysOpen(const char *path, int oflags, ...);
2320d163575Sopenharmony_ciextern int SysCreat(const char *pathname, mode_t mode);
2330d163575Sopenharmony_ciextern int SysLink(const char *path1, const char *path2);
2340d163575Sopenharmony_ciextern ssize_t SysReadlink(const char *pathname, char *buf, size_t bufsize);
2350d163575Sopenharmony_ciextern int SysSymlink(const char *target, const char *linkpath);
2360d163575Sopenharmony_ciextern int SysLinkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags);
2370d163575Sopenharmony_ciextern int SysSymlinkat(const char *target, int dirfd, const char *linkpath);
2380d163575Sopenharmony_ciextern ssize_t SysReadlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize);
2390d163575Sopenharmony_ciextern int SysUnlink( const char *pathname);
2400d163575Sopenharmony_ciextern int SysExecve(const char *fileName, char *const *argv, char *const *envp);
2410d163575Sopenharmony_ciextern int SysFchdir(int fd);
2420d163575Sopenharmony_ciextern int SysChdir(const char *path);
2430d163575Sopenharmony_ciextern int SysUtimensat(int fd, const char *path, struct timespec times[2], int flag);
2440d163575Sopenharmony_ciextern int SysFchmodat(int fd, const char *path, mode_t mode, int flag);
2450d163575Sopenharmony_ciextern int SysFchmod(int fd, mode_t mode);
2460d163575Sopenharmony_ciextern int SysChmod(const char *path, mode_t mode);
2470d163575Sopenharmony_ciextern int SysFchownat(int fd, const char *path, uid_t owner, gid_t group, int flag);
2480d163575Sopenharmony_ciextern int SysFchown(int fd, uid_t owner, gid_t group);
2490d163575Sopenharmony_ciextern int SysChown(const char *pathname, uid_t owner, gid_t group);
2500d163575Sopenharmony_ciextern off_t SysLseek(int fd, off_t offset, int whence);
2510d163575Sopenharmony_ciextern off64_t SysLseek64(int fd, int offsetHigh, int offsetLow, off64_t *result, int whence);
2520d163575Sopenharmony_ciextern int SysMount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags,
2530d163575Sopenharmony_ci                    const void *data);
2540d163575Sopenharmony_ciextern int SysUmount(const char *target);
2550d163575Sopenharmony_ciextern int SysAccess(const char *path, int amode);
2560d163575Sopenharmony_ciextern int SysFaccessat(int fd, const char *filename, int amode, int flag);
2570d163575Sopenharmony_ciextern int SysRename(const char *oldpath, const char *newpath);
2580d163575Sopenharmony_ciextern int SysMkdir(const char *pathname, mode_t mode);
2590d163575Sopenharmony_ciextern int SysRmdir(const char *pathname);
2600d163575Sopenharmony_ciextern int SysDup(int fd);
2610d163575Sopenharmony_ciextern int SysUmount2(const char *target, int flags);
2620d163575Sopenharmony_ciextern int SysIoctl(int fd, int req, void *arg);
2630d163575Sopenharmony_ciextern int SysFcntl(int fd, int cmd, void *arg);
2640d163575Sopenharmony_ciextern int SysDup2(int fd1, int fd2);
2650d163575Sopenharmony_ciextern int SysSelect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
2660d163575Sopenharmony_ciextern int SysPselect6(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
2670d163575Sopenharmony_ci                    const struct timespec *timeout, const long data[2]);
2680d163575Sopenharmony_ciextern int SysTruncate(const char *path, off_t length);
2690d163575Sopenharmony_ciextern int SysFtruncate(int fd, off_t length);
2700d163575Sopenharmony_ciextern int SysStatfs(const char *path, struct statfs *buf);
2710d163575Sopenharmony_ciextern int SysStatfs64(const char *path, size_t sz, struct statfs *buf);
2720d163575Sopenharmony_ciextern int SysFstatfs(int fd, struct statfs *buf);
2730d163575Sopenharmony_ciextern int SysFstatfs64(int fd, size_t sz, struct statfs *buf);
2740d163575Sopenharmony_ci
2750d163575Sopenharmony_ciextern int SysStat(const char *path, struct kstat *buf);
2760d163575Sopenharmony_ciextern int SysLstat(const char *path, struct kstat *buffer);
2770d163575Sopenharmony_ciextern int SysFstat(int fields, struct kstat *buf);
2780d163575Sopenharmony_ciextern int SysStatx(int fd, const char *restrict path, int flag, unsigned mask, struct statx *restrict stx);
2790d163575Sopenharmony_ciextern int SysFsync(int fd);
2800d163575Sopenharmony_ciextern ssize_t SysReadv(int fd, const struct iovec *iov, int iovcnt);
2810d163575Sopenharmony_ciextern ssize_t SysWritev(int fd, const struct iovec *iov, int iovcnt);
2820d163575Sopenharmony_ciextern int SysPipe(int pipefd[2]); /* 2 : pipe fds for read and write */
2830d163575Sopenharmony_ciextern int SysFormat(const char *dev, int sectors, int option);
2840d163575Sopenharmony_ciextern int SysFstat64(int fd, struct kstat *buf);
2850d163575Sopenharmony_ciextern int SysFstatat64(int fd, const char *restrict path, struct kstat *restrict buf, int flag);
2860d163575Sopenharmony_ciextern int SysFcntl64(int fd, int cmd, void *arg);
2870d163575Sopenharmony_ciextern int SysPoll(struct pollfd *fds, nfds_t nfds, int timeout);
2880d163575Sopenharmony_ciextern int SysPpoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmo_p,
2890d163575Sopenharmony_ci                    const sigset_t *sigmask, int nsig);
2900d163575Sopenharmony_ciextern int SysPrctl(int option, ...);
2910d163575Sopenharmony_ciextern ssize_t SysPread64(int fd, void *buf, size_t nbytes, off64_t offset);
2920d163575Sopenharmony_ciextern ssize_t SysPwrite64(int fd, const void *buf, size_t nbytes, off64_t offset);
2930d163575Sopenharmony_ciextern int SysEpollCreate(int size);
2940d163575Sopenharmony_ciextern int SysEpollCreate1(int size);
2950d163575Sopenharmony_ciextern int SysEpollCtl(int epfd, int op, int fd, struct epoll_event *ev);
2960d163575Sopenharmony_ciextern int SysEpollWait(int epfd, struct epoll_event *evs, int maxevents, int timeout);
2970d163575Sopenharmony_ciextern int SysEpollPwait(int epfd, struct epoll_event *evs, int maxevents, int timeout, const sigset_t *mask);
2980d163575Sopenharmony_ciextern char *SysGetcwd(char *buf, size_t n);
2990d163575Sopenharmony_ciextern ssize_t SysSendFile(int outfd, int infd, off_t *offset, size_t count);
3000d163575Sopenharmony_ciextern int SysTruncate(const char *path, off_t length);
3010d163575Sopenharmony_ciextern int SysTruncate64(const char *path, off64_t length);
3020d163575Sopenharmony_ciextern int SysFtruncate64(int fd, off64_t length);
3030d163575Sopenharmony_ciextern int SysOpenat(int dirfd, const char *path, int oflags, ...);
3040d163575Sopenharmony_ciextern int SysMkdirat(int dirfd, const char *pathname, mode_t mode);
3050d163575Sopenharmony_ciextern int SysUnlinkat(int dirfd, const char *pathname, int flag);
3060d163575Sopenharmony_ciextern int SysRenameat(int oldfd, const char *oldpath, int newdfd, const char *newpath);
3070d163575Sopenharmony_ciextern int SysFallocate(int fd, int mode, off_t offset, off_t len);
3080d163575Sopenharmony_ciextern int SysFallocate64(int fd, int mode, off64_t offset, off64_t len);
3090d163575Sopenharmony_ciextern ssize_t SysPreadv(int fd, const struct iovec *iov, int iovcnt, long loffset, long hoffset);
3100d163575Sopenharmony_ciextern ssize_t SysPwritev(int fd, const struct iovec *iov, int iovcnt, long loffset, long hoffset);
3110d163575Sopenharmony_ciextern void SysSync(void);
3120d163575Sopenharmony_ciextern int SysGetdents64(int fd, struct dirent *de_user, unsigned int count);
3130d163575Sopenharmony_ciextern int do_opendir(const char *path, int oflags);
3140d163575Sopenharmony_ciextern char *SysRealpath(const char *path, char *resolvedPath);
3150d163575Sopenharmony_ciextern int SysUmask(int mask);
3160d163575Sopenharmony_ciextern int SysShellExec(const char *msgName, const char *cmdString);
3170d163575Sopenharmony_ciextern int SysReboot(int magic, int magic2, int type);
3180d163575Sopenharmony_ciextern int SysGetrusage(int what, struct rusage *ru);
3190d163575Sopenharmony_ciextern long SysSysconf(int name);
3200d163575Sopenharmony_ciextern int SysUgetrlimit(int resource, unsigned long long k_rlim[2]);
3210d163575Sopenharmony_ciextern int SysSetrlimit(int resource, unsigned long long k_rlim[2]);
3220d163575Sopenharmony_ci#ifdef LOSCFG_CHROOT
3230d163575Sopenharmony_ciextern int SysChroot(const char *path);
3240d163575Sopenharmony_ci#endif
3250d163575Sopenharmony_ci#endif
3260d163575Sopenharmony_ci#endif /* _LOS_SYSCALL_H */
327