summary refs log tree commit diff
path: root/sysdeps/i386/bits/select.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/bits/select.h')
-rw-r--r--sysdeps/i386/bits/select.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/i386/bits/select.h b/sysdeps/i386/bits/select.h
index 8c9a5434b9..edcb562945 100644
--- a/sysdeps/i386/bits/select.h
+++ b/sysdeps/i386/bits/select.h
@@ -24,29 +24,30 @@
 #if defined __GNUC__ && __GNUC__ >= 2
 
 # define __FD_ZERO(fdsetp) \
-  __asm__ __volatile__ ("cld ; rep ; stosl"				      \
-			: "=m" (*(__fd_set *) (fdsetp))			      \
+  __asm__ __volatile__ ("cld; rep; stosl"				      \
+			: "=m" (((__fd_mask *)				      \
+				 (fdsetp))[__FDELT (__FD_SETSIZE)])	      \
 			: "a" (0), "c" (sizeof (__fd_set)		      \
 					/ sizeof (__fd_mask)),		      \
 			  "D" ((__fd_set *) (fdsetp))			      \
 			:"cx","di")
 # define __FD_SET(fd, fdsetp) \
   __asm__ __volatile__ ("btsl %1,%0"					      \
-			: "=m" (((__fd_set *) (fdsetp))[__FDELT (fd)])	      \
+			: "=m" (((__fd_mask *) (fdsetp))[__FDELT (fd)])	      \
 			: "r" (((int) (fd)) % __NFDBITS)		      \
 			: "cc")
 # define __FD_CLR(fd, fdsetp) \
   __asm__ __volatile__ ("btrl %1,%0"					      \
-			: "=m" (((__fd_set *) (fdsetp))[__FDELT (fd)])	      \
+			: "=m" (((__fd_mask *) (fdsetp))[__FDELT (fd)])	      \
 			: "r" (((int) (fd)) % __NFDBITS)		      \
 			: "cc")
 # define __FD_ISSET(fd, fdsetp) \
   (__extension__							      \
-   ({unsigned int __result;						      \
-     __asm__ __volatile__ ("btl %1,%2 ; setcb %b0; andl $1,%0"		      \
+   ({register char __result;						      \
+     __asm__ __volatile__ ("btl %1,%2 ; setcb %b0"			      \
 			   : "=q" (__result)				      \
 			   : "r" (((int) (fd)) % __NFDBITS),		      \
-			     "m" (((__fd_set *) (fdsetp))[__FDELT (fd)])      \
+			     "m" (((__fd_mask *) (fdsetp))[__FDELT (fd)])     \
 			   : "cc");					      \
      __result; }))