public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Steve Muckle <smuckle@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/3] getrlimit/getrlimit03: fix breakage with Aarch32
Date: Wed, 26 Dec 2018 16:31:00 -0800	[thread overview]
Message-ID: <20181227003102.246617-1-smuckle@google.com> (raw)

A 64-bit ARM kernel running an Aarch32 user binary has the ugetrlimit
and prlimit64 syscalls, but not the getrlimit syscall. This test
currently assumes getrlimit is always available.

Modify the test so that it does not fail in this configuration.

Signed-off-by: Steve Muckle <smuckle@google.com>
---
 testcases/kernel/syscalls/getrlimit/getrlimit03.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
index 376ef7241..53a1e2c5d 100644
--- a/testcases/kernel/syscalls/getrlimit/getrlimit03.c
+++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
@@ -158,10 +158,15 @@ static void run(unsigned int resource)
 			      "rlim_max"))
 		return;
 
+	tst_res(TPASS, "__NR_prlimit64(%d) and %s(%d) gave consistent results",
+		resource, __NR_getrlimit_ulong_str, resource);
+
 #if SIGNED_GETRLIMIT
 	errno = 0;
 	ret_l = getrlimit_long(resource, &rlim_l);
 	errno_l = errno;
+	if (errno_l == ENOSYS)
+		return;
 
 	if (compare_retval(resource, ret_u64, errno_u64, ret_l, errno_l,
 			   "__NR_getrlimit") ||
@@ -170,10 +175,10 @@ static void run(unsigned int resource)
 	    compare_u64_long(resource, rlim_u64.rlim_max, rlim_l.rlim_max,
 			     "rlim_max"))
 		return;
-#endif
 
-	tst_res(TPASS, "getrlimit(%u) was consistent during all syscalls",
-		resource);
+	tst_res(TPASS, "__NR_prlimit64(%d) and __NR_getrlimit(%d) gave "
+		"consistent results", resource, resource);
+#endif
 }
 
 static struct tst_test test = {
-- 
2.20.1.415.g653613c723-goog


             reply	other threads:[~2018-12-27  0:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27  0:31 Steve Muckle [this message]
2018-12-27  0:31 ` [LTP] [PATCH 2/3] syscalls/sched_setaffinity: move cpu set macros to include/lapi Steve Muckle
2018-12-27  0:31 ` [LTP] [PATCH 3/3] syscalls/getcpu01: convert to new lib, cleanups, enable on Android Steve Muckle
2019-01-04 15:35   ` Cyril Hrubis
2019-01-03  9:56 ` [LTP] [PATCH 1/3] getrlimit/getrlimit03: fix breakage with Aarch32 Li Wang
2019-01-03 14:57 ` Cyril Hrubis

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=20181227003102.246617-1-smuckle@google.com \
    --to=smuckle@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox