mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
Add compat mode for systems without openat(2)
This commit is contained in:

committed by
BenBE

parent
638207a2ff
commit
2ff2859c23
14
Compat.c
14
Compat.c
@ -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,
|
||||
|
Reference in New Issue
Block a user