fdequal
bool fdequal(int fd, int dfd, const char *path);
if (fdequal(fd, afd, NULL))
failed = (fd < 0 || !fdequal(fd, rootfd, test->out.path));