mmap16: Get rid of SAFE_PWRITE()

+ Remove SAFE_PWRITE() from the oldlib safe_macros.h

* The SAFE_PWRITE() is called with offset 0 hence it's equivalent to
  SAFE_WRITE()

* The bug is 100% reproducible when SAFE_PWRITE() is replaced with
  SAFE_WRITE()

The motivation for the change is to avoid large number of "implicit
declaration of function" warnings on older distributions where pread()
and pwrite() prototypes are exposed only after _XOPEN_SOURCE >= 500 is
defined. This commit solves the problem for the old library.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/include/old/safe_macros.h b/include/old/safe_macros.h
index 4d8d339..25001e8 100644
--- a/include/old/safe_macros.h
+++ b/include/old/safe_macros.h
@@ -108,29 +108,6 @@
 	safe_write(__FILE__, __LINE__, cleanup_fn, (len_strict), (fildes), \
 	    (buf), (nbyte))
 
-/*
- * inline function that uses off_t since sizeof(off_t) depends on compile flags
- */
-static inline ssize_t safe_pwrite(const char *file, const int lineno,
-		void (*cleanup_fn)(void), char len_strict,
-		int fildes, const void *buf, size_t nbyte, off_t offset)
-{
-	ssize_t rval;
-
-	rval = pwrite(fildes, buf, nbyte, offset);
-	if (rval == -1 || (len_strict && (size_t)rval != nbyte)) {
-		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "%s:%d: pwrite(%d,%p,%zu,%lld) failed, returned %zd",
-			 file, lineno, fildes, buf, nbyte, (long long)offset,
-			 rval);
-	}
-
-	return rval;
-}
-#define SAFE_PWRITE(cleanup_fn, len_strict, fildes, buf, nbyte, offset) \
-	safe_pwrite(__FILE__, __LINE__, cleanup_fn, (len_strict), (fildes), \
-	    (buf), (nbyte), (offset))
-
 #define SAFE_STRTOL(cleanup_fn, str, min, max) \
 	safe_strtol(__FILE__, __LINE__, cleanup_fn, (str), (min), (max))
 
diff --git a/testcases/kernel/syscalls/mmap/mmap16.c b/testcases/kernel/syscalls/mmap/mmap16.c
index b23700d..3f2676b 100644
--- a/testcases/kernel/syscalls/mmap/mmap16.c
+++ b/testcases/kernel/syscalls/mmap/mmap16.c
@@ -189,7 +189,7 @@
 
 	memset(buf, 'a', FS_BLOCKSIZE);
 	fd = SAFE_OPEN(NULL, "testfilec", O_RDWR);
-	SAFE_PWRITE(NULL, 1, fd, buf, FS_BLOCKSIZE, 0);
+	SAFE_WRITE(NULL, 1, fd, buf, FS_BLOCKSIZE);
 
 	/*
 	 * In case mremap() may fail because that memory area can not be