From 52f4f39a77fb88fc7147256642edeae18bf08bc5 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 22 Nov 2015 14:23:59 +0100 Subject: [PATCH] Add SO_REUSEPORT for Android The `net2` crate currently fails to cross-compile to Android with ``error: unresolved name `libc::SO_REUSEPORT` `` According to http://stackoverflow.com/a/14388707/1162888, Android is essentially the same as Linux for the purpose of socket features support, and the Linux kernel has supported `SO_REUSEPORT` since version 3.9. According to http://android.stackexchange.com/a/51656, Android has had more recent kernels than that since version 4.4 Kit Kat. --- src/unix/notbsd/android/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index f00cebd05c34e..25692daa14296 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -373,6 +373,7 @@ pub const SO_RCVBUF: ::c_int = 8; pub const SO_KEEPALIVE: ::c_int = 9; pub const SO_OOBINLINE: ::c_int = 10; pub const SO_LINGER: ::c_int = 13; +pub const SO_REUSEPORT: ::c_int = 15; pub const SO_RCVLOWAT: ::c_int = 18; pub const SO_SNDLOWAT: ::c_int = 19; pub const SO_RCVTIMEO: ::c_int = 20;