def METHOD_NAME(dir_fd, path, target_list):
    with os.scandir(f"/proc/self/fd/{dir_fd}") as it:
        for dirent in it:
            p = os.path.join(path, dirent.name)
            target_list.append(p)
            if dirent.is_dir(follow_symlinks=False):
                try:
                    child_fd = os.open(dirent.name, os.O_DIRECTORY, dir_fd=dir_fd)
                except OSError:
                    continue
                METHOD_NAME(child_fd, p, target_list)
                os.close(child_fd)