From 8a8c59b9c20fa9dad2fd212bf9efca3959a8d51f Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 6 Sep 2000 20:55:46 +0000 Subject: 2000-09-06 Jeff Johnston * libc/include/sys/types.h (FD_ZERO): Remove call to bzero and inline code to prevent having to include another header file. --- newlib/ChangeLog | 5 +++++ newlib/libc/include/sys/types.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'newlib') diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 5bf1caf8a..636154ca5 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2000-09-06 Jeff Johnston + + * libc/include/sys/types.h (FD_ZERO): Remove call to bzero and + inline code to prevent having to include another header file. + Wed Sep 6 15:06:40 2000 Christopher Faylor * Makefile.am: Fix space vs. tab problem in install-data-local. diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 7d2e52461..d87a119cd 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -164,7 +164,12 @@ typedef struct _types_fd_set { # define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) # define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) # define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -# define FD_ZERO(p) bzero((caddr_t)(p), sizeof (*(p))) +# define FD_ZERO(p) (__extension__ (void)({ \ + int i; \ + char *__tmp = (char *)p; \ + for (i = 0; i < sizeof (*(p)); ++i) \ + *__tmp++ = 0; \ +})) # endif /* ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) */ -- cgit v1.2.3