Skip to content

unix: add SSIZE_MAX constant for unix targets#5166

Open
telcharr wants to merge 1 commit into
rust-lang:mainfrom
telcharr:feature/ssize-max
Open

unix: add SSIZE_MAX constant for unix targets#5166
telcharr wants to merge 1 commit into
rust-lang:mainfrom
telcharr:feature/ssize-max

Conversation

@telcharr

@telcharr telcharr commented Jun 13, 2026

Copy link
Copy Markdown

Closes #1504

Description

Adds the POSIX SSIZE_MAX constant at the unix level. Defined as ssize_t::MAX, since ssize_t is isize on all unix targets making it correct on 32-bit, 64-bit, and x32 without any cfg. 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 *MAX enumeration sentinel of the kind #3131 targets, so it's not a placeholder constant.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review 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.

Expose SSIZE_MAX to enable safe/portable read and write system calls

2 participants