-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Introduction
This issue is created as prompted by the discussion on the Networking Forum.
We are working on implementing support for CivetWeb HTTP library (https://github.com/civetweb/civetweb), but it requires improvements in the libc layer. It's a good example of an external project using sockets APIs that should be relatively easy to integrate with Zephyr, as a proof of concept.
Problem description
CivetWeb uses different POSIX API calls, as any application or library runnable on Linux.
Using Newlib is not an option due to heavy conflicts with the POSIX layer (see #13787).
Improving minimal-libc requires some consideration to maintain compatibility with other layers.
Here we list features missing from minimal-libc that would be required for CivetWeb to work.
Detailed RFC
Here is the list of functions that are used by CivetWeb, with pull requests were applicable.
For some we will prepare stub implementations that will be enough to get the library to work.
- strcspn (Add strcspn and iscntrl to minimal libc #16451)
- iscntrl (Add strcspn and iscntrl to minimal libc #16451)
- strerror (libc: add strerror() to minimal libc #16527)
- strtoull, strtoll (libc: add strtoll and strtoull functions #16511)
- atof (we have the implementation ready, will publish it with [DNM] for reference)
- sscanf
- localtime
- gmtime
- time
- difftime
Dependencies
This is relevant to the POSIX and libc layers. Also time Infrastructure is affected.
CC: @pfalcon @nashif @rakons @andrewboie @jukkar @laperie @tgorochowik
Concerns and Unresolved Questions
The main purpose of minimal-libc is to be, well, minimal. Further work should preserve this approach.
Time related functions rely on a concept of current time. Right now there is no such thing in Zephyr.
There is a proposal by @pfalcon we were about to follow, using the work he submitted via #15602
Current status
As suggested by @nashif (see #16451), we will now proceed with including relevant functions in the sample itself.