Skip to content

Commit 12a6403

Browse files
authored
[wasm64] Keep nfds_t 32-bit. NFC (#27115)
Use unsigned int for nfds_t instead of unsigned long. The number of file descriptors is already limited to 4096 (see `WASMFS_FD_MAX` or `FS.MAX_OPEN_FDS`), so a 64-bit nfds_t provides no benefit. Split out from #27108.
1 parent 065992a commit 12a6403

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ struct __sanitizer_pollfd {
869869
short revents;
870870
};
871871

872-
# if SANITIZER_ANDROID || SANITIZER_APPLE
872+
# if SANITIZER_ANDROID || SANITIZER_APPLE || SANITIZER_EMSCRIPTEN
873873
typedef unsigned __sanitizer_nfds_t;
874874
# else
875875
typedef unsigned long __sanitizer_nfds_t;

system/lib/libc/musl/include/poll.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ extern "C" {
2626
#define POLLRDHUP 0x2000
2727
#endif
2828

29-
typedef unsigned long nfds_t;
29+
// XXX Emscripten: nfds_t is kept 32-bit even on wasm64.
30+
typedef unsigned int nfds_t;
3031

3132
struct pollfd {
3233
int fd;

0 commit comments

Comments
 (0)