meson.build: check for SYS_pidfd_open

This commit is contained in:
Peter Hutterer 2021-06-10 15:12:12 +10:00
parent 18b3efa2ed
commit 14eb43ea86
3 changed files with 9 additions and 0 deletions

View file

@ -812,7 +812,11 @@ static int monitor_test_forked(struct pwtest_test *t, pid_t pid, int read_fds[_F
size_t nevents = 0;
int r;
#if HAVE_PIDFD_OPEN
pidfd = syscall(SYS_pidfd_open, pid, 0);
#else
errno = ENOSYS;
#endif
/* If we don't have pidfd, we use a timerfd to ping us every 20ms */
if (pidfd < 0 && errno == ENOSYS) {
pidfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);