Restrict pointer aliasing

Close #6354, close #6353
This commit is contained in:
topjohnwu
2022-10-31 16:35:33 -07:00
parent 1e53a5555e
commit 44643ad7b3
5 changed files with 16 additions and 14 deletions
+5 -4
View File
@@ -40,8 +40,9 @@ int xfstatat(int dirfd, const char *pathname, struct stat *buf, int flags);
int xdup(int fd);
int xdup2(int oldfd, int newfd);
int xdup3(int oldfd, int newfd, int flags);
ssize_t xreadlink(const char *pathname, char *buf, size_t bufsiz);
ssize_t xreadlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz);
ssize_t xreadlink(const char * __restrict__ pathname, char * __restrict__ buf, size_t bufsiz);
ssize_t xreadlinkat(
int dirfd, const char * __restrict__ pathname, char * __restrict__ buf, size_t bufsiz);
int xsymlink(const char *target, const char *linkpath);
int xsymlinkat(const char *target, int newdirfd, const char *linkpath);
int xlinkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags);
@@ -58,7 +59,7 @@ void *xmmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset
ssize_t xsendfile(int out_fd, int in_fd, off_t *offset, size_t count);
pid_t xfork();
int xpoll(pollfd *fds, nfds_t nfds, int timeout);
ssize_t xrealpath(const char *path, char *buf, size_t bufsiz);
int xmknod(const char *pathname, mode_t mode, dev_t dev);
ssize_t xrealpath(const char * __restrict__ path, char * __restrict__ buf, size_t bufsiz);
int xmknod(const char * pathname, mode_t mode, dev_t dev);
} // extern "C"