Skip to content

libkernel: lstat, access, chmod, truncate, utimes and readlink of a regular file named with a trailing slash fail with ENOENT or EINVAL instead of ENOTDIR (Windows) #8770

Closed as not planned

Description

@xXPBSXx

Windows host, file a regular file: lstat("file/"), access("file/", F_OK) and utimes("file/", NULL) return -1 with errno 2; chmod("file/", 0600), truncate("file/", 0) and readlink("file/", buf, n) return -1 with errno 22.
Expected (FreeBSD 11.4 lookup(), sys/kern/vfs_lookup.c:1072, a trailing slash requires the result to be a directory): ENOTDIR (20), as stat("file/") and, with #8680, unlink, remove, rename and open already answer.
Test: core/libs/tests/GuestFilesystem.cpp, core/libs/tests/GuestKernelSys.cpp (new cases).
Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/trailing-slash-enotdir-2
AI-assisted (Claude Code).

Activity

  1. xXPBSXx commented on Oct 21, 2026

    @xXPBSXx
    ContributorAuthor

    Closed together with the dependent PR #8771 (depends on #8680, closed pending a title reference). AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions