Skip to content

solarish: add missing stdlib.h and libgen.h functions - #5705

Draft
extrowerk wants to merge 1 commit into
rust-lang:mainfrom
extrowerk:illumos-stdlib
Draft

extrowerk wants to merge 1 commit into
rust-lang:mainfrom
extrowerk:illumos-stdlib

Conversation

@extrowerk

Copy link
Copy Markdown

Add the <stdlib.h> interfaces that were not bound for illumos yet:
clearenv, closefrom, fdwalk, canonicalize_file_name, rand_r,
the *rand48 family and random/srandom/initstate/setstate,
plus basename and dirname from <libgen.h>. These all carry
SUNW_* symbol versions and go in the shared solarish module.

The newer OpenBSD/POSIX 2024 compatibility functions (mkostemp,
mkostemps, qsort_r, reallocarray, reallocf, recallocarray,
freezero, strtonum) are illumos-only (ILLUMOS_* versions) and go in
the illumos module. illumos' qsort_r uses the POSIX argument order.

libgen.h is added to the solarish ctest headers.

stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L145-L161
stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L208-L248
stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L276-L359
libgen.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/libgen.h#L52-L53
Symbol versions: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/lib/libc/port/mapfile-vers

Testing

  • cargo check for x86_64-unknown-illumos, aarch64-unknown-illumos,
    x86_64-pc-solaris and sparcv9-sun-solaris (with -Dwarnings).
  • Every name in the applicable libc-test/semver lists compiles for
    illumos and Solaris; new constant values were cross-checked
    mechanically against the illumos-gate headers.
  • ci/style.py checks (rustfmt, sorted/unique semver lists, style test).
  • CC=clang cargo test -p libc-test on OmniOS r151060 (x86_64): passes

@rustbot label stable-nominated

🤖 Generated with Claude Code

https://claude.ai/code/session_01PUjq5rfL3s7TbKS3PeAE5K

Add the `<stdlib.h>` interfaces that were not bound for illumos yet:
`clearenv`, `closefrom`, `fdwalk`, `canonicalize_file_name`, `rand_r`,
the `*rand48` family and `random`/`srandom`/`initstate`/`setstate`,
plus `basename` and `dirname` from `<libgen.h>`. These all carry
`SUNW_*` symbol versions and go in the shared solarish module.

The newer OpenBSD/POSIX 2024 compatibility functions (`mkostemp`,
`mkostemps`, `qsort_r`, `reallocarray`, `reallocf`, `recallocarray`,
`freezero`, `strtonum`) are illumos-only (`ILLUMOS_*` versions) and go in
the illumos module. illumos' `qsort_r` uses the POSIX argument order.

`libgen.h` is added to the solarish ctest headers.

stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L145-L161
stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L208-L248
stdlib.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/stdlib.h#L276-L359
libgen.h: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/head/libgen.h#L52-L53
Symbol versions: https://github.com/illumos/illumos-gate/blob/b56614870515295c253babb2b10fffdd3c60fdbe/usr/src/lib/libc/port/mapfile-vers
@rustbot

rustbot commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in a solarish module

cc @jclulow, @pfmooney

@rustbot rustbot added O-illumos O-solarish O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 5, 2026
@tgross35

tgross35 commented Nov 5, 2026

Copy link
Copy Markdown
Member

Rewrite commit messages and PR descriptions by hand, then you may unmark as a draft. See https://forge.rust-lang.org/policies/llm-usage.html#-banned.

@tgross35
tgross35 marked this pull request as draft November 5, 2026 22:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-illumos O-solarish O-unix stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants