Skip to content

Commit 41a44a0

Browse files
committed
Change FD_SETSIZE to c_int
1 parent 7a012b6 commit 41a44a0

File tree

15 files changed

+27
-27
lines changed

15 files changed

+27
-27
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
@@ -2140,7 +2140,7 @@ pub const POWER_8: ::c_int = 0x10000;
21402140
pub const POWER_9: ::c_int = 0x20000;
21412141

21422142
// sys/time.h
2143-
pub const FD_SETSIZE: usize = 65534;
2143+
pub const FD_SETSIZE: ::c_int = 65534;
21442144
pub const TIMEOFDAY: ::c_int = 9;
21452145
pub const CLOCK_REALTIME: ::clockid_t = TIMEOFDAY as clockid_t;
21462146
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
@@ -4053,7 +4053,7 @@ pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
40534053
pub const MINSIGSTKSZ: ::size_t = 32768;
40544054
pub const SIGSTKSZ: ::size_t = 131072;
40554055

4056-
pub const FD_SETSIZE: usize = 1024;
4056+
pub const FD_SETSIZE: ::c_int = 1024;
40574057

40584058
pub const ST_NOSUID: ::c_ulong = 2;
40594059

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ pub const SCHED_FIFO: ::c_int = 1;
12041204
pub const SCHED_OTHER: ::c_int = 2;
12051205
pub const SCHED_RR: ::c_int = 3;
12061206

1207-
pub const FD_SETSIZE: usize = 1024;
1207+
pub const FD_SETSIZE: ::c_int = 1024;
12081208

12091209
pub const ST_NOSUID: ::c_ulong = 2;
12101210

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
@@ -1826,7 +1826,7 @@ pub const _SC_SCHED_RT_TS: ::c_int = 2001;
18261826
pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
18271827
pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
18281828

1829-
pub const FD_SETSIZE: usize = 0x100;
1829+
pub const FD_SETSIZE: ::c_int = 0x100;
18301830

18311831
pub const ST_NOSUID: ::c_ulong = 8;
18321832

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ pub const _SC_AVPHYS_PAGES: ::c_int = 501;
12661266
pub const _SC_NPROCESSORS_CONF: ::c_int = 502;
12671267
pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
12681268

1269-
pub const FD_SETSIZE: usize = 1024;
1269+
pub const FD_SETSIZE: ::c_int = 1024;
12701270

12711271
pub const SCHED_FIFO: ::c_int = 1;
12721272
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
@@ -1099,7 +1099,7 @@ pub const SA_ONESHOT: ::c_int = SA_RESETHAND;
10991099
pub const SS_ONSTACK: ::c_int = 0x1;
11001100
pub const SS_DISABLE: ::c_int = 0x2;
11011101

1102-
pub const FD_SETSIZE: usize = 1024;
1102+
pub const FD_SETSIZE: ::c_int = 1024;
11031103

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

src/unix/hermit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ s_no_extra_traits! {
6666
}
6767

6868
pub struct fd_set {
69-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
69+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
7070
}
7171

7272
pub struct sockaddr_storage {
@@ -638,7 +638,7 @@ pub const F_CNVT: ::c_int = 12;
638638
pub const F_RSETLKW: ::c_int = 13;
639639
pub const F_DUPFD_CLOEXEC: ::c_int = 14;
640640

641-
pub const FD_SETSIZE: usize = 1024;
641+
pub const FD_SETSIZE: ::c_int = 1024;
642642

643643
// Dummy
644644
pub const FIOCLEX: ::c_int = 0x5451;

src/unix/linux_like/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ s! {
8989
}
9090

9191
pub struct fd_set {
92-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
92+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
9393
}
9494

9595
pub struct tm {
@@ -1069,7 +1069,7 @@ pub const PATH_MAX: ::c_int = 4096;
10691069

10701070
pub const UIO_MAXIOV: ::c_int = 1024;
10711071

1072-
pub const FD_SETSIZE: usize = 1024;
1072+
pub const FD_SETSIZE: ::c_int = 1024;
10731073

10741074
pub const EPOLLIN: ::c_int = 0x1;
10751075
pub const EPOLLPRI: ::c_int = 0x2;

src/unix/newlib/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ s! {
187187
}
188188

189189
pub struct fd_set { // Unverified
190-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
190+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
191191
}
192192

193193
pub struct passwd { // Unverified
@@ -299,11 +299,11 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
299299

300300
cfg_if! {
301301
if #[cfg(any(target_os = "horizon", target_os = "espidf"))] {
302-
pub const FD_SETSIZE: usize = 64;
302+
pub const FD_SETSIZE: ::c_int = 64;
303303
} else if #[cfg(target_os = "vita")] {
304-
pub const FD_SETSIZE: usize = 256;
304+
pub const FD_SETSIZE: ::c_int = 256;
305305
} else {
306-
pub const FD_SETSIZE: usize = 1024;
306+
pub const FD_SETSIZE: ::c_int = 1024;
307307
}
308308
}
309309
// intentionally not public, only used for fd_set

src/unix/nto/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ s! {
154154
}
155155

156156
pub struct fd_set {
157-
fds_bits: [::c_uint; 2 * FD_SETSIZE / ULONG_SIZE],
157+
fds_bits: [::c_uint; 2 * FD_SETSIZE as usize / ULONG_SIZE],
158158
}
159159

160160
pub struct tm {
@@ -1383,7 +1383,7 @@ pub const PATH_MAX: ::c_int = 1024;
13831383

13841384
pub const UIO_MAXIOV: ::c_int = 1024;
13851385

1386-
pub const FD_SETSIZE: usize = 256;
1386+
pub const FD_SETSIZE: ::c_int = 256;
13871387

13881388
pub const TCIOFF: ::c_int = 0x0002;
13891389
pub const TCION: ::c_int = 0x0003;

src/unix/redox/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ s! {
123123
}
124124

125125
pub struct fd_set {
126-
fds_bits: [::c_ulong; ::FD_SETSIZE / ULONG_SIZE],
126+
fds_bits: [::c_ulong; ::FD_SETSIZE as usize / ULONG_SIZE],
127127
}
128128

129129
pub struct in_addr {
@@ -692,7 +692,7 @@ pub const MS_INVALIDATE: ::c_int = 0x0002;
692692
pub const MS_SYNC: ::c_int = 0x0004;
693693

694694
// sys/select.h
695-
pub const FD_SETSIZE: usize = 1024;
695+
pub const FD_SETSIZE: ::c_int = 1024;
696696

697697
// sys/socket.h
698698
pub const AF_INET: ::c_int = 2;

src/unix/solarish/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ s_no_extra_traits! {
518518

519519
pub struct fd_set {
520520
#[cfg(target_pointer_width = "64")]
521-
fds_bits: [i64; FD_SETSIZE / 64],
521+
fds_bits: [i64; FD_SETSIZE as usize / 64],
522522
#[cfg(target_pointer_width = "32")]
523-
fds_bits: [i32; FD_SETSIZE / 32],
523+
fds_bits: [i32; FD_SETSIZE as usize / 32],
524524
}
525525

526526
pub struct sockaddr_storage {
@@ -1250,9 +1250,9 @@ pub const IPV6_V6ONLY: ::c_int = 0x27;
12501250

12511251
cfg_if! {
12521252
if #[cfg(target_pointer_width = "64")] {
1253-
pub const FD_SETSIZE: usize = 65536;
1253+
pub const FD_SETSIZE: ::c_int = 65536;
12541254
} else {
1255-
pub const FD_SETSIZE: usize = 1024;
1255+
pub const FD_SETSIZE: ::c_int = 1024;
12561256
}
12571257
}
12581258

src/wasi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub const F_SETFD: c_int = 2;
206206
pub const F_GETFL: c_int = 3;
207207
pub const F_SETFL: c_int = 4;
208208
pub const FD_CLOEXEC: c_int = 1;
209-
pub const FD_SETSIZE: size_t = 1024;
209+
pub const FD_SETSIZE: c_int = 1024;
210210
pub const O_APPEND: c_int = 0x0001;
211211
pub const O_DSYNC: c_int = 0x0002;
212212
pub const O_NONBLOCK: c_int = 0x0004;

0 commit comments

Comments
 (0)