public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] android: io/diotest4: remove dependency on <sys/shm.h>
Date: Tue, 19 Sep 2017 16:27:13 -0700	[thread overview]
Message-ID: <20170919232713.57314-1-sspatil@google.com> (raw)

The dependency causes the test to fail build when being compiled against
bionic. The code however only seem to need that header for 'SHMLBA'
constant used to set the mmap'ed segment size. That is replaced by
the page size with this change. Tested on both Android device and a
x86 workstation successfully.

Signed-off-by: Sandeep Patil <sspatil@google.com>
---

 testcases/kernel/io/direct_io/diotest4.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
index f3b7d3ba8..a9ecff00f 100644
--- a/testcases/kernel/io/direct_io/diotest4.c
+++ b/testcases/kernel/io/direct_io/diotest4.c
@@ -65,7 +65,6 @@
 #include <sys/mman.h>
 #include <sys/syscall.h>
 #include <errno.h>
-#include <sys/shm.h>
 
 #include "diotest_routines.h"
 
@@ -195,7 +194,7 @@ int main(int argc, char *argv[])
 	int fd, newfd;
 	int i, l_fail = 0, fail_count = 0, total = 0;
 	int failed = 0;
-	int shmsz = SHMLBA;
+	int shmsz = sysconf(_SC_PAGE_SIZE);
 	int pagemask = ~(sysconf(_SC_PAGE_SIZE) - 1);
 	char *buf0, *buf1, *buf2;
 	caddr_t shm_base;
-- 
2.14.1.690.gbb1197296e-goog


             reply	other threads:[~2017-09-19 23:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 23:27 Sandeep Patil [this message]
2017-10-11 12:15 ` [LTP] [PATCH] android: io/diotest4: remove dependency on <sys/shm.h> Cyril Hrubis
2017-10-18  5:49   ` Sandeep Patil
2017-10-26  8:16     ` Cyril Hrubis
2017-11-06 18:37       ` Sandeep Patil

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=20170919232713.57314-1-sspatil@google.com \
    --to=sspatil@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