Skip to content

Commit 03ed3ff

Browse files
committed
Move various POLL* and RTLD_LAZY constants into submodules.
Unfortunately, these differ on Haiku, and using #[cfg(...)] is not allowed in unix/mod.rs.
1 parent 086d575 commit 03ed3ff

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

src/unix/bsd/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ pub const MDMBUF: ::tcflag_t = 0x00100000;
299299
pub const WNOHANG: ::c_int = 0x00000001;
300300
pub const WUNTRACED: ::c_int = 0x00000002;
301301

302+
pub const RTLD_LAZY: ::c_int = 0x1;
302303
pub const RTLD_NOW: ::c_int = 0x2;
303304
pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
304305
pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
@@ -313,6 +314,12 @@ pub const TCP_MAXSEG: ::c_int = 2;
313314

314315
pub const PIPE_BUF: usize = 512;
315316

317+
pub const POLLIN: ::c_short = 0x1;
318+
pub const POLLPRI: ::c_short = 0x2;
319+
pub const POLLOUT: ::c_short = 0x4;
320+
pub const POLLERR: ::c_short = 0x8;
321+
pub const POLLHUP: ::c_short = 0x10;
322+
pub const POLLNVAL: ::c_short = 0x20;
316323
pub const POLLRDNORM: ::c_short = 0x040;
317324
pub const POLLWRNORM: ::c_short = 0x004;
318325
pub const POLLRDBAND: ::c_short = 0x080;

src/unix/newlib/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,15 @@ pub const O_NONBLOCK: ::c_int = 16384;
435435
pub const O_ACCMODE: ::c_int = 3;
436436
pub const O_CLOEXEC: ::c_int = 0x80000;
437437

438+
pub const POLLIN: ::c_short = 0x1;
439+
pub const POLLPRI: ::c_short = 0x2;
440+
pub const POLLOUT: ::c_short = 0x4;
441+
pub const POLLERR: ::c_short = 0x8;
442+
pub const POLLHUP: ::c_short = 0x10;
443+
pub const POLLNVAL: ::c_short = 0x20;
444+
445+
pub const RTLD_LAZY: ::c_int = 0x1;
446+
438447
pub const STDIN_FILENO: ::c_int = 0;
439448
pub const STDOUT_FILENO: ::c_int = 1;
440449
pub const STDERR_FILENO: ::c_int = 2;

src/unix/notbsd/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ pub const SPLICE_F_MORE: ::c_uint = 0x04;
760760
pub const SPLICE_F_GIFT: ::c_uint = 0x08;
761761

762762
pub const RTLD_LOCAL: ::c_int = 0;
763+
pub const RTLD_LAZY: ::c_int = 1;
763764

764765
pub const POSIX_FADV_NORMAL: ::c_int = 0;
765766
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -793,6 +794,12 @@ pub const P_PGID: idtype_t = 2;
793794
pub const UTIME_OMIT: c_long = 1073741822;
794795
pub const UTIME_NOW: c_long = 1073741823;
795796

797+
pub const POLLIN: ::c_short = 0x1;
798+
pub const POLLPRI: ::c_short = 0x2;
799+
pub const POLLOUT: ::c_short = 0x4;
800+
pub const POLLERR: ::c_short = 0x8;
801+
pub const POLLHUP: ::c_short = 0x10;
802+
pub const POLLNVAL: ::c_short = 0x20;
796803
pub const POLLRDNORM: ::c_short = 0x040;
797804
pub const POLLRDBAND: ::c_short = 0x080;
798805

src/unix/solaris/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,13 @@ pub const GLOB_NOSPACE : ::c_int = -2;
766766
pub const GLOB_ABORTED : ::c_int = -1;
767767
pub const GLOB_NOMATCH : ::c_int = -3;
768768

769+
pub const POLLIN: ::c_short = 0x1;
770+
pub const POLLPRI: ::c_short = 0x2;
771+
pub const POLLOUT: ::c_short = 0x4;
772+
pub const POLLERR: ::c_short = 0x8;
773+
pub const POLLHUP: ::c_short = 0x10;
774+
pub const POLLNVAL: ::c_short = 0x20;
775+
769776
pub const POSIX_MADV_NORMAL: ::c_int = 0;
770777
pub const POSIX_MADV_RANDOM: ::c_int = 1;
771778
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
@@ -1100,6 +1107,7 @@ pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
11001107
pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
11011108
pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void;
11021109

1110+
pub const RTLD_LAZY: ::c_int = 0x1;
11031111
pub const RTLD_NOW: ::c_int = 0x2;
11041112
pub const RTLD_NOLOAD: ::c_int = 0x4;
11051113
pub const RTLD_GLOBAL: ::c_int = 0x100;

src/unix/uclibc/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ pub const SPLICE_F_MORE: ::c_uint = 0x04;
928928
pub const SPLICE_F_GIFT: ::c_uint = 0x08;
929929

930930
pub const RTLD_LOCAL: ::c_int = 0;
931+
pub const RTLD_LAZY: ::c_int = 1;
931932

932933
pub const POSIX_FADV_NORMAL: ::c_int = 0;
933934
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -944,6 +945,13 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
944945
pub const LOG_FTP: ::c_int = 11 << 3;
945946
pub const LOG_PERROR: ::c_int = 0x20;
946947

948+
pub const POLLIN: ::c_short = 0x1;
949+
pub const POLLPRI: ::c_short = 0x2;
950+
pub const POLLOUT: ::c_short = 0x4;
951+
pub const POLLERR: ::c_short = 0x8;
952+
pub const POLLHUP: ::c_short = 0x10;
953+
pub const POLLNVAL: ::c_short = 0x20;
954+
947955
pub const PIPE_BUF: usize = 4096;
948956

949957
pub const SI_LOAD_SHIFT: ::c_uint = 16;

0 commit comments

Comments
 (0)