Skip to content

posix: device_io: implement fdopen(), fileno(), pread(), pselect(), pwrite()#73978

Merged
nashif merged 12 commits intozephyrproject-rtos:mainfrom
cfriedt:posix-device-io
Jun 27, 2024
Merged

posix: device_io: implement fdopen(), fileno(), pread(), pselect(), pwrite()#73978
nashif merged 12 commits intozephyrproject-rtos:mainfrom
cfriedt:posix-device-io

Conversation

@cfriedt
Copy link
Copy Markdown
Member

@cfriedt cfriedt commented Jun 10, 2024

Implement the remaining functions in the POSIX_DEVICE_IO Option Group.

This Option Group is requried for the PSE51, PSE52, PSE53, and PSE54 subprofiles and likely others.

Doc Preview

Fixes #24966
Fixes #66932
Fixes #66938
Fixes #66946
Fixes #66947
Fixes #66948

@cfriedt cfriedt requested a review from ycsin June 10, 2024 01:00
@cfriedt cfriedt force-pushed the posix-device-io branch 11 times, most recently from e2eba59 to 44a701c Compare June 11, 2024 11:44
@cfriedt
Copy link
Copy Markdown
Member Author

cfriedt commented Jun 11, 2024

This one has a false positive regarding the reserved word "remove" due to the remove() function existing in a file that was touched.

No changes made there, although it is an ISO C function, and not a POSIX one. That would be a good bugfix at some point.

@cfriedt cfriedt added this to the v3.7.0 milestone Jun 11, 2024
@cfriedt cfriedt force-pushed the posix-device-io branch 5 times, most recently from eddd8a3 to fb66b50 Compare June 13, 2024 03:06
@cfriedt cfriedt force-pushed the posix-device-io branch 4 times, most recently from 677c2f8 to e3cf1b8 Compare June 15, 2024 19:01
@cfriedt cfriedt changed the title Posix device io posix: device_io: implement remaining functions Jun 15, 2024
@cfriedt cfriedt changed the title posix: device_io: implement remaining functions posix: device_io: implement fdopen(), fileno(), pread(), pselect(), pwrite() Jun 15, 2024
@cfriedt cfriedt force-pushed the posix-device-io branch 2 times, most recently from fc608ec to 9a5bb43 Compare June 15, 2024 22:50
Chris Friedt added 8 commits June 26, 2024 14:45
Move the implementation of zsock_poll to zvfs_poll. This allows
other types of file descriptors to also make use of poll()
functionality even when the network subsystem is not enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <[email protected]>
Move the implementation of zsock_select() to zvfs_select(). This
allows other types of file descriptors to also make use of
select() functionality even when the network subsystem is not
enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <[email protected]>
Implement pselect() as it's required by POSIX_DEVICE_IO

Signed-off-by: Chris Friedt <[email protected]>
Implement fdopen(), as required by the POSIX_DEVICE_IO Option
Group.

Signed-off-by: Chris Friedt <[email protected]>
Implement fileno() as required by the POSIX_DEVICE_IO Option
Group.

Signed-off-by: Chris Friedt <[email protected]>
Previously, we had only used the flags field and ignored mode
with the open() function.

Signed-off-by: Chris Friedt <[email protected]>
Mark the POSIX_DEVICE_IO Option Group as commplete. This Option
Group is required for PSE51, PSE52, PSE53, PSE54, and most of
the interesting applications involving file descriptors and
sockets.

Signed-off-by: Chris Friedt <[email protected]>
Several help prompts for non-user-selectable Kconfig options
included the phrase "select 'y' here", which does not make
any sense in this situation.

Adjust the help sections to use more appropriate language.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt dismissed stale reviews from ycsin and SeppoTakalo via 53a4ec6 June 26, 2024 19:29
@cfriedt
Copy link
Copy Markdown
Member Author

cfriedt commented Jun 26, 2024

  • rebased
  • fixed merge conflicts
  • updated language for non-user-selectable Kconfig options (i.e. do not use "Select 'y'" if the user cannot select y)

@cfriedt cfriedt requested review from SeppoTakalo, jukkar and ycsin June 26, 2024 19:55
@cfriedt cfriedt removed the DNM This PR should not be merged (Do Not Merge) label Jun 26, 2024
@cfriedt
Copy link
Copy Markdown
Member Author

cfriedt commented Jun 26, 2024

Other than the false positive in coding guidelines, this should probably be all green. Please revisit when you have a moment @ycsin, @jukkar, @SeppoTakalo

@nashif nashif merged commit b82b5b0 into zephyrproject-rtos:main Jun 27, 2024
@cfriedt cfriedt deleted the posix-device-io branch June 27, 2024 15:51
aescolar added a commit to aescolar/zephyr that referenced this pull request Jul 1, 2024
PR zephyrproject-rtos#73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
zephyrproject-rtos#75205

This reverts commit e9b676a.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
aescolar added a commit to aescolar/zephyr that referenced this pull request Jul 1, 2024
This reverts commit b18cad1.

PR zephyrproject-rtos#73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
zephyrproject-rtos#75205

Signed-off-by: Alberto Escolar Piedras <[email protected]>
aescolar added a commit to aescolar/zephyr that referenced this pull request Jul 1, 2024
…iour"

This reverts commit b10f1ca.

PR zephyrproject-rtos#73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
zephyrproject-rtos#75205

Signed-off-by: Alberto Escolar Piedras <[email protected]>
aescolar added a commit to aescolar/zephyr that referenced this pull request Jul 1, 2024
…oup"

This reverts commit 308322e.

PR zephyrproject-rtos#73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
zephyrproject-rtos#75205

Signed-off-by: Alberto Escolar Piedras <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Base OS Base OS Library (lib/os) area: LWM2M area: Networking area: POSIX POSIX API Library area: Sockets Networking sockets area: Tracing Tracing

Projects

None yet

7 participants