Move the scope of the FD_SET, FD_CLR, FD_SETSIZE, FD_ISSET, and FD_SERO to the linux/posix_types.h scope and out of the linux/time.h scope.
Quoted 7 lines · On Tue, 2010-12-07 at 18:29 -0800, [email protected] wrote:
From: Charles Hardin <[email protected]>
This is a change to address a conflict in a time utility library that was using the kernel version of timespec and picked up the
FD_SETmacros and which caused a redefinition compiler errorSigned-off-by Charles Hardin <[email protected]>
No objection here, but I'm not sure if I'm the best to review this, as I'm not as familiar with the users of FD_*.
thanks
-john
Quoted 47 lines
--- include/linux/posix_types.h | 12 ++++++++++++ include/linux/time.h | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-)include/linux/posix_types.h +12
-0@@ -33,6 +33,18 @@#undef __FDMASK#define __FDMASK (d) (1UL << ((d) % __NFDBITS)) +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ <2 ) + +#define NFDBITS __NFDBITS + +#define FD_SETSIZE __FD_SETSIZE +#define FD_SET (fd,fdsetp) __FD_SET(fd,fdsetp) +#define FD_CLR (fd,fdsetp) __FD_CLR(fd,fdsetp) +#define FD_ISSET (fd,fdsetp) __FD_ISSET(fd,fdsetp) +#define FD_ZERO (fdsetp) __FD_ZERO(fdsetp) + +#endif /* not kernel and not glibc */ +typedef struct {unsigned long fds_bits [__FDSET_LONGS]; }__kernel_fd_set ;include/linux/time.h +0
-8@@ -254,14 +254,6 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns) }#endif /* __KERNEL__ */ -#define NFDBITS __NFDBITS - -#define FD_SETSIZE __FD_SETSIZE -#define FD_SET (fd,fdsetp) __FD_SET(fd,fdsetp) -#define FD_CLR (fd,fdsetp) __FD_CLR(fd,fdsetp) -#define FD_ISSET (fd,fdsetp) __FD_ISSET(fd,fdsetp) -#define FD_ZERO (fdsetp) __FD_ZERO(fdsetp) -/* * Names of the interval timers, and structure * defining a timer setting:
Thanks,
Sorry, your name popped out of the get_maintainers.pl script, you have any idea who else from
Thomas Gleixner
David Howells
H. Peter Anvin
David S. Miller
This should go to? or just all of them?
Charles
Quoted 66 lines · john stultz
Quoted 7 lines · On Tue, 2010-12-07 at 18:29 -0800, [email protected] wrote:
From: Charles Hardin <[email protected]>
This is a change to address a conflict in a time utility library that was using the kernel version of timespec and picked up the
FD_SETmacros and which caused a redefinition compiler errorSigned-off-by Charles Hardin <[email protected]>No objection here, but I'm not sure if I'm the best to review this, as I'm not as familiar with the users of FD_*.
thanks
-johnQuoted 47 lines
---
include/linux/posix_types.h | 12 ++++++++++++
include/linux/time.h | 8 --------2 files changed, 12 insertions(+), 8 deletions(-)include/linux/posix_types.h +12
-0@@ -33,6 +33,18 @@ #undef __FDMASK #define __FDMASK(d) (1UL << ((d) % __NFDBITS)) +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ <2 ) + +#define NFDBITS __NFDBITS + +#define FD_SETSIZE __FD_SETSIZE +#define FD_SET (fd,fdsetp) __FD_SET(fd,fdsetp) +#define FD_CLR (fd,fdsetp) __FD_CLR(fd,fdsetp) +#define FD_ISSET (fd,fdsetp) __FD_ISSET(fd,fdsetp) +#define FD_ZERO (fdsetp) __FD_ZERO(fdsetp) + +#endif /* not kernel and not glibc */ + typedef struct { unsigned long fds_bits [__FDSET_LONGS]; } __kernel_fd_set;include/linux/time.h +0
-8@@ -254,14 +254,6 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns) } #endif /* __KERNEL__ */ -#define NFDBITS __NFDBITS - -#define FD_SETSIZE __FD_SETSIZE -#define FD_SET (fd,fdsetp) __FD_SET(fd,fdsetp) -#define FD_CLR (fd,fdsetp) __FD_CLR(fd,fdsetp) -#define FD_ISSET (fd,fdsetp) __FD_ISSET(fd,fdsetp) -#define FD_ZERO (fdsetp) __FD_ZERO(fdsetp) - /** Names of the interval timers, and structure * defining a timer setting: