/* Verify we can set an arbitrary remote fd */
        fd = ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD, &addfd);
-       /*
-        * The child has fds 0(stdin), 1(stdout), 2(stderr), 3(memfd),
-        * 4(listener), so the newly allocated fd should be 5.
-        */
-       EXPECT_EQ(fd, 5);
+       EXPECT_GE(fd, 0);
        EXPECT_EQ(filecmp(getpid(), pid, memfd, fd), 0);
 
        /* Verify we can set an arbitrary remote fd with large size */
        memset(&big, 0x0, sizeof(big));
        big.addfd = addfd;
        fd = ioctl(listener, SECCOMP_IOCTL_NOTIF_ADDFD_BIG, &big);
-       EXPECT_EQ(fd, 6);
+       EXPECT_GE(fd, 0);
 
        /* Verify we can set a specific remote fd */
        addfd.newfd = 42;