mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: Rob Landley <rob@landley.net>
Cc: Denys Vlasenko <vda.linux@googlemail.com>,
	Aboriginal Linux <aboriginal@lists.landley.net>,
	musl@lists.openwall.com
Subject: Re: musl and kernel headers [was Re: system-images 1.4.2: od is broken; bzip2 is missing]
Date: Tue, 6 Oct 2015 10:30:18 -0400	[thread overview]
Message-ID: <20151006143018.GN8645@brightrain.aerifal.cx> (raw)
In-Reply-To: <561330C1.8070205@landley.net>

On Mon, Oct 05, 2015 at 09:24:01PM -0500, Rob Landley wrote:
> On 10/05/2015 08:44 PM, Rich Felker wrote:
> > On Mon, Oct 05, 2015 at 10:08:10AM -0500, Rob Landley wrote:
> > The cleaner approach is just avoiding including both the kernel
> > headers and libc/userspace headers for the same things in the same
> > file. In theory this may be hard in some cases, but I find that I can
> > almost always fix these sorts of errors during a build by commenting
> > out one or two #include lines.
> 
> I am _deeply_ curious how you'd get linux/loop.h on a platform where you
> need the 32 bit loopback structure definition without including the
> kernel header.

Sorry I wasn't clear on this; the meaning I intended to convey was
including both kernel and libc/userspace headers for the same things.
Network is the main area affected here. The kernel headers have fixed
up all the gratuitous conflicts with userspace, but the big remaining
ones are places where they want to define types with the exact same
names, which mostly happens in network. So what I was trying to say is
that programs using kernel network headers (legitimately for
linux-specific stuff) are going to best avoid the risk of clashes by
not including libc network headers in the same files.

> Sadly, the kernel headers are exported for a _reason_. If I need to
> syscall something you haven't wrapped, I need the _NR_ and it varies per
> target. It's a thing.

For syscalls we export all SYS_*/__NR_* macros (sys/syscall.h), but
you still might need macro and struct definitions for arguments to the
syscalls or ioctls.

Rich


  parent reply	other threads:[~2015-10-06 14:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAK1hOcNm-rwGdr1_THZoHA-TTxOjpzUU=Lnraqt6mj+JmBdvFw@mail.gmail.com>
     [not found] ` <5612925A.4070402@landley.net>
2015-10-06  1:44   ` Rich Felker
2015-10-06  2:24     ` Rob Landley
2015-10-06 11:01       ` Szabolcs Nagy
2015-10-06 14:30       ` Rich Felker [this message]
2015-10-06 16:05         ` Denys Vlasenko
2015-10-06 16:09     ` Denys Vlasenko
2015-10-08 16:58       ` Rich Felker
2015-10-09 19:11         ` Denys Vlasenko
2015-10-09 19:46           ` Rich Felker
2015-10-10  4:56             ` Rob Landley
2015-10-13 12:10             ` Denys Vlasenko
2015-10-13 14:16               ` Ruben Winistörfer
2015-10-13 14:53               ` Szabolcs Nagy
2015-10-13 15:05                 ` Rich Felker
2015-10-13 18:02                   ` Denys Vlasenko
2015-10-13 18:56                     ` Rich Felker
2015-10-13 15:10               ` Rich Felker
2015-10-13 21:55                 ` Isaac Dunham

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=20151006143018.GN8645@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=aboriginal@lists.landley.net \
    --cc=musl@lists.openwall.com \
    --cc=rob@landley.net \
    --cc=vda.linux@googlemail.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).