From: john stultz <johnstul@us.ibm.com>
To: ckhardin@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 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.
Date: Tue, 07 Dec 2010 20:27:30 -0800 [thread overview]
Message-ID: <1291782450.2325.41.camel@work-vm> (raw)
In-Reply-To: <1291775384-7570-1-git-send-email-ckhardin@gmail.com>
On Tue, 2010-12-07 at 18:29 -0800, ckhardin@gmail.com wrote:
> From: Charles Hardin <chardin@erebus.dhcp.2wire.com>
>
> 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_SET macros
> and which caused a redefinition compiler error
>
> Signed-off-by: Charles Hardin <ckhardin@gmail.com>
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
> ---
> include/linux/posix_types.h | 12 ++++++++++++
> include/linux/time.h | 8 --------
> 2 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/posix_types.h b/include/linux/posix_types.h
> index f04c98c..c49ce52 100644
> --- a/include/linux/posix_types.h
> +++ b/include/linux/posix_types.h
> @@ -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;
> diff --git a/include/linux/time.h b/include/linux/time.h
> index 9f15ac7..6e612a4 100644
> --- a/include/linux/time.h
> +++ b/include/linux/time.h
> @@ -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:
next parent reply other threads:[~2010-12-08 4:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1291775384-7570-1-git-send-email-ckhardin@gmail.com>
2010-12-08 4:27 ` john stultz [this message]
2010-12-08 16:05 ` [PATCH] 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 Charles Hardin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291782450.2325.41.camel@work-vm \
--to=johnstul@us.ibm.com \
--cc=ckhardin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox