Skip to content

Commit 206ca7d

Browse files
committed
Use __NR_pidfd_open and __NR_pidfd_getfd
to avoid use of undeclared identifier 'SYS_pidfd_open'
1 parent 9b15891 commit 206ca7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/common/ur_util.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ int ur_duplicate_fd(int pid, int fd_in) {
4141
// pidfd_open(2) is supported since Linux 5.3
4242
#if defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd)
4343
errno = 0;
44-
int pid_fd = syscall(SYS_pidfd_open, pid, 0);
44+
int pid_fd = syscall(__NR_pidfd_open, pid, 0);
4545
if (pid_fd == -1) {
46-
logger::error("SYS_pidfd_open");
46+
logger::error("__NR_pidfd_open");
4747
return -1;
4848
}
4949

50-
int fd_dup = syscall(SYS_pidfd_getfd, pid_fd, fd_in, 0);
50+
int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0);
5151
close(pid_fd);
5252
if (fd_dup == -1) {
53-
logger::error("SYS_pidfd_getfd");
53+
logger::error("__NR_pidfd_getfd");
5454
return -1;
5555
}
5656

0 commit comments

Comments
 (0)