Skip to content

[posix] E: Tracking POSIX feature gaps opted out in configure.host for *-nanvix* #16

Description

@esaurez

Tracking: POSIX feature gaps opted out in configure.host for *-nanvix*

Summary

While shipping the .so-enablement work (esaurez#3, #4), we explicitly opted out of four POSIX feature families that newlib's libc/posix/ ships, plus enabled HAVE_OPENDIR to defer dirent-API responsibility to libposix. Each opt-out is a deliberate "Nanvix does not implement this yet" marker that needs a long-term plan. This issue is the umbrella tracker so the disabled features are visible.

The opt-outs are not bugs in newlib — they use newlib's own capability-macro idiom (cf. the RTEMS entry at configure.host:623). But each cflag corresponds to a real gap on the Nanvix side that should eventually be closed so the cflag can be removed.

Disabled by PR-3 + PR-4

Feature newlib gate What it provides Why disabled today Sub-issue
Signal masks -D_NO_SIGPROCMASK sigprocmask, sigfillset, sigemptyset, sigaddset, sigdelset, sigismember, sigsuspend Nanvix has no kernel-side per-thread signal-mask plumbing yet. PR-3 added the cflag to unblock libc/search/hash_page.c. (to be filed against nanvix/nanvix + libposix)
posix_spawn family -D_NO_POSIX_SPAWN posix_spawn, posix_spawnp, posix_spawnattr_*, posix_spawn_file_actions_* Needs fork+execve+sigprocmask; Nanvix has none of those primitives yet. (folded with sigprocmask for now)
popen / pclose -D_NO_POPEN popen, pclose Needs fork+pipe+execve+/bin/sh. (to be filed)
wordexp / wordfree -D_NO_WORDEXP wordexp, wordfree Shells out to /bin/sh for word expansion. (to be filed)

Plus the HAVE_* opt-in (PR-4)

Macro What it silences in newlib Why it's set
-DHAVE_OPENDIR opendir.c, readdir.c, closedir.c, dirfd.c, scandir.c, seekdir.c, telldir.c, rewinddir.c, ftw.c, nftw.c Nanvix provides opendir/readdir/... in libposix using a different struct dirent layout (d_ino+d_name, no d_reclen). Newlib's BSD-style versions would not compile against Nanvix's <sys/dirent.h>.

HAVE_OPENDIR is not itself a missing feature — the API exists, just in libposix instead of newlib. But two related items in the same gate are missing everywhere on Nanvix:

Symbol Status on Nanvix Notes
ftw / nftw missing everywhere Currently empty because HAVE_OPENDIR silences libc/posix/{ftw,nftw}.c. Tree-walk APIs. Pure C — could land in libposix without kernel work; the easy win in this list.

What "done" looks like

Every cflag listed above can eventually be removed from *-nanvix* in newlib/configure.host. That requires implementations on the Nanvix side (kernel or libposix). This umbrella issue stays open until the cflag list is empty.

Suggested sub-issue breakdown (to be filed against nanvix/nanvix and/or nanvix/libposix)

  1. sigprocmask + sigaction + sigsuspend — kernel + libposix; biggest item, blocks most others. Local note: nanvix-todo/nanvix-newlib-implement-sigprocmask.md (also being filed).
  2. posix_spawn family — libposix; depends on fork/execve which are larger items.
  3. popen / pclose — libposix; depends on pipe + fork + execve + /bin/sh.
  4. wordexp / wordfree — libposix; depends on /bin/sh for expansion OR a pure-C re-implementation.
  5. ftw / nftw — libposix; pure-C, just walks opendir/readdir — easy win, no kernel dep.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions