You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib/posix: Adopt newlib-style re-entrant API for getopt family
Replace the Zephyr-specific re-entrant getopt family APIs with those from
newlib. This allows use of the newlib and picolibc native implementations
and provides a cleaner re-entrant mechanism, using a local variable to hold
the getopt state instead of having a thread-local variabled tucked away in
the shell context.
This will require changing all re-entrant users of getopt, switching from
the Zephyr-style interfaces to the newlib-style.
This also adopts the glibc/picolibc convention where setting optind = 0
causes the getopt functions to re-initialize all parsing state. This lets
us test the non-reentrant API without needing getopt_init().
Signed-off-by: Keith Packard <keithp@keithp.com>
0 commit comments