-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[WIP][DNM] lib: posix: Elaborate for wider yet more selective POSIX coverage #12984
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
Changes from all commits
67b0e1c
5f0abb5
30c5869
bfdf557
eeaacec
bb5485b
5409342
d46d930
9f06c3a
164c5fa
f92b18c
743eb53
a34503d
5f4fa60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,6 @@ zephyr_sources( | |
| crc16_sw.c | ||
| crc8_sw.c | ||
| crc7_sw.c | ||
| fdtable.c | ||
| mempool.c | ||
| rb.c | ||
| thread_entry.c | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,11 +15,56 @@ config POSIX_MAX_FDS | |
| config POSIX_API | ||
| depends on !ARCH_POSIX | ||
| bool "POSIX APIs" | ||
| select NEWLIB_LIBC | ||
|
||
| select POSIX_HEADERS | ||
|
||
| select POSIX_SLEEP | ||
| select POSIX_CLOCK | ||
| select POSIX_TIMER | ||
| select POSIX_FD_OPS | ||
| select POSIX_FCNTL_IOCTL | ||
| select POSIX_STDIN_OUT_ERR | ||
| help | ||
| Enable mostly-standards-compliant implementations of | ||
| various POSIX (IEEE 1003.1) APIs. | ||
|
|
||
| if POSIX_API | ||
| config POSIX_HEADERS | ||
| bool "Make available POSIX headers" | ||
| help | ||
| If enabled, applications will be able to include <unistd.h>, | ||
| <sys/socket.h> and all other POSIX headers under their native | ||
| names. If disabled, all the headers are still available, with | ||
| "posix/" prefix, e.g. <posix/unistd.h>. | ||
|
|
||
| config POSIX_SLEEP | ||
| bool "POSIX sleep()/usleep() calls" | ||
| help | ||
| Provide sleep()/usleep() calls. | ||
|
|
||
| config POSIX_CLOCK | ||
| bool "POSIX clock_*() calls" | ||
| help | ||
| Provide clock_*() calls. | ||
|
|
||
| config POSIX_TIMER | ||
| bool "POSIX timer_*() calls" | ||
| help | ||
| Provide timer_*() calls. | ||
|
|
||
| config POSIX_FD_OPS | ||
| bool "Basic POSIX file descriptor operations" | ||
| help | ||
| Provide close(), read(), write(), lseek(). | ||
|
|
||
| config POSIX_FCNTL_IOCTL | ||
| bool "POSIX fcntl() and ioctl() calls" | ||
| help | ||
| Provide fcntl() and ioctl(). | ||
|
|
||
| config POSIX_STDIN_OUT_ERR | ||
| bool "stdin/stdout/stderr POSIX file descriptors" | ||
| help | ||
| Pre-initialize file descriptors 0, 1, and 2 for console | ||
| standard input/output. | ||
|
|
||
| config PTHREAD_IPC | ||
| bool "POSIX pthread IPC API" | ||
|
|
@@ -95,5 +140,3 @@ config POSIX_MAX_OPEN_FILES | |
| is additionally bounded by CONFIG_POSIX_MAX_FDS. | ||
| endif | ||
| endif # FILE_SYSTEM | ||
|
|
||
| endif # POSIX_API | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you include this always, you should have all its individual c files gated with something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably yes, and eventually yes. But what happens when all those gates are enabled? Random build failures from native_posix. And that's the problem and means to address it which we discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was related to a) code side & b) if you include them without any Kconfig option, then you need to be careful that today posix_cheats only does the renaming if POSIX_API is set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to be careful is again to never include posix_cheats when anything POSIX subsys related is used. As posix_cheats is mandatory for ARCH_POSIX, that leads to obvious conclusions.