[libc-commits] [libc] [libc] Implement posix_close in unistd (PR #240024)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Tue Nov 10 02:24:35 PST 2026


labath wrote:

> Regarding the two definitions: `hdr/unistd_macros.h` provides an overlay fallback for host systems whose headers lack POSIX.1-2024 definitions, while `include/llvm-libc-macros/linux/unistd-macros.h` provides the public definition for full-build mode.

Okay, I see now. I guess that's fine, though I'd probably just make posix_close full-build only, at least until somebody actually needs it for overlays. That's because in overlay mode, the user code doesn't get our headers, so if the system library does not include the constant, they won't be able to use this function anyway. Glibc does not have this symbol, and it's the only library we support overlaying (in theory you could do it with musl, but I doubt anyone does that, and I know of at least one issue where our code wouldn't be compatible with that), so the function would be kind of useless anyway.

https://github.com/llvm/llvm-project/pull/240024


More information about the libc-commits mailing list