aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/cmd/randwritecomp
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-02-25 14:26:54 +0100
committerBrian Behlendorf <[email protected]>2022-03-15 15:13:42 -0700
commit861166b02701dfc8f63a105bd32758e806c84fd7 (patch)
tree1f9341513470b4615ca340c40ad087101c7dcf24 /tests/zfs-tests/cmd/randwritecomp
parent1d77d62f5a77cab85d4b98ecf72a9838f70d6bf1 (diff)
Remove bcopy(), bzero(), bcmp()
bcopy() has a confusing argument order and is actually a move, not a copy; they're all deprecated since POSIX.1-2001 and removed in -2008, and we shim them out to mem*() on Linux anyway Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12996
Diffstat (limited to 'tests/zfs-tests/cmd/randwritecomp')
-rw-r--r--tests/zfs-tests/cmd/randwritecomp/randwritecomp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/zfs-tests/cmd/randwritecomp/randwritecomp.c b/tests/zfs-tests/cmd/randwritecomp/randwritecomp.c
index 708d5ee90..3cff7fd0a 100644
--- a/tests/zfs-tests/cmd/randwritecomp/randwritecomp.c
+++ b/tests/zfs-tests/cmd/randwritecomp/randwritecomp.c
@@ -13,12 +13,6 @@
* Copyright (c) 2017 by Delphix. All rights reserved.
*/
-/*
- * The following is defined so the source can use
- * lrand48() and srand48().
- */
-#define __EXTENSIONS__
-
#include <stdint.h>
#include <string.h>
#include "../file_common.h"
@@ -27,7 +21,7 @@
* The following sample was derived from real-world data
* of a production Oracle database.
*/
-static uint64_t size_distribution[] = {
+static const uint64_t size_distribution[] = {
0,
1499018,
352084,
@@ -87,11 +81,11 @@ fillbuf(char *buf)
break;
}
- bcopy(randbuf, buf, BLOCKSZ);
+ memcpy(buf, randbuf, BLOCKSZ);
if (i == 0)
- bzero(buf, BLOCKSZ - 10);
+ memset(buf, 0, BLOCKSZ - 10);
else if (i < 16)
- bzero(buf, BLOCKSZ - i * 512 + 256);
+ memset(buf, 0, BLOCKSZ - i * 512 + 256);
/*LINTED: E_BAD_PTR_CAST_ALIGN*/
((uint32_t *)buf)[0] = lrand48();
}
@@ -99,8 +93,7 @@ fillbuf(char *buf)
static void
exit_usage(void)
{
- (void) printf("usage: ");
- (void) printf("randwritecomp <file> [-s] [nwrites]\n");
+ (void) puts("usage: randwritecomp [-s] file [nwrites]");
exit(EXIT_FAILURE);
}