mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Petr Vorel <petr.vorel@gmail.com>
To: musl@lists.openwall.com, Rich Felker <dalias@aerifal.cx>,
	Szabolcs Nagy <nsz@port70.net>
Subject: Re: [RFC] fanotify_event_info_fid incompatibility
Date: Tue, 12 Nov 2019 23:01:51 +0100	[thread overview]
Message-ID: <20191112220151.GC27331@x230> (raw)
In-Reply-To: <20191112212947.GJ25646@port70.net>

Hi,

> > [1] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/syscalls/fanotify

> this test code has internal apis like

> static inline void fanotify_get_fid(const char *path, __kernel_fsid_t *fsid,
> 				    struct file_handle *handle)

> which will not work if fsid has any other type than __kernel_fsid_t,
> so matching the field name is not enough, you need the linux type here.
Yep, that's exactly the problem. But I didn't ask to find a solution for LTP
(that's not difficult), I wanted to raise the problem for musl developers to
reconsider that incompatibility. The only thing I'm not sure, if any other 
application will want to access fsid member (searching on sources.debian.org and
github.com I found only fatrace [2], but it don't touch val/__val, so probably not).

> mixing linux and libc types have lot of problems, so i'd suggest to
> just use linux headers instead of libc ones to test this api.

> there are other solutions (like replicating the struct definitions
> with different names and memcpy the api struct to that before access),
> but it can't be completely clean, because there is a fundamental
> conflict. (unfortunately that conflict is documented: the linux man
> pages document the linux types as public api even though they don't
> mix well with libc types)
Yep, known problem [3].

Kind regards,
Petr

[2] https://sources.debian.org/src/fatrace/0.15-1/fatrace.c/?hl=149#L149
[3] https://sourceware.org/glibc/wiki/Synchronizing_Headers


      reply	other threads:[~2019-11-12 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 20:05 Petr Vorel
2019-11-12 20:30 ` Petr Vorel
2019-11-12 20:46 ` Szabolcs Nagy
2019-11-12 20:58   ` Petr Vorel
2019-11-12 21:29     ` Szabolcs Nagy
2019-11-12 22:01       ` Petr Vorel [this message]

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=20191112220151.GC27331@x230 \
    --to=petr.vorel@gmail.com \
    --cc=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    --cc=nsz@port70.net \
    /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).