containers / composefs

The reliability of disk images, the flexibility of files
Other
462 stars 37 forks source link

libcomposefs: include linux/limits.h to satisfy usage of XATTR_NAME_MAX #366

Closed ziyao233 closed 2 months ago

ziyao233 commented 2 months ago

XATTR_NAME_MAX is defined in linux/limits.h, but leaked by glibc since its sys/param.h includes the former header, which is not true on musl and leads to errors like:

    ../libcomposefs/lcfs-writer.c:1688:16: error: use of undeclared identifier 'XATTR_NAME_MAX'
     1688 |         if (namelen > XATTR_NAME_MAX) {

Include linux/limits.h explicitly to build properly on musl.

ziyao233 commented 2 months ago

Hi, thanks for the patch!

First a procedural note, we have an ongoing attempt at a relicensing: https://github.com/containers/composefs/issues/344

Are you OK with licensing this contribution under those terms instead of the current ones?

Also, it should be trivial to add a CI build on a musl system, would be a nice followup to this.

I'm not familiar with GitHub CI, but if possible I suggest building on Alpine Linux, which is also the most popular musl-based distro.