cctools
compat-at.h
Go to the documentation of this file.
1/*
2Copyright (C) 2022 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef COMPAT_AT_H
8#define COMPAT_AT_H
9
13#include <dirent.h>
14#include <fcntl.h>
15#include <sys/stat.h>
16#include <sys/types.h>
17#include <unistd.h>
18
19#include <limits.h>
20
21#ifndef AT_FDCWD
22# define AT_FDCWD -100
23#endif
24#ifndef AT_SYMLINK_NOFOLLOW
25# define AT_SYMLINK_NOFOLLOW 1
26#endif
27#ifndef AT_REMOVEDIR
28# define AT_REMOVEDIR 2
29#endif
30
31#ifndef HAS_OPENAT
32 int cctools_faccessat (int dirfd, const char *path, int amode, int flag);
33 int cctools_fchmodat (int dirfd, const char *path, mode_t mode, int flag);
34 DIR *cctools_fdopendir (int dirfd);
35 int cctools_fstatat (int dirfd, const char *path, struct stat *buf, int flag);
36 int cctools_linkat (int dirfd, const char *path, int newdirfd, const char *newpath, int flag);
37 int cctools_mkdirat (int dirfd, const char *path, mode_t mode);
38 int cctools_openat (int dirfd, const char *path, int oflag, mode_t cmode);
39 int cctools_readlinkat (int dirfd, const char *path, char *buf, size_t bufsize);
40 int cctools_renameat (int dirfd, const char *path, int newdirfd, const char *newpath);
41 int cctools_symlinkat (const char *target, int dirfd, const char *path);
42 int cctools_unlinkat (int dirfd, const char *path, int flag);
43# define faccessat cctools_faccessat
44# define fchmodat cctools_fchmodat
45# define fdopendir cctools_fdopendir
46# define fstatat cctools_fstatat
47# define linkat cctools_linkat
48# define mkdirat cctools_mkdirat
49# define openat cctools_openat
50# define readlinkat cctools_readlinkat
51# define renameat cctools_renameat
52# define symlinkat cctools_symlinkat
53# define unlinkat cctools_unlinkat
54#endif /* HAS_OPENAT */
55
56/* utimensat added in Linux 2.6.22 */
57#ifndef HAS_UTIMENSAT
58 int cctools_utimensat (int dirfd, const char *path, const struct timespec times[2], int flag);
59# define utimensat cctools_utimensat
60#endif
61
62#endif /* COMPAT_AT_H */
63
64/* vim: set noexpandtab tabstop=8: */