Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark -1 as an available niche for file descriptors #74699

Merged
merged 4 commits into from
Dec 20, 2020

Commits on Dec 10, 2020

  1. Mark -1 as an available niche for file descriptors

    Based on discussion from https://internals.rust-lang.org/t/can-the-standard-library-shrink-option-file/12768,
    the file descriptor -1 is chosen based on the POSIX API designs that use it as a sentinel to report errors.
    A bigger niche could've been chosen, particularly on Linux, but would not necessarily be portable.
    
    This PR also adds a test case to ensure that the -1 niche
    (which is kind of hacky and has no obvious test case) works correctly.
    It requires the "upper" bound, which is actually -1, to be expressed in two's complement.
    notriddle committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    59abdb6 View commit details
    Browse the repository at this point in the history
  2. Add safety note to library/std/src/sys/unix/fd.rs

    Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>
    notriddle and elichai committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    a50811a View commit details
    Browse the repository at this point in the history
  3. Fix fd test case

    notriddle committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    08b70ed View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2020

  1. Configuration menu
    Copy the full SHA
    094b1da View commit details
    Browse the repository at this point in the history