fs/hostfs: Return ENOTTY for unsupported ioctl#19501
Merged
Merged
Conversation
LingaoM
requested review from
jerpelea,
masayuki2009 and
xiaoxiang781216
as code owners
July 22, 2026 04:18
xiaoxiang781216
approved these changes
Jul 22, 2026
Contributor
|
please rebase to the last master @LingaoM |
Contributor
|
These implementations are unconditional stubs and do not inspect request. POSIX describes ENOSYS as indicating that the interface function is not supported at all, whereas NuttX documents ENOTTY for an ioctl() command that is not recognized. Since host_ioctl() is entirely unimplemented on these backends, wouldn’t -ENOSYS be more accurate here? https://nuttx.apache.org/docs/latest/implementation/ioctl.html |
emomaxd
reviewed
Jul 22, 2026
host_ioctl() reports unsupported ioctl requests from hostfs backends. Use -ENOTTY for that case instead of -ENOSYS so callers can distinguish an unsupported ioctl request from a missing host operation. Keep the other host operation stubs returning -ENOSYS; this change is limited to ioctl semantics. Update the ARM, ARM64, RISC-V, Xtensa and Windows sim hostfs stubs to match that behavior. Testing: Host: Ubuntu 22.04 x86_64 - git diff --check - make distclean - ./tools/configure.sh -l -a ../nuttx-apps sim:nsh - make -j16 - printf 'help\npoweroff\n' | timeout 20s ./nuttx - make distclean - ./tools/configure.sh -a ../nuttx-apps sabre-6quad:knsh - make -j16 Assisted-by: Claude:Claude-Fable-5 Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
LingaoM
force-pushed
the
hostfs-ioctl-enotty
branch
from
July 23, 2026 01:40
0cd1b55 to
fcfbb21
Compare
xiaoxiang781216
approved these changes
Jul 23, 2026
jerpelea
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
host_ioctl() reports unsupported ioctl requests from hostfs backends. Use -ENOTTY for that case instead of -ENOSYS so callers can distinguish an unsupported ioctl request from a missing host operation.
Keep the other host operation stubs returning -ENOSYS; this change is limited to ioctl semantics. Update the ARM, ARM64, RISC-V, Xtensa and Windows sim hostfs stubs to match that behavior.
Testing:
Host: Ubuntu 22.04 x86_64
git diff --check
make distclean
./tools/configure.sh -l -a ../nuttx-apps sim:nsh
make -j16
printf 'help\npoweroff\n' | timeout 20s ./nuttx
make distclean
./tools/configure.sh -a ../nuttx-apps sabre-6quad:knsh
make -j16
Assisted-by: Claude:Claude-Fable-5