summaryrefslogtreecommitdiff
path: root/libpipe
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-02 00:20:51 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-10 16:09:53 +0100
commit82a87d043498eeacb7e4f3edc85d1b7c424ea853 (patch)
tree60d3978b0722d23f01da47eb534ec6fa271b3ed8 /libpipe
parent0a4ada8d40fb687a659161ff7e0d1d0994264402 (diff)
Replace `bcopy' with `memcpy' or `memmove' as appropriate
* ext2fs/inode.c: Replace `bcopy' with `memcpy' or `memmove' as appropriate. * ext2fs/pager.c: Likewise. * isofs/lookup.c: Likewise. * isofs/main.c: Likewise. * isofs/rr.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libiohelp/return-buffer.c: Likewise. * libpager/pagemap.c: Likewise. * libpipe/pq.c: Likewise. * libpipe/pq.h: Likewise. * libstore/unzipstore.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/ethernet.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/dev.c: Likewise.
Diffstat (limited to 'libpipe')
-rw-r--r--libpipe/pq.c12
-rw-r--r--libpipe/pq.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/libpipe/pq.c b/libpipe/pq.c
index 102f3ee3..fe7dd8ae 100644
--- a/libpipe/pq.c
+++ b/libpipe/pq.c
@@ -249,10 +249,10 @@ packet_realloc (struct packet *packet, size_t new_len)
/* If there was an operation like vm_move, we could use that in the
case where both the old and the new buffers were vm_alloced (on
the assumption that creating COW pages is somewhat more costly).
- But there's not, and bcopy will do vm_copy where it can. Will we
+ But there's not, and memcpy may do vm_copy where it can. Will we
still takes faults on the new copy, even though we've deallocated
the old one??? XXX */
- bcopy (start, new_buf, end - start);
+ memcpy (new_buf, start, end - start);
/* And get rid of the old buffer. */
if (old_len > 0)
@@ -305,7 +305,7 @@ packet_set_ports (struct packet *packet,
packet->ports = new_ports;
packet->ports_alloced = num_ports;
}
- bcopy (ports, packet->ports, sizeof (mach_port_t) * num_ports);
+ memcpy (packet->ports, ports, sizeof (mach_port_t) * num_ports);
packet->num_ports = num_ports;
return 0;
}
@@ -324,7 +324,7 @@ packet_read_ports (struct packet *packet,
return errno;
}
*num_ports = packet->num_ports;
- bcopy (packet->ports, *ports, length);
+ memcpy (*ports, packet->ports, length);
packet->num_ports = 0;
return 0;
}
@@ -341,7 +341,7 @@ packet_write (struct packet *packet,
return err;
/* Add the new data. */
- bcopy (data, packet->buf_end, data_len);
+ memcpy (packet->buf_end, data, data_len);
packet->buf_end += data_len;
if (amount != NULL)
*amount = data_len;
@@ -411,7 +411,7 @@ packet_fetch (struct packet *packet,
if (*data_len < amount)
*data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
- bcopy (start, *data, amount);
+ memcpy (*data, start, amount);
start += amount;
if (remove && start - buf > 2 * PACKET_SIZE_LARGE)
diff --git a/libpipe/pq.h b/libpipe/pq.h
index 4e500b6c..7238ace0 100644
--- a/libpipe/pq.h
+++ b/libpipe/pq.h
@@ -176,7 +176,7 @@ packet_fit (struct packet *packet, size_t amount)
than 25% of the buffer size, then move the data instead of growing
the buffer. */
{
- bcopy (start, buf, cur_len);
+ memmove (buf, start, cur_len);
packet->buf_start = buf;
packet->buf_end = buf + cur_len;
}