mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: using kernel headers in libc headers
Date: Mon, 30 Nov 2009 08:37:04 -0800	[thread overview]
Message-ID: <a36005b50911300837s6fe4da73s973ccbe7401b9989@mail.gmail.com> (raw)

The kernel headers nowadays are cleaned up to separate in-kernel
definitions from those that are exported.  That's of course good but
it's unfortunately not sufficient to use (most of) the headers in
glibc.

Take <linux/sched.h> for instance.  The <sched.h> header is defined in
POSIX and therefore the specify which symbols can be defined in which
configuration.  The <linux/sched.h> defines all kinds of symbols,
though, unconditionally.  If you compare it with the glibc header
you'd see that all the CLONE_* symbols and some of the SCHED_* symbols
are only defined in certain configurations (non-POSIX configurations).

It's likely in everybody's interest to get the kernel headers used.
But for this mode #ifdefs are needed.  I'm willing to do the work.
Easy enough to do when I'm going through the headers one-by-one to
enable them in glibc.  But I don't want to start this work unless it's
going to be accepted.  The symbols would be something like

  __USE_MISC

or

  __USE_GNU

These are not macros which the user must define.  The user sets macros
like _GNU_SOURCE etc which then set all the appropriate __USE_* macros
(see "info libc 'Feature Test Macros'" on machines with glibc
installed).  These names are somewhat glibc-specific but other libcs
can (or already have) adapt them.

So, what do you say?

             reply	other threads:[~2009-11-30 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 16:37 Ulrich Drepper [this message]
2009-11-30 17:01 ` H. Peter Anvin
2009-11-30 17:40   ` Chris Friesen
2009-11-30 17:43   ` Ulrich Drepper
2009-11-30 17:55     ` 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=a36005b50911300837s6fe4da73s973ccbe7401b9989@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®