mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Rich Felker <dalias@libc.org>
Cc: Yuriy Chernyshov <georgthegreat@gmail.com>, musl@lists.openwall.com
Subject: Re: [musl] Various conflicts with linux system headers (ioctl.h)
Date: Sun, 11 Dec 2022 12:07:23 +0100	[thread overview]
Message-ID: <20221211110723.GI98588@port70.net> (raw)
In-Reply-To: <20221211055335.GX29905@brightrain.aerifal.cx>

* Rich Felker <dalias@libc.org> [2022-12-11 00:53:35 -0500]:
> On Tue, Dec 06, 2022 at 11:36:24AM +0100, Yuriy Chernyshov wrote:
> > The following workaround helps, but looks quite ugly:
> > 
> > --- arch/generic/bits/ioctl.h (b4624b83eafbdd5f2e2c37374d62426c27687f35)
> > > +++ arch/generic/bits/ioctl.h (d545cbc1ae3f5c9132eb26b176bef3638c9d8063)
> > > @@ -1,3 +1,9 @@
> > > +#undef _IO
> > > +#undef _IOC
> > > +#undef _IOR
> > > +#undef _IOW
> > > +#undef _IOWR
> > > +
> > >  #define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
> > >  #define _IOC_NONE  0U
> > >  #define _IOC_WRITE 1U
> > >
> > 
> > Is it possible to get official solution for the macro conflict?
> 
> It's explicitly unsupported to include linux/* headers that might
> produce conflicting definitions *before* the libc headers they might
> conflict with. Does the same problem happen if you put the linux/*
> headers after?

i don't think reordering can fix the conflict as linux defines the
macros unconditionally. (and glibc relies on the linux definitions)

> > NB: we have to use linux/fs.h in order to get BLKGETSIZE64 constant defined
> > which is missing in sys/ioctl.h.

musl defines that in sys/mount.h (just like glibc)

  reply	other threads:[~2022-12-11 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 10:36 Yuriy Chernyshov
2022-12-11  5:53 ` Rich Felker
2022-12-11 11:07   ` Szabolcs Nagy [this message]
2022-12-11 12:26     ` Yuriy Chernyshov
2022-12-11 12:13   ` Yuriy Chernyshov

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=20221211110723.GI98588@port70.net \
    --to=nsz@port70.net \
    --cc=dalias@libc.org \
    --cc=georgthegreat@gmail.com \
    --cc=musl@lists.openwall.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).