Kernel 2.0.2 (possibly earlier?): Bug in FD_ZERO()

Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Fri, 05 Jul 1996 22:23:40 -0400


Discovered when trying to compile sysvinit-2.64: FD_ZERO() uses
__FDSET_INTS, current usage (from looking at the definition for
linux/include/linux/posix_types.h:struct fd_set) is __FDSET_LONGS. The
following patches this for i386 (long =3D=3D int), similar patches are
needed for sparc and ppc that are still using __FDSET_INTS.

*** linux/include/asm/posix_types.h~ Tue Jul 2 12:08:43 1996
--- linux/include/asm/posix_types.h Fri Jul 5 22:04:26 1996
***************
*** 57,63 ****
#define __FD_ZERO(fdsetp) \
__asm__ __volatile__("cld ; rep ; stosl" \
:"=3Dm" (*(__kernel_fd_set *) (fdsetp)) \
! :"a" (0), "c" (__FDSET_INTS), \
"D" ((__kernel_fd_set *) (fdsetp)) :"cx","di")
=20
#endif
--- 57,63 ----
#define __FD_ZERO(fdsetp) \
__asm__ __volatile__("cld ; rep ; stosl" \
:"=3Dm" (*(__kernel_fd_set *) (fdsetp)) \
! :"a" (0), "c" (__FDSET_LONGS), \
"D" ((__kernel_fd_set *) (fdsetp)) :"cx","di")
=20
#endif

------
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vi=F1a del Mar, Chile +56 32 672616