unix: add SSIZE_MAX constant for unix targets#5166
Open
telcharr wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1504
Description
Adds the POSIX
SSIZE_MAXconstant at the unix level. Defined asssize_t::MAX, sincessize_tisisizeon all unix targets making it correct on 32-bit, 64-bit, and x32 without anycfg. Binding the named constant is still worth it for discoverability and parity with the C API.This is a fixed POSIX type limit, not a
*MAXenumeration sentinel of the kind #3131 targets, so it's not a placeholder constant.Sources
POSIX / Open Group
<limits.h>:https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
glibc
posix/bits/poisx1_lim.h:https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/posix/bits/posix1_lim.h#L164-L172
musl
include/limits.h:53:https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n53
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated