Add compat mode for systems without openat(2)

This commit is contained in:
Christian Göttsche
2020-11-20 17:50:34 +01:00
committed by BenBE
parent 638207a2ff
commit 2ff2859c23
5 changed files with 111 additions and 42 deletions

View File

@ -80,6 +80,20 @@ int Compat_fstatat(int dirfd,
#endif
}
#ifndef HAVE_OPENAT
int Compat_openat(const char* dirpath,
const char* pathname,
int flags) {
char path[4096];
xSnprintf(path, sizeof(path), "%s/%s", dirpath, pathname);
return open(path, flags);
}
#endif /* !HAVE_OPENAT */
int Compat_readlinkat(int dirfd,
const char* dirpath,
const char* pathname,