resource: explicitly define _LARGEFILE64_SOURCE
PATCH 1/1 resource: explicitly define _LARGEFILE64_SOURCE
Fix compilation errors on Alpine Linux (musl) by explicitly defining _LARGEFILE64_SOURCE instead of _GNU_SOURCE. This ensures that 64-bit resource limit structures (e.g., struct rlimit64) are properly exposed in <sys/resource.h>.
To resolve the compiling error on Alpine:
https://github.com/linux-test-project/ltp/actions/runs/13580985467/job/37966850497
--- include/lapi/resource.h | 2 +- testcases/kernel/syscalls/setrlimit/setrlimit06.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/lapi/resource.h +1 -1
@@ -7,7 +7,7 @@#ifndef LAPI_RESOURCE_H__ #define LAPI_RESOURCE_H__ -#define _GNU_SOURCE +#define _LARGEFILE64_SOURCE#include <sys/resource.h> #include "config.h"
testcases/kernel/syscalls/setrlimit/setrlimit06.c +1 -1
@@ -16,7 +16,7 @@* c3bca5d450b62 ("posix-cpu-timers: Ensure set_process_cpu_timer is always evaluated") */ -#define _GNU_SOURCE +#define _LARGEFILE64_SOURCE#include <errno.h> #include <sys/types.h> #include <unistd.h>
Signature · 5 lines
2.48.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
CI Job passed: https://github.com/wangli5665/ltp/actions/runs/13584917259/
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
Reviewed-byHi Li,
thanks for fixing it!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li,
Quoted 7 lines
Fix compilation errors on Alpine Linux (musl) by explicitly defining
_LARGEFILE64_SOURCEinstead of_GNU_SOURCE. This ensures that 64-bit resource limit structures (e.g., struct rlimit64) are properly exposed in <sys/resource.h>.To resolve the compiling error on Alpine:
https://github.com/linux-test-project/ltp/actions/runs/13580985467/job/37966850497
I dared to merge to fix the CI.
Thank you for the fix!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp