]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #1156 - divergentdave:fcntl-F_DUPFD_CLOEXEC, r=RalfJung
authorbors <bors@rust-lang.org>
Wed, 19 Feb 2020 08:45:04 +0000 (08:45 +0000)
committerbors <bors@rust-lang.org>
Wed, 19 Feb 2020 08:45:04 +0000 (08:45 +0000)
Add F_DUPFD/F_DUPFD_CLOEXEC to fcntl shim

This adds support for `F_DUPFD` and `F_DUPFD_CLOEXEC` to the shim for `fcntl`. (The `FileHandler` does not track the `FD_CLOEXEC` flag for open files, so these commands are effectively the same.) These changes enable using `File::try_clone`.

I also changed the initial value of the `low` field in `FileHandler`, so that it matches the intent of the preceding comment. The `open` shim was pre-incrementing it when choosing new file descriptor numbers, so FD 3 was being skipped.


Trivial merge