Skip to content

Commit 6985281

Browse files
magicantAndy-Python-Programmer
authored andcommitted
Change FD_SETSIZE to c_int
1 parent 90d7c9b commit 6985281

File tree

15 files changed

+29
-29
lines changed

15 files changed

+29
-29
lines changed

src/fuchsia/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ s! {
380380
}
381381

382382
pub struct fd_set {
383-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
383+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
384384
}
385385

386386
pub struct tm {
@@ -1827,7 +1827,7 @@ pub const SS_DISABLE: ::c_int = 2;
18271827

18281828
pub const PATH_MAX: ::c_int = 4096;
18291829

1830-
pub const FD_SETSIZE: usize = 1024;
1830+
pub const FD_SETSIZE: ::c_int = 1024;
18311831

18321832
pub const EPOLLIN: ::c_int = 0x1;
18331833
pub const EPOLLPRI: ::c_int = 0x2;

src/unix/aix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ pub const POWER_8: ::c_int = 0x10000;
21182118
pub const POWER_9: ::c_int = 0x20000;
21192119

21202120
// sys/time.h
2121-
pub const FD_SETSIZE: usize = 65534;
2121+
pub const FD_SETSIZE: ::c_int = 65534;
21222122
pub const TIMEOFDAY: ::c_int = 9;
21232123
pub const CLOCK_REALTIME: ::clockid_t = TIMEOFDAY as clockid_t;
21242124
pub const CLOCK_MONOTONIC: ::clockid_t = 10;

src/unix/bsd/apple/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4384,7 +4384,7 @@ pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
43844384
pub const MINSIGSTKSZ: ::size_t = 32768;
43854385
pub const SIGSTKSZ: ::size_t = 131072;
43864386

4387-
pub const FD_SETSIZE: usize = 1024;
4387+
pub const FD_SETSIZE: ::c_int = 1024;
43884388

43894389
pub const ST_NOSUID: ::c_ulong = 2;
43904390

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ pub const SCHED_FIFO: ::c_int = 1;
11931193
pub const SCHED_OTHER: ::c_int = 2;
11941194
pub const SCHED_RR: ::c_int = 3;
11951195

1196-
pub const FD_SETSIZE: usize = 1024;
1196+
pub const FD_SETSIZE: ::c_int = 1024;
11971197

11981198
pub const ST_NOSUID: ::c_ulong = 2;
11991199

src/unix/bsd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ s! {
5959
pub struct fd_set {
6060
#[cfg(all(target_pointer_width = "64",
6161
any(target_os = "freebsd", target_os = "dragonfly")))]
62-
fds_bits: [i64; FD_SETSIZE / 64],
62+
fds_bits: [i64; FD_SETSIZE as usize / 64],
6363
#[cfg(not(all(target_pointer_width = "64",
6464
any(target_os = "freebsd", target_os = "dragonfly"))))]
65-
fds_bits: [i32; FD_SETSIZE / 32],
65+
fds_bits: [i32; FD_SETSIZE as usize / 32],
6666
}
6767

6868
pub struct tm {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ pub const _SC_SCHED_RT_TS: ::c_int = 2001;
18471847
pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
18481848
pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
18491849

1850-
pub const FD_SETSIZE: usize = 0x100;
1850+
pub const FD_SETSIZE: ::c_int = 0x100;
18511851

18521852
pub const ST_NOSUID: ::c_ulong = 8;
18531853

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ pub const _SC_AVPHYS_PAGES: ::c_int = 501;
14221422
pub const _SC_NPROCESSORS_CONF: ::c_int = 502;
14231423
pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
14241424

1425-
pub const FD_SETSIZE: usize = 1024;
1425+
pub const FD_SETSIZE: ::c_int = 1024;
14261426

14271427
pub const SCHED_FIFO: ::c_int = 1;
14281428
pub const SCHED_OTHER: ::c_int = 2;

src/unix/haiku/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ pub const SA_ONESHOT: ::c_int = SA_RESETHAND;
11001100
pub const SS_ONSTACK: ::c_int = 0x1;
11011101
pub const SS_DISABLE: ::c_int = 0x2;
11021102

1103-
pub const FD_SETSIZE: usize = 1024;
1103+
pub const FD_SETSIZE: ::c_int = 1024;
11041104

11051105
pub const RTLD_LOCAL: ::c_int = 0x0;
11061106
pub const RTLD_NOW: ::c_int = 0x1;

src/unix/hurd/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ pub const SHM_UNLOCK: ::c_int = 12;
12111211
pub const STDIN_FILENO: ::c_int = 0;
12121212
pub const STDOUT_FILENO: ::c_int = 1;
12131213
pub const STDERR_FILENO: ::c_int = 2;
1214-
pub const __FD_SETSIZE: usize = 256;
1214+
pub const __FD_SETSIZE: ::c_int = 256;
12151215
pub const R_OK: ::c_int = 4;
12161216
pub const W_OK: ::c_int = 2;
12171217
pub const X_OK: ::c_int = 1;
@@ -1256,7 +1256,7 @@ pub const PDP_ENDIAN: usize = 3412;
12561256
pub const BYTE_ORDER: usize = 1234;
12571257

12581258
// sys/select.h
1259-
pub const FD_SETSIZE: usize = 256;
1259+
pub const FD_SETSIZE: ::c_int = 256;
12601260
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
12611261
pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
12621262
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 28;
@@ -1588,8 +1588,8 @@ pub const _POSIX_MQ_OPEN_MAX: usize = 8;
15881588
pub const _POSIX_MQ_PRIO_MAX: usize = 32;
15891589
pub const _POSIX_NAME_MAX: usize = 14;
15901590
pub const _POSIX_NGROUPS_MAX: usize = 8;
1591-
pub const _POSIX_OPEN_MAX: usize = 20;
1592-
pub const _POSIX_FD_SETSIZE: usize = 20;
1591+
pub const _POSIX_OPEN_MAX: ::c_int = 20;
1592+
pub const _POSIX_FD_SETSIZE: ::c_int = 20;
15931593
pub const _POSIX_PATH_MAX: usize = 256;
15941594
pub const _POSIX_PIPE_BUF: usize = 512;
15951595
pub const _POSIX_RE_DUP_MAX: usize = 255;

src/unix/linux_like/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ s! {
9292
}
9393

9494
pub struct fd_set {
95-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
95+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
9696
}
9797

9898
pub struct tm {
@@ -1072,7 +1072,7 @@ pub const PATH_MAX: ::c_int = 4096;
10721072

10731073
pub const UIO_MAXIOV: ::c_int = 1024;
10741074

1075-
pub const FD_SETSIZE: usize = 1024;
1075+
pub const FD_SETSIZE: ::c_int = 1024;
10761076

10771077
pub const EPOLLIN: u32 = 0x1;
10781078
pub const EPOLLPRI: u32 = 0x2;

0 commit comments

Comments
 (0)