1. 08 5月, 2015 1 次提交
  2. 14 4月, 2015 1 次提交
  3. 10 4月, 2015 2 次提交
    • A
      std: Unconditionally close all file descriptors · eadc3bcd
      Alex Crichton 提交于
      The logic for only closing file descriptors >= 3 was inherited from quite some
      time ago and ends up meaning that some internal APIs are less consistent than
      they should be. By unconditionally closing everything entering a `FileDesc` we
      ensure that we're consistent in our behavior as well as robustly handling the
      stdio case.
      eadc3bcd
    • A
      std: Set CLOEXEC for all fds opened on unix · d6c72306
      Alex Crichton 提交于
      This commit starts to set the CLOEXEC flag for all files and sockets opened by
      the standard library by default on all unix platforms. There are a few points of
      note in this commit:
      
      * The implementation is not 100% satisfactory in the face of threads. File
        descriptors only have the `F_CLOEXEC` flag set *after* they are opened,
        allowing for a fork/exec to happen in the middle and leak the descriptor.
        Some platforms do support atomically opening a descriptor while setting the
        `CLOEXEC` flag, and it is left as a future extension to bind these apis as it
        is unclear how to do so nicely at this time.
      
      * The implementation does not offer a method of opting into the old behavior of
        not setting `CLOEXEC`. This will possibly be added in the future through
        extensions on `OpenOptions`, for example.
      
      * This change does not yet audit any Windows APIs to see if the handles are
        inherited by default by accident.
      
      This is a breaking change for users who call `fork` or `exec` outside of the
      standard library itself and expect file descriptors to be inherted. All file
      descriptors created by the standard library will no longer be inherited.
      
      [breaking-change]
      d6c72306
  4. 13 3月, 2015 1 次提交
  5. 12 2月, 2015 1 次提交
    • A
      std: Add a `net` module for TCP/UDP · 395709ca
      Alex Crichton 提交于
      This commit is an implementation of [RFC 807][rfc] which adds a `std::net`
      module for basic neworking based on top of `std::io`. This module serves as a
      replacement for the `std::old_io::net` module and networking primitives in
      `old_io`.
      
      [rfc]: fillmein
      
      The major focus of this redesign is to cut back on the level of abstraction to
      the point that each of the networking types is just a bare socket. To this end
      functionality such as timeouts and cloning has been removed (although cloning
      can be done through `duplicate`, it may just yield an error).
      
      With this `net` module comes a new implementation of `SocketAddr` and `IpAddr`.
      This work is entirely based on #20785 and the only changes were to alter the
      in-memory representation to match the `libc`-expected variants and to move from
      public fields to accessors.
      395709ca
  6. 10 2月, 2015 1 次提交