All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] resource: explicitly define _LARGEFILE64_SOURCE
Date: Fri, 28 Feb 2025 17:14:51 +0800	[thread overview]
Message-ID: <20250228091451.579579-1-liwang@redhat.com> (raw)

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

             reply	other threads:[~2025-02-28  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28  9:14 Li Wang [this message]
2025-02-28  9:30 ` [LTP] [PATCH] resource: explicitly define _LARGEFILE64_SOURCE Li Wang
2025-02-28 10:07   ` Petr Vorel
2025-02-28 10:19 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250228091451.579579-1-liwang@redhat.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.