-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Configuring with POSIX_API disables NET_SOCKETS_POSIX_NAMES #17353
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
Comments
Will give it a try, but to me looks like a core configuration dependency issue. For NET_SOCKETS_POSIX_NAMES the dependency is: !POSIX_API && NET_SOCKETS && NETWORKING This just looks broken to me, to enable socket POSIX names, selecting POSIX APIs must be false ??? POSIX_API && NET_SOCKETS && NETWORKING or potentially just: NET_SOCKETS && NETWORKING |
No, you should just use POSIX APIs, period. However, if you know what you're doing, and would like to munge with Zephyr's adhoc proprietary APIs, while making them to pretend to be POSIX-like, you may select a very special option NET_SOCKETS_POSIX_NAMES. The current behavior works as intended. If it looks strange, then the strange thing is the use of NET_SOCKETS_POSIX_NAMES, not that it conflicts with POSIX_API. |
This reverts commit 0fb8a91. Our system is not yet ready for this change and it is causing issues if one wishes to use both generic Posix APIs and BSD networking APIs. Fixes zephyrproject-rtos#17353 Signed-off-by: Jukka Rissanen <[email protected]>
The intent is to be able to compile code using standard POSIX and standard BSD networks calls e.g. pthread_mutex_t mutex; Currently the catch 22 is that I have to enable POSIX_API to use the pthread stuff and enable |
Oops have just read above log and see you guys already have the issue in hand. |
"Standard BSD networks" are part of "standard POSIX".
The catch 22 is that Zephyr has severely broken POSIX subsystem, though some people are fixing it (while others are opposing streamlined progress in that direction).
No, POSIX_API enables all POSIX APIs. If you had to enable POSIX_API and NET_SOCKETS_POSIX_NAMES in some previous Zephyr version, that's the bug, which is being fixed.
I'm one of the guys who work on porting existing apps to Zephyr, and speak from experience of doing that more than once (~3 porting projects by now).
Once again, POSIX API does include BSD Socket API. However, the current POSIX support in Zephyr is severely limited and broken, and needs fixing to work as expected by "people who work on porting existing applications". There's WIP in that direction, which unfortunately, gets too much bikeshedding and sidetracking. Reversing it is however not an option (from my humble opinion as a POSIX subsys maintainer in Zephyr). Instead, interested parties should back and vote up the pending patches (https://github.com/zephyrproject-rtos/zephyr/pulls?q=is%3Aopen+is%3Apr+label%3A%22area%3A+POSIX%22). |
Am totally in support of implementing the correct fixes so that Zephyr has a quality POSIX API. Can |
With CONFIG_POSIX_API enabled, these samples now build under Zephyr with exactly the same source as e.g. Linux (or in general, other POSIX systems). However, building without CONFIG_POSIX_API (i.e. with CONFIG_NET_SOCKETS_POSIX_NAMES aux option) is retained for now. Add testcase definitions to build these samples with CONFIG_POSIX_API in CI. Fixes: zephyrproject-rtos#17353 Signed-off-by: Paul Sokolovsky <[email protected]>
With CONFIG_POSIX_API enabled, these samples now build under Zephyr with exactly the same source as e.g. Linux (or in general, other POSIX systems). However, building without CONFIG_POSIX_API (i.e. with CONFIG_NET_SOCKETS_POSIX_NAMES aux option) is retained for now. Add testcase definitions to build these samples with CONFIG_POSIX_API in CI. Fixes: #17353 Signed-off-by: Paul Sokolovsky <[email protected]>
Ok, this got closed automatically as a result of merging #18736. I wanted to post comments here before that, but got lost in errands with that PR. So, since the earlier comments on this PR, there were a lot of discussion where POSIX subsystem goes, and how. To clarify it, #17706 was posted. And fortunately, we went forward with the rest of pending POSIX features for 2.0, instead of being lost in small-steps, as subject of this ticket. To summarize, the current situation is:
P.2 is the intended way to use BSD Sockets in Zephyr. Parties with special needs may use p.1, but again, there's no guarantee that p.1 integrates well with any other API. |
With CONFIG_POSIX_API enabled, these samples now build under Zephyr with exactly the same source as e.g. Linux (or in general, other POSIX systems). However, building without CONFIG_POSIX_API (i.e. with CONFIG_NET_SOCKETS_POSIX_NAMES aux option) is retained for now. Add testcase definitions to build these samples with CONFIG_POSIX_API in CI. Fixes: zephyrproject-rtos#17353 Signed-off-by: Paul Sokolovsky <[email protected]>
Hello, I have some questions about zephyr's configuration flags. I'm trying to use the socket BSD, so I used this config CONFIG_NETWORKING=y But in my compilation's output, i see implicit reference to usleep() and sleep(). I see that I have to use CONFIG_POSIX_API to implement that methods. But them the socket code don't compile. What does the reason is? Thanks! |
Describe the bug
If POSIX support is enabled with CONFIG_POSIX_API=y then use of POSIX compliant
network interface names with CONFIG_NET_SOCKETS_POSIX_NAMES is disabled. This seems illogical to me.
Expected behavior
Should be able to set both CONFIG_POSIX_API and CONFIG_NET_SOCKETS_POSIX_NAMES for maximum POSIX compliance.
Impact
Breaks existing build
Screenshots or console output
warning: NET_SOCKETS_POSIX_NAMES (defined at subsys/net/lib/sockets/Kconfig:16) was assigned the
value 'y' but got the value 'n'. You can check symbol information (including dependencies) in the
'menuconfig' interface (see the Application Development Primer section of the manual), or in the
Kconfig reference at
Environment (please complete the following information):
Additional context
Am pretty sure this used to work on 1.14, looks like has been broken on the LTS branch
at some point.
The text was updated successfully, but these errors were encountered: