Skip to content

Commit a65f368

Browse files
committed
Change FD_SETSIZE to c_int
1 parent d0ce87b commit a65f368

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
@@ -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
@@ -4364,7 +4364,7 @@ pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
43644364
pub const MINSIGSTKSZ: ::size_t = 32768;
43654365
pub const SIGSTKSZ: ::size_t = 131072;
43664366

4367-
pub const FD_SETSIZE: usize = 1024;
4367+
pub const FD_SETSIZE: ::c_int = 1024;
43684368

43694369
pub const ST_NOSUID: ::c_ulong = 2;
43704370

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
@@ -1860,7 +1860,7 @@ pub const _SC_SCHED_RT_TS: ::c_int = 2001;
18601860
pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
18611861
pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
18621862

1863-
pub const FD_SETSIZE: usize = 0x100;
1863+
pub const FD_SETSIZE: ::c_int = 0x100;
18641864

18651865
pub const ST_NOSUID: ::c_ulong = 8;
18661866

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ pub const _SC_AVPHYS_PAGES: ::c_int = 501;
13741374
pub const _SC_NPROCESSORS_CONF: ::c_int = 502;
13751375
pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
13761376

1377-
pub const FD_SETSIZE: usize = 1024;
1377+
pub const FD_SETSIZE: ::c_int = 1024;
13781378

13791379
pub const SCHED_FIFO: ::c_int = 1;
13801380
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
@@ -750,7 +750,7 @@ pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
750750
pub const STDIN_FILENO: c_long = 0;
751751
pub const STDOUT_FILENO: c_long = 1;
752752
pub const STDERR_FILENO: c_long = 2;
753-
pub const __FD_SETSIZE: usize = 256;
753+
pub const __FD_SETSIZE: ::c_int = 256;
754754
pub const R_OK: ::c_int = 4;
755755
pub const W_OK: ::c_int = 2;
756756
pub const X_OK: ::c_int = 1;
@@ -792,7 +792,7 @@ pub const PDP_ENDIAN: usize = 3412;
792792
pub const BYTE_ORDER: usize = 1234;
793793

794794
// sys/select.h
795-
pub const FD_SETSIZE: usize = 256;
795+
pub const FD_SETSIZE: ::c_int = 256;
796796
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
797797
pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32;
798798
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 28;
@@ -980,8 +980,8 @@ pub const _POSIX_MQ_OPEN_MAX: usize = 8;
980980
pub const _POSIX_MQ_PRIO_MAX: usize = 32;
981981
pub const _POSIX_NAME_MAX: usize = 14;
982982
pub const _POSIX_NGROUPS_MAX: usize = 8;
983-
pub const _POSIX_OPEN_MAX: usize = 20;
984-
pub const _POSIX_FD_SETSIZE: usize = 20;
983+
pub const _POSIX_OPEN_MAX: ::c_int = 20;
984+
pub const _POSIX_FD_SETSIZE: ::c_int = 20;
985985
pub const _POSIX_PATH_MAX: usize = 256;
986986
pub const _POSIX_PIPE_BUF: usize = 512;
987987
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
@@ -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
@@ -171,7 +171,7 @@ s! {
171171
}
172172

173173
pub struct fd_set { // Unverified
174-
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
174+
fds_bits: [::c_ulong; FD_SETSIZE as usize / ULONG_SIZE],
175175
}
176176

177177
pub struct passwd { // Unverified
@@ -283,11 +283,11 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
283283

284284
cfg_if! {
285285
if #[cfg(any(target_os = "horizon", target_os = "espidf"))] {
286-
pub const FD_SETSIZE: usize = 64;
286+
pub const FD_SETSIZE: ::c_int = 64;
287287
} else if #[cfg(target_os = "vita")] {
288-
pub const FD_SETSIZE: usize = 256;
288+
pub const FD_SETSIZE: ::c_int = 256;
289289
} else {
290-
pub const FD_SETSIZE: usize = 1024;
290+
pub const FD_SETSIZE: ::c_int = 1024;
291291
}
292292
}
293293
// 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
@@ -116,7 +116,7 @@ s! {
116116
}
117117

118118
pub struct fd_set {
119-
fds_bits: [::c_ulong; ::FD_SETSIZE / ULONG_SIZE],
119+
fds_bits: [::c_ulong; ::FD_SETSIZE as usize / ULONG_SIZE],
120120
}
121121

122122
pub struct in_addr {
@@ -758,7 +758,7 @@ pub const MS_INVALIDATE: ::c_int = 0x0002;
758758
pub const MS_SYNC: ::c_int = 0x0004;
759759

760760
// sys/select.h
761-
pub const FD_SETSIZE: usize = 1024;
761+
pub const FD_SETSIZE: ::c_int = 1024;
762762

763763
// sys/socket.h
764764
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)