Skip to content

sys/vfs: Drop dependency to posix headers #19501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

maribu
Copy link
Member

@maribu maribu commented Apr 24, 2023

Contribution description

Our POSIX compat layer provides POSIX compatible VFS stats based on RIOT VFS module. Consequently, the POSIX layer should depend on VFS, rather than VFS depending on POSIX.

This moves a struct definition to the VFS module headers and lets the POSIX compatibility layer include vfs.h, rather than vfs.h including the POSIX compat headers.

Testing procedure

Green CI and binaries (except for debug symbols) shouldn't change.

Issues/PRs references

#19495 (comment)

@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 24, 2023
@maribu maribu requested review from chrysn and benpicco April 24, 2023 15:33
@github-actions github-actions bot added Area: Kconfig Area: Kconfig integration Area: sys Area: System labels Apr 24, 2023
@riot-ci
Copy link

riot-ci commented Apr 24, 2023

Murdock results

FAILED

7362ccc sys/vfs: Drop dependency to posix headers

Success Failures Total Runtime
52 0 6919 01m:28s

Artifacts

@maribu maribu force-pushed the sys/vfs/fix_deps branch 2 times, most recently from aa1d4eb to 7942b3c Compare April 24, 2023 20:26
Comment on lines +68 to +69
#ifdef CPU_NATIVE
/* on native, use system's struct statvfs definition */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This IMO also supports @chrysn assessment that we shouldn't reuse POSIX types for RIOT's native non-POSIX VFS API.

Our POSIX compat layer provides POSIX compatible VFS stats based on
RIOT VFS module. Consequently, the POSIX layer should depend on VFS,
rather than VFS depending on POSIX.

This moves a struct definition to the VFS module headers and lets the
POSIX compatibility layer include `vfs.h`, rather than `vfs.h` including
the POSIX compat headers.
@maribu maribu force-pushed the sys/vfs/fix_deps branch from 8ed5d32 to 7362ccc Compare April 25, 2023 10:58
@maribu
Copy link
Member Author

maribu commented Apr 25, 2023

This doesn't seem to result in a quick fix I was hoping for, as VFS is to closely entangled with POSIX definitions (e.g. O_RDONLY, O_WRONLY, O_RDWR, ...).

I guess there should rather be a discussion on whether we should evolve RIOT's VFS to a RIOT specific API without regard for POSIX, and a POSIX layer on top, or if we should stick with the current approach.

@maribu maribu closed this Apr 25, 2023
@maribu maribu deleted the sys/vfs/fix_deps branch April 25, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Kconfig Area: Kconfig integration Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants