summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Polakov <apolyakov@beget.ru>2015-12-04 02:16:20 +0300
committerroot <admin@beget.ru>2015-12-04 02:17:13 +0300
commitea4752311746f4b0777b9842d70641c809917c66 (patch)
tree2c84fbaae7a9f3ed705de9add8034e403f40f65c /src
parentb4b76d0a28fce34a33ab0a8bc3ab6e9ccd7b3d9c (diff)
downloadnix-ea4752311746f4b0777b9842d70641c809917c66.zip
socket(): add protocol argument (breaking change)
Diffstat (limited to 'src')
-rw-r--r--src/sys/socket/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 8a6924d2..4f6add4c 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -367,7 +367,7 @@ pub fn recvmsg<'a, T>(fd: RawFd, iov: &[IoVec<&mut [u8]>], cmsg_buffer: Option<&
/// Create an endpoint for communication
///
/// [Further reading](http://man7.org/linux/man-pages/man2/socket.2.html)
-pub fn socket(domain: AddressFamily, ty: SockType, flags: SockFlag) -> Result<RawFd> {
+pub fn socket(domain: AddressFamily, ty: SockType, flags: SockFlag, protocol: c_int) -> Result<RawFd> {
let mut ty = ty as c_int;
let feat_atomic = features::socket_atomic_cloexec();
@@ -376,7 +376,7 @@ pub fn socket(domain: AddressFamily, ty: SockType, flags: SockFlag) -> Result<Ra
}
// TODO: Check the kernel version
- let res = unsafe { ffi::socket(domain as c_int, ty, 0) };
+ let res = unsafe { ffi::socket(domain as c_int, ty, protocol) };
if res < 0 {
return Err(Error::Sys(Errno::last()));