public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] mmap15: don't fail if mmap returns EINVAL
@ 2014-08-22  6:45 Jan Stancek
  2014-08-22  8:05 ` Wanlong Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2014-08-22  6:45 UTC (permalink / raw)
  To: ltp-list

Older kernels (2.6.32) on ppc64 return EINVAL instead of ENOMEM.

Man page says:
"EINVAL We don’t like addr, length, or offset (e.g., they are too large,
or not aligned on a page boundary).", which suggests that both
ENOMEM and EINVAL should be considered.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/mmap/mmap15.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/mmap/mmap15.c b/testcases/kernel/syscalls/mmap/mmap15.c
index 49dbba4..f1fc267 100644
--- a/testcases/kernel/syscalls/mmap/mmap15.c
+++ b/testcases/kernel/syscalls/mmap/mmap15.c
@@ -80,10 +80,10 @@ int main(int ac, char **av)
 			continue;
 		}
 
-		if (errno != ENOMEM) {
+		if (errno != ENOMEM && errno != EINVAL) {
 			tst_resm(TFAIL | TERRNO, "mmap into high region "
 				 "failed unexpectedly - expect "
-				 "errno=ENOMEM, got");
+				 "errno=ENOMEM/EINVAL, got");
 		} else {
 			tst_resm(TPASS | TERRNO, "mmap into high region "
 				 "failed as expected");
-- 
1.7.1


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-25 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22  6:45 [LTP] [PATCH] mmap15: don't fail if mmap returns EINVAL Jan Stancek
2014-08-22  8:05 ` Wanlong Gao
2014-08-22 13:35   ` Stanislav Kholmanskikh
     [not found]     ` <CAE1O6mgqn51jh-ib5vXUL8P2kBuJMbG1Wg6WPFp8y2p6Vp74kQ@mail.gmail.com>
2014-08-25 11:07       ` chrubis
     [not found]         ` <1721706552.12305163.1408967269010.JavaMail.zimbra@redhat.com>
2014-08-25 12:05           ` chrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox