public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Christoph Hellwig <hch@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Miller <davem@davemloft.net>,
	a.gruenbacher@computer.org, bunk@stusta.de,
	linux-kernel@vger.kernel.org, jmorris@redhat.com,
	dwmw2@infradead.org
Subject: Re: include/linux/xattr.h: how much userpace visible?
Date: Mon, 26 Feb 2007 16:10:16 -0800	[thread overview]
Message-ID: <45E376E8.8020901@zytor.com> (raw)
In-Reply-To: <20070227000318.GA3448@infradead.org>

Christoph Hellwig wrote:
> What's the problem of exposing all these APIs unconditionally?
> glibcs should either use all information from the linux/ headers
> or nothing at all, but not depend on hiding some bits.

It's not always that simple.  In particular, in some files there might 
be typedefs or structure tags that step on libc's namespace (but are 
useful to other libcs), but ABI constants that are universally useful.

One way to deal with the particular issue of structure tags which is 
probably even more useful is:

#if defined(__KERNEL__) || defined(__KERNEL_EXPORT_STRUCTURES)
# define __kstruct_stat stat
#endif

struct __kstruct_stat {
	/* ...foo... */
};

... which lets the libc export it into whatever namespace it wants by 
#defining __kstruct macros accordingly.

	-hpa

  reply	other threads:[~2007-02-27  0:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-23 18:43 include/linux/xattr.h: how much userpace visible? Adrian Bunk
2006-07-23 19:26 ` Alexey Dobriyan
2006-07-23 22:57 ` Nathan Scott
2006-07-24 18:31   ` Andreas Gruenbacher
2006-07-24 18:45     ` Sam Ravnborg
2006-07-24 18:58       ` Andreas Gruenbacher
2007-02-26 23:29       ` H. Peter Anvin
2007-02-26 23:28     ` H. Peter Anvin
2007-02-26 23:43       ` David Miller
2007-02-26 23:52         ` H. Peter Anvin
2007-02-27  0:03           ` Christoph Hellwig
2007-02-27  0:10             ` H. Peter Anvin [this message]
2007-02-27  1:49               ` Kyle Moffett
2007-02-27  2:09                 ` H. Peter Anvin

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=45E376E8.8020901@zytor.com \
    --to=hpa@zytor.com \
    --cc=a.gruenbacher@computer.org \
    --cc=bunk@stusta.de \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=hch@infradead.org \
    --cc=jmorris@redhat.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