Skip to content

Commit 916b82d

Browse files
committed
Auto merge of rust-lang#717 - Susurrus:sock_nonblock, r=alexcrichton
Add more socket flags for Android and the BSDs
2 parents 10af28f + 7591346 commit 916b82d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@ pub const ONLRET: ::tcflag_t = 0x40;
733733
pub const CDTRCTS: ::tcflag_t = 0x00020000;
734734
pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS;
735735

736+
pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
737+
pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
738+
736739
// dirfd() is a macro on netbsd to access
737740
// the first field of the struct where dirp points to:
738741
// http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ pub const OLCUC: ::tcflag_t = 0x20;
579579
pub const ONOCR: ::tcflag_t = 0x40;
580580
pub const ONLRET: ::tcflag_t = 0x80;
581581

582+
pub const SOCK_CLOEXEC: ::c_int = 0x8000;
583+
pub const SOCK_NONBLOCK: ::c_int = 0x4000;
584+
pub const SOCK_DNS: ::c_int = 0x1000;
585+
582586
extern {
583587
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
584588
pub fn getnameinfo(sa: *const ::sockaddr,

src/unix/notbsd/android/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,8 @@ pub const POLLWRBAND: ::c_short = 0x200;
833833
pub const SFD_CLOEXEC: ::c_int = O_CLOEXEC;
834834
pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK;
835835

836+
pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
837+
836838
f! {
837839
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
838840
for slot in cpuset.__bits.iter_mut() {

0 commit comments

Comments
 (0)