Skip to contentSkip to conversation

resource: explicitly define _LARGEFILE64_SOURCE

PATCH In review Li Wang 2 participants 4 messages Feb 28, 2025

lore
Share & tools
lore

Li Wang

author
#0 lore raw

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

Fixes de44d81d1f5 ("setrlimit06: cover the setting resource limit64")
---
 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
index 7c4530523..fec03d83b 100644
@@ -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
index b587e250c..e8e378182 100644
@@ -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
#3 lore raw
In reply to Li Wang

Hi Li,

Quoted 7 lines

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

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