mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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 <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12996
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user