Skip to content
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

POSIX Roadmap for LTSv3 #51211

Open
cfriedt opened this issue Oct 12, 2022 · 10 comments
Open

POSIX Roadmap for LTSv3 #51211

cfriedt opened this issue Oct 12, 2022 · 10 comments
Assignees
Labels
area: POSIX POSIX API Library RFC Request For Comments: want input from the community

Comments

@cfriedt
Copy link
Member

cfriedt commented Oct 12, 2022

Introduction

POSIX libraries and applications should Just Work™️ in 90% of the cases when being ported to Zephyr. Why? Because we want to enable our users to launch products and applications to the best of our ability, and we want to lower the barrier to entry by enabling users to leverage portable APIs.

This is an umbrella issue that will outlines work to be done in the POSIX API prior to LTSv3 (Ideally complete by v3.5).

Problem description

As discussed at EOSS 2023 and EOSS 2024, Zephyr's POSIX API layer needs some improvements. These can be broken down into the following:

  1. Maintainability
  2. Application / libc / toolchain Interface
  3. Application / library Portability

Proposed change

Implement all Option Requirements of POSIX Subprofiling Option Groups required for PSE51, PSE52, and most of PSE53 compatibility.

aep

Update the POSIX areas at docs.zephyrproject.org. For reference, the top level page of Zephyr's POSIX documentation.

https://docs.zephyrproject.org/latest/services/portability/posix/index.html

Maintainability addresses the needs of the maintainer, contributors, and (to some extent) the users.

Interface addresses the needs of

  • the user (users develop POSIX code to the interface, not the implementation) (i.e. _POSIX_C_SOURCE, _XOPEN_SOURCE)
  • the C Library maintainers - via Option Requirements (e.g. _POSIX_TIMERS)
  • users - we do not need to re-doc the standardized POSIX API (i.e. via doxygen). However, users should rightfully expect to be able to find links to the standards that Zephyr conforms to, as well as the conformance gaps.

Portability addresses the needs of the users who should (rightfully) expect that the POSIX API layer behaves according to the specification.

Detailed RFC

Proposed change (Detailed)

Maintainability

The layering issues that exist between subsys/net and lib/posix can be described as a cyclic dependency. The issue can be resolved via mutual dependency.

I.e. Currently, we have:

┌───────────┐       ┌───────────┐
│           ├──────►│           │
│   POSIX   │       │   NET     │
│           │◄──────┤           │
└───────────┘       └───────────┘

But we need

          ┌───────────┐
          │           │
          │   ZVFS    │
          │           │
          └▲────────▲─┘
           │        │
           │        │
┌──────────┴┐       ├───────────┐
│           │       │           │
│   POSIX   ├───────►   NET     │
│           │       │           │
└───────────┘       └───────────┘

Diagrams made with https://asciiflow.com/

I think we may have settled on the name "ZVFS" in the above diagram.

Interface

Tip

Check the Current status of Suprofiling Option Group support from docs to verify that the items below are up to date

Dependencies

Concerns and Unresolved Questions

Alternatives

There was a previous massive PR that attempted to address a number of the goals at once (#43987), but it is impossible to review in the current state and needs to be broken down and simplified in separate individual PRs.

@cfriedt cfriedt added RFC Request For Comments: want input from the community area: POSIX POSIX API Library labels Oct 12, 2022
@cfriedt cfriedt self-assigned this Oct 12, 2022
@cfriedt cfriedt added this to the v3.4.0 milestone Oct 12, 2022
@cfriedt cfriedt changed the title POSIX Roadmap for LTSv3 RFC: POSIX Roadmap for LTSv3 Oct 12, 2022
@nashif nashif moved this to To Do in Release Plan Oct 13, 2022
@nashif nashif moved this from To Do to LTS3 Goals in Release Plan Oct 13, 2022
cfriedt added a commit to cfriedt/zephyr that referenced this issue Nov 21, 2022
Define `PTHREAD_CREATE_DETACHED` and
`PTHREAD_CREATE_JOINABLE` to be compatible with the Newlib
definitions.

This is a temporary workaround for zephyrproject-rtos#51211 until Newlib
headers are pulled in.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt added a commit to cfriedt/zephyr that referenced this issue Nov 21, 2022
Define `PTHREAD_CREATE_DETACHED` and
`PTHREAD_CREATE_JOINABLE` to be compatible with the Newlib
definitions.

This is a temporary workaround for zephyrproject-rtos#51211 until Newlib
headers are pulled in.

Signed-off-by: Chris Friedt <[email protected]>
@nashif nashif moved this from Todo to Done in TSC Attention Needed Jun 26, 2024
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 6, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 6, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 7, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 8, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 9, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 9, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 10, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt
Copy link
Member Author

cfriedt commented Jul 10, 2024

Updated comment to reflect that the the posix device_io, signals, and fd_mgmt features were reverted.

This puts LTSv3 in a kind of dilapidated state from the POSIX & libc perspective.

cfriedt pushed a commit to cfriedt/zephyr that referenced this issue Jul 12, 2024
A shortcut was taken many years ago by "cherry-picking" the
POSIX off_t and ssize_t types for use throughout Zephyr.

Additionally, the POSIX header fcntl.h, as well as constants
defined in that header, were being used inappropriately
throughout Zephyr.

Doing so created a dependency cycle: below POSIX's position
in the stack, code depended on POSIX; above POSIX's position
in the stack, code depends on the lower parts.

Such dependency cycles usually result in fragility and
instability of the software stack.

Use the newly defined k_off_t and k_ssize_t types throughout
Zephyr's stack, where off_t and ssize_t were previously used
inappropriately.

Additionally, use ZVFS-prefixed constants instead of their
POSIX counterparts.

Additionally, where appropriate, ensure the POSIX fcntl.h
header is prefixed with <zephyr/posix/fcntl.h>.

We effectively create a mutual dependency to resolve the
cyclic dependency, as described in GitHub issue zephyrproject-rtos#51211.

For clarification, it is inappropriate to use POSIX types or
functions within the kernel, core OS, OS services, or really
anywhere that is not equal to or above POSIX's position in the
software stack.

In other words, if a library uses POSIX, Zephyr's POSIX
implementation cannot depend on that library.

Similarly, if a system service uses POSIX, Zephyr's POSIX
implementation cannot depend on that system service.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt removed the TSC Topics that need TSC discussion label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library RFC Request For Comments: want input from the community
Projects
Status: No status
Status: 3.7 (LTS3)
Status: Done
Development

No branches or pull requests

5 participants