All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] android: io/diotest4: remove dependency on <sys/shm.h>
@ 2017-09-19 23:27 Sandeep Patil
  2017-10-11 12:15 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Sandeep Patil @ 2017-09-19 23:27 UTC (permalink / raw)
  To: ltp

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


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

end of thread, other threads:[~2017-11-06 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 23:27 [LTP] [PATCH] android: io/diotest4: remove dependency on <sys/shm.h> Sandeep Patil
2017-10-11 12:15 ` Cyril Hrubis
2017-10-18  5:49   ` Sandeep Patil
2017-10-26  8:16     ` Cyril Hrubis
2017-11-06 18:37       ` Sandeep Patil

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.