musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/include/sys/select.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011年08月27日 19:42:13 -0400
committerRich Felker <dalias@aerifal.cx>2011年08月27日 19:42:13 -0400
commit1f5ff26cd788d29c77e322e7584da46466723572 (patch)
tree5c3e281b3d3cf94142dd51d603e8c469ab6f928e /include/sys/select.h
parent291666a14a41fe46c1e302585de97b399ab631e7 (diff)
downloadmusl-1f5ff26cd788d29c77e322e7584da46466723572.tar.gz
fix broken FD_* macros on 64-bit targets
1 is too small if int is 32-bit but unsigned long is 64-bit. be explicit and use 1UL.
Diffstat (limited to 'include/sys/select.h')
-rw-r--r--include/sys/select.h 6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sys/select.h b/include/sys/select.h
index 7cb0af43..cbe35a4f 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -23,9 +23,9 @@ typedef struct
} fd_set;
#define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0)
-#define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1<<((d)%(8*sizeof(long)))))
-#define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1<<((d)%(8*sizeof(long)))))
-#define FD_ISSET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] & (1<<((d)%(8*sizeof(long)))))
+#define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))
+#define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))
+#define FD_ISSET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
int pselect (int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月05日 04:24:17 +0000

AltStyle によって変換されたページ (->オリジナル) /