Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: David Woodhouse <dwmw2@infradead.org>
Cc: David Miller <davem@davemloft.net>,
	linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless.h: improve userland include-ability
Date: Wed, 4 Jun 2008 17:23:14 +0300	[thread overview]
Message-ID: <20080604142307.GA22903@localhost.localdomain> (raw)
In-Reply-To: <1212587529.32207.82.camel@pmac.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1752 bytes --]

On Wed, Jun 04, 2008 at 02:52:09PM +0100, David Woodhouse wrote:
> On Tue, 2008-06-03 at 12:05 -0700, David Miller wrote:
> > Yeah, go check so me magic userspace tool header to see what magic is
> > needed just to include a core networking header file correctly.
> > 
> > No, thanks.
> 
> Just to clarify: this is only a problem for userspace, and you're
> objecting to that? Just including <linux/wireless.h> within the kernel
> will continue to work.
> 
> We've traditionally got away with saying 'caveat emptor' when userspace
> includes kernel headers -- you _have_ to include the right
> prerequisites, because the kernel doesn't do it for you.
> 
> I'm happy enough to change that, but it means seeing stuff like...
> 	#ifndef __KERNEL__
> 	#include <sys/foo.h>
> 	#endif 
> ... in kernel headers. Is that what you're intending, or am I
> misunderstanding your objection?
> 
> I believe that the main reason for this patch was that <linux/socket.h>
> and <linux/if.h> both have problems when you include them in the same C
> file as the 'proper' glibc equivalent? Is that something we can address,
> instead of just dropping those includes?

What do you think about hack linke this:

#include <linux/types.h>                /* for __u* and __s* typedefs */
#if defined(__KERNEL__) || !defined(_SYS_SOCKET_H)
#include <linux/socket.h>               /* for "struct sockaddr" et al  */
#endif
#if defined(__KERNEL__) || !defined(_NET_IF_H)
#include <linux/if.h>                   /* for IFNAMSIZ and co... */
#endif

It avoids conflict between glibc's and kernel's headers if glibc's headers 
include first.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-06-04 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 17:51 [PATCH] wireless.h: improve userland include-ability John W. Linville
2008-06-03 19:05 ` David Miller
2008-06-04 13:52   ` David Woodhouse
2008-06-04 14:23     ` Kirill A. Shutemov [this message]
2008-06-04 14:26       ` David Woodhouse
2008-06-04 14:56         ` David Woodhouse
2008-06-04 15:02     ` David Miller
2008-06-04 15:26       ` David Woodhouse
2008-06-04 15:47         ` David Miller
2008-06-04 15:50           ` David Woodhouse
2008-06-04 15:24     ` Pavel Roskin
2008-06-04 17:34       ` John W. Linville

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=20080604142307.GA22903@localhost.localdomain \
    --to=kirill@shutemov.name \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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