From faabbaa71ec09c0dc8a013f412b38726eec4e899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 9 Jun 2021 10:55:22 +0200 Subject: Linux: drop O_PATH usage O_PATH is available since Linux 2.6.39, but we are using fstat(2) on the returned file descriptor in LinuxProcessList_statProcessDir(), which is only supported since Linux 3.6. Fixes #534 --- linux/LinuxProcessList.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'linux/LinuxProcessList.c') diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 1c5359fc..fdde57c3 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -60,12 +60,6 @@ in the source distribution for its full text. #endif -// CentOS 6's kernel doesn't provide a definition of O_PATH -// based on definition taken from uapi/asm-generic/fcnth.h in Linux kernel tree -#ifndef O_PATH -# define O_PATH 010000000 -#endif - static long long btime = -1; static long jiffy; @@ -1313,7 +1307,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_ proc->isUserlandThread = proc->pid != proc->tgid; #ifdef HAVE_OPENAT - int procFd = openat(dirFd, entry->d_name, O_PATH | O_DIRECTORY | O_NOFOLLOW); + int procFd = openat(dirFd, entry->d_name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); if (procFd < 0) goto errorReadingProcess; #else -- cgit v1.2.3