This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
still problems with FD_ZERO
- To: egcs at cygnus dot com
- Subject: still problems with FD_ZERO
- From: Peter Schmid <schmid at ltoi dot iap dot physik dot tu-darmstadt dot de>
- Date: Fri, 27 Nov 1998 19:52:07 +0100 (MET)
How do I change the following function
#define __FD_ZERO(fdsetp) \
__asm__ __volatile__("cld ; rep ; stosl" \
:"=m" (*(__kernel_fd_set *) (fdsetp)) \
:"a" (0), "c" (__FDSET_LONGS), \
"D" ((__kernel_fd_set *) (fdsetp)) :"cx","di")
in such a way that the current egcs c compiler does not complain.
The proposed patch
# define __FD_ZERO(fdsetp) \
do { \
int __d0, __d1; \
__asm__ __volatile__ ("cld; rep; stosl" \
: "=m" (((__fd_mask *) \
(fdsetp))[__FDELT (__FD_SETSIZE)]), \
"=&c" (__d0), "=&D" (__d1) \
: "a" (0), "1" (sizeof (__fd_set) \
/ sizeof (__fd_mask)), \
"2" ((__fd_mask *) (fdsetp)) \
: "memory"); \
} while (0)
does not work for my system.
echo-area.c:1470: `__fd_mask' undeclared (first use in this function)
echo-area.c:1470: (Each undeclared identifier is reported only once
echo-area.c:1470: for each function it appears in.)
echo-area.c:1470: parse error before `)'
echo-area.c:1470: parse error before `)'
I believe the patch is for a different kernel version. I am using
linux 2.0.29 and gnulibc1 but the code for FD_ZERO is the same in
2.0.35.
Peter Schmid