Skip to content

Commit 5ab4734

Browse files
krajakiernan
authored andcommitted
musl: Define SOCK_NONBLOCK with O_NONBLOCK
Much like glibc, these defines are same on musl [1] [2] therefore consolidate the definition in one place for SOCK_NONBLOCK [1] https://github.com/search?q=repo%3Abminor%2Fmusl++%22%23define+SOCK_NONBLOCK%22&type=code [2] https://github.com/search?q=repo%3Abminor%2Fmusl++%22%23define+O_NONBLOCK%22&type=code
1 parent 0644a87 commit 5ab4734

File tree

7 files changed

+1
-11
lines changed

7 files changed

+1
-11
lines changed

src/unix/linux_like/linux/musl/b32/arm/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ pub const O_SYNC: ::c_int = 1052672;
312312
pub const O_RSYNC: ::c_int = 1052672;
313313
pub const O_DSYNC: ::c_int = 4096;
314314

315-
pub const SOCK_NONBLOCK: ::c_int = 2048;
316-
317315
pub const MAP_ANON: ::c_int = 0x0020;
318316
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
319317
pub const MAP_DENYWRITE: ::c_int = 0x0800;

src/unix/linux_like/linux/musl/b32/hexagon.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ pub const SIG_SETMASK: ::c_int = 2; // FIXME check these
294294
pub const SIG_BLOCK: ::c_int = 0x000000;
295295
pub const SIG_UNBLOCK: ::c_int = 0x01;
296296
pub const SOCK_DGRAM: ::c_int = 2;
297-
pub const SOCK_NONBLOCK: ::c_int = 2048;
298297
pub const SOCK_SEQPACKET: ::c_int = 5;
299298
pub const SOCK_STREAM: ::c_int = 1;
300299
pub const SOL_CAIF: ::c_int = 278;

src/unix/linux_like/linux/musl/b32/mips/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ pub const O_SYNC: ::c_int = 0o40020;
251251
pub const O_RSYNC: ::c_int = 0o40020;
252252
pub const O_DSYNC: ::c_int = 0o020;
253253

254-
pub const SOCK_NONBLOCK: ::c_int = 0o200;
255-
256254
pub const MAP_ANON: ::c_int = 0x800;
257255
pub const MAP_GROWSDOWN: ::c_int = 0x1000;
258256
pub const MAP_DENYWRITE: ::c_int = 0x2000;

src/unix/linux_like/linux/musl/b32/powerpc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ pub const O_SYNC: ::c_int = 1052672;
244244
pub const O_RSYNC: ::c_int = 1052672;
245245
pub const O_DSYNC: ::c_int = 4096;
246246

247-
pub const SOCK_NONBLOCK: ::c_int = 2048;
248-
249247
pub const MAP_ANON: ::c_int = 0x0020;
250248
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
251249
pub const MAP_DENYWRITE: ::c_int = 0x0800;

src/unix/linux_like/linux/musl/b32/x86/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ pub const O_SYNC: ::c_int = 1052672;
301301
pub const O_RSYNC: ::c_int = 1052672;
302302
pub const O_DSYNC: ::c_int = 4096;
303303

304-
pub const SOCK_NONBLOCK: ::c_int = 2048;
305-
306304
pub const MAP_ANON: ::c_int = 0x0020;
307305
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
308306
pub const MAP_DENYWRITE: ::c_int = 0x0800;

src/unix/linux_like/linux/musl/b64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
134134
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
135135
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
136136

137-
pub const SOCK_NONBLOCK: ::c_int = 2048;
138-
139137
pub const SOCK_SEQPACKET: ::c_int = 5;
140138

141139
extern "C" {

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ pub const POSIX_MADV_DONTNEED: ::c_int = 4;
542542
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
543543

544544
pub const SOCK_DCCP: ::c_int = 6;
545+
pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
545546
pub const SOCK_PACKET: ::c_int = 10;
546547

547548
pub const SOMAXCONN: ::c_int = 128;

0 commit comments

Comments
 (0)