aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libspl
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 /lib/libspl
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 'lib/libspl')
-rw-r--r--lib/libspl/include/sys/kstat.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libspl/include/sys/kstat.h b/lib/libspl/include/sys/kstat.h
index f73fb92eb..7f9aa6d8d 100644
--- a/lib/libspl/include/sys/kstat.h
+++ b/lib/libspl/include/sys/kstat.h
@@ -383,9 +383,9 @@ typedef struct kstat32 {
*
* ksp->ks_snaptime = gethrtime();
* if (rw == KSTAT_WRITE)
- * bcopy(buf, ksp->ks_data, ksp->ks_data_size);
+ * memcpy(ksp->ks_data, buf, ksp->ks_data_size);
* else
- * bcopy(ksp->ks_data, buf, ksp->ks_data_size);
+ * memcpy(buf, ksp->ks_data, ksp->ks_data_size);
* return (0);
*
* A more illuminating example is taking a snapshot of a linked list:
@@ -394,7 +394,7 @@ typedef struct kstat32 {
* if (rw == KSTAT_WRITE)
* return (EACCES); ... See below ...
* for (foo = first_foo; foo; foo = foo->next) {
- * bcopy((char *) foo, (char *) buf, sizeof (struct foo));
+ * memcpy(buf, foo, sizeof (struct foo));
* buf = ((struct foo *) buf) + 1;
* }
* return (0);
@@ -423,12 +423,12 @@ typedef struct kstat32 {
* uint_t i;
*
* ... Do the regular copy ...
- * bcopy(ksp->ks_data, buf, sizeof (kstat_named_t) * ksp->ks_ndata);
+ * memcpy(buf, ksp->ks_data, sizeof (kstat_named_t) * ksp->ks_ndata);
*
* for (i = 0; i < ksp->ks_ndata; i++, knp++) {
* if (knp[i].data_type == KSTAT_DATA_STRING &&
* KSTAT_NAMED_STR_PTR(knp) != NULL) {
- * bcopy(KSTAT_NAMED_STR_PTR(knp), end,
+ * memcpy(end, KSTAT_NAMED_STR_PTR(knp),
* KSTAT_NAMED_STR_BUFLEN(knp));
* KSTAT_NAMED_STR_PTR(knp) = end;
* end += KSTAT_NAMED_STR_BUFLEN(knp);