* [LTP] [PATCH] resource: explicitly define _LARGEFILE64_SOURCE
@ 2025-02-28 9:14 Li Wang
2025-02-28 9:30 ` Li Wang
2025-02-28 10:19 ` Petr Vorel
0 siblings, 2 replies; 4+ messages in thread
From: Li Wang @ 2025-02-28 9:14 UTC (permalink / raw)
To: ltp
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")
Signed-off-by: Li Wang <liwang@redhat.com>
---
include/lapi/resource.h | 2 +-
testcases/kernel/syscalls/setrlimit/setrlimit06.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/lapi/resource.h b/include/lapi/resource.h
index 7c4530523..fec03d83b 100644
--- a/include/lapi/resource.h
+++ b/include/lapi/resource.h
@@ -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"
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit06.c b/testcases/kernel/syscalls/setrlimit/setrlimit06.c
index b587e250c..e8e378182 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit06.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit06.c
@@ -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>
--
2.48.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-28 10:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 9:14 [LTP] [PATCH] resource: explicitly define _LARGEFILE64_SOURCE Li Wang
2025-02-28 9:30 ` Li Wang
2025-02-28 10:07 ` Petr Vorel
2025-02-28 10:19 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.