Skip to content

Commit 52f4f39

Browse files
committed
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.
1 parent fb83189 commit 52f4f39

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ pub const SO_RCVBUF: ::c_int = 8;
373373
pub const SO_KEEPALIVE: ::c_int = 9;
374374
pub const SO_OOBINLINE: ::c_int = 10;
375375
pub const SO_LINGER: ::c_int = 13;
376+
pub const SO_REUSEPORT: ::c_int = 15;
376377
pub const SO_RCVLOWAT: ::c_int = 18;
377378
pub const SO_SNDLOWAT: ::c_int = 19;
378379
pub const SO_RCVTIMEO: ::c_int = 20;

0 commit comments

Comments
 (0)