[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#65486] [PATCH] syscalls: Add support for musl libc
From: |
Sören Tempel |
Subject: |
[bug#65486] [PATCH] syscalls: Add support for musl libc |
Date: |
Wed, 13 Sep 2023 12:23:50 +0200 |
Hi Ludovic,
Ludovic Courtès <ludo@gnu.org> wrote:
> I think this is misleading because this has to do with the C library,
> not with the kernel (“linux variant”).
>
> For example, GNU/Hurd uses the same C library as GNU/Linux, and both
> should use “statfs64”, “readdir64”, etc.
Oh, right! I totally forgot about GNU/Hurd, thanks for pointing that out.
> So what we want to check is whether we’re using the GNU libc or Musl,
> regardless of the kernel.
Keep in mind that—contrary to glibc—musl only supports Linux and not
GNU/Hurd. Therefore, it should be sufficient to simply check for a
linux-musl host and then use statfs/readdir over statfs64/readdir64:
(let ((proc (syscall->procedure (if linux-musl?
"readdir"
"readdir64"))))
........
Would that be acceptable?
> Now, instead of checking the libc’s identity, we could check whether
> “statfs64” is available, and if not, fall back to “statfs”.
You mean using a GNU ./configure check? That would be possible. However,
I think we also need to check somehow that readdir/statfs return values
are struct-layout compatible with the readdir64/statfs64 versions used
by glibc.
Unfortunately, I am not deeply familiar with GNU autotools. Is there a
similar feature-check in the Guile code base already that I could use as
a source of inspiration? Maybe the if expression outlined above would
be sufficient for now and we can improve upon that later?
Greetings,
Sören
- [bug#65486] [PATCH v2] syscalls: Add support for musl libc, soeren, 2023/09/09
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Ludovic Courtès, 2023/09/11
- [bug#65486] [PATCH] syscalls: Add support for musl libc,
Sören Tempel <=
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Ludovic Courtès, 2023/09/13
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Sören Tempel, 2023/09/15
- bug#65486: [PATCH] syscalls: Add support for musl libc, Ludovic Courtès, 2023/09/17
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Ludovic Courtès, 2023/09/17
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Christopher Baines, 2023/09/17
- [bug#65486] [PATCH v3] syscalls: Consistently use existing linux? definition, soeren, 2023/09/17
- [bug#65486] [PATCH v3] syscalls: Add support for musl libc, soeren, 2023/09/17
- [bug#65486] [PATCH] syscalls: Add support for musl libc, Sören Tempel, 2023/09/30