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

Add unix socket support to the standard library #32302

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

sfackler
Copy link
Member

@sfackler
Copy link
Member Author

This is a straight copy-paste from the rust-lang-nursery/unix-socket crate with the linux-specific SocketAddrExt trait removed and interior nulls disallowed in paths.

}
}

struct Inner(RawFd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have std::sys::fd::FileDesc for this, perhaps this could use that?

@sfackler
Copy link
Member Author

Updated

let (addr, len) = try!(sockaddr_un(path));

let ret = libc::connect(*inner.as_inner(), &addr as *const _ as *const _, len);
if ret < 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use cvt?

@sfackler
Copy link
Member Author

Re-updated

@alexcrichton
Copy link
Member

@bors: r+ 48ed34c6dcc7d24f0388f43262fa5e79d197f110

@bors
Copy link
Contributor

bors commented Mar 19, 2016

⌛ Testing commit 48ed34c with merge faeb1af...

@alexcrichton
Copy link
Member

@bors: retry force clean

@bors
Copy link
Contributor

bors commented Mar 20, 2016

⌛ Testing commit 48ed34c with merge 5098719...

@bors
Copy link
Contributor

bors commented Mar 20, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Mar 20, 2016

📌 Commit 94de5ba has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 20, 2016

⌛ Testing commit 94de5ba with merge 0cfbb37...

@bors
Copy link
Contributor

bors commented Mar 20, 2016

💔 Test failed - auto-mac-64-nopt-t

@sfackler sfackler force-pushed the unix-socket branch 2 times, most recently from f28123c to ab20e8d Compare March 20, 2016 17:57
@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Mar 20, 2016

📌 Commit ab20e8d has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 20, 2016

⌛ Testing commit ab20e8d with merge b17aacc...

bors added a commit that referenced this pull request Mar 20, 2016
Add unix socket support to the standard library

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Mar 21, 2016

💔 Test failed - auto-mac-64-nopt-t

@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Mar 21, 2016

📌 Commit c0d989e has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 21, 2016

⌛ Testing commit c0d989e with merge 6c4b1f1...

bors added a commit that referenced this pull request Mar 21, 2016
Add unix socket support to the standard library

r? @alexcrichton
@bors bors merged commit c0d989e into rust-lang:master Mar 21, 2016
@sfackler sfackler added the relnotes Marks issues that should be documented in the release notes of the next release. label Apr 11, 2016
@sfackler sfackler deleted the unix-socket branch November 26, 2016 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants