diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_entry.c | 4 | ||||
-rw-r--r-- | ipc/ipc_kmsg.c | 6 | ||||
-rw-r--r-- | ipc/ipc_object.c | 10 | ||||
-rw-r--r-- | ipc/ipc_port.c | 4 | ||||
-rw-r--r-- | ipc/ipc_space.c | 2 | ||||
-rw-r--r-- | ipc/mach_debug.c | 6 |
6 files changed, 22 insertions, 10 deletions
diff --git a/ipc/ipc_entry.c b/ipc/ipc_entry.c index 523f0704..85404b6a 100644 --- a/ipc/ipc_entry.c +++ b/ipc/ipc_entry.c @@ -34,6 +34,8 @@ * Primitive functions to manipulate translation entries. */ +#include <string.h> + #include <mach/kern_return.h> #include <mach/port.h> #include <kern/assert.h> @@ -635,7 +637,7 @@ ipc_entry_grow_table(space) */ if (!it_entries_reallocable(oits)) - (void) memcpy((void *) table, (const void *) otable, + memcpy(table, otable, osize * sizeof(struct ipc_entry)); for (i = 0; i < osize; i++) diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c index 12bd0c77..100cc93c 100644 --- a/ipc/ipc_kmsg.c +++ b/ipc/ipc_kmsg.c @@ -34,6 +34,8 @@ * Operations on kernel messages. */ +#include <string.h> + #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/message.h> @@ -558,7 +560,7 @@ ipc_kmsg_get_from_kernel(msg, size, kmsgp) return MACH_SEND_NO_BUFFER; ikm_init(kmsg, size); - bcopy((char *) msg, (char *) &kmsg->ikm_header, size); + memcpy(&kmsg->ikm_header, msg, size); kmsg->ikm_header.msgh_size = size; *kmsgp = kmsg; @@ -623,7 +625,7 @@ ipc_kmsg_put_to_kernel( assert(!KMSG_IN_DIPC(kmsg)); #endif /* DIPC */ - (void) memcpy((void *) msg, (const void *) &kmsg->ikm_header, size); + memcpy(msg, &kmsg->ikm_header, size); ikm_free(kmsg); } diff --git a/ipc/ipc_object.c b/ipc/ipc_object.c index e0cbbc3d..713a581c 100644 --- a/ipc/ipc_object.c +++ b/ipc/ipc_object.c @@ -31,6 +31,8 @@ * Functions to manipulate IPC objects. */ +#include <string.h> + #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/port.h> @@ -239,11 +241,11 @@ ipc_object_alloc( if (otype == IOT_PORT) { ipc_port_t port = (ipc_port_t)object; - bzero((char *)port, sizeof(*port)); + memset(port, 0, sizeof(*port)); } else if (otype == IOT_PORT_SET) { ipc_pset_t pset = (ipc_pset_t)object; - bzero((char *)pset, sizeof(*pset)); + memset(pset, 0, sizeof(*pset)); } kr = ipc_entry_alloc(space, namep, &entry); if (kr != KERN_SUCCESS) { @@ -305,11 +307,11 @@ ipc_object_alloc_name( if (otype == IOT_PORT) { ipc_port_t port = (ipc_port_t)object; - bzero((char *)port, sizeof(*port)); + memset(port, 0, sizeof(*port)); } else if (otype == IOT_PORT_SET) { ipc_pset_t pset = (ipc_pset_t)object; - bzero((char *)pset, sizeof(*pset)); + memset(pset, 0, sizeof(*pset)); } kr = ipc_entry_alloc_name(space, name, &entry); diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c index aaba82d7..a23375cd 100644 --- a/ipc/ipc_port.c +++ b/ipc/ipc_port.c @@ -34,6 +34,8 @@ * Functions to manipulate IPC ports. */ +#include <string.h> + #include <mach/port.h> #include <mach/kern_return.h> #include <kern/lock.h> @@ -182,7 +184,7 @@ ipc_port_dngrow(port) osize = oits->its_size; free = otable->ipr_next; - bcopy((char *)(otable + 1), (char *)(ntable + 1), + memcpy((ntable + 1), (otable + 1), (osize - 1) * sizeof(struct ipc_port_request)); } else { osize = 1; diff --git a/ipc/ipc_space.c b/ipc/ipc_space.c index e3817f5b..444f400f 100644 --- a/ipc/ipc_space.c +++ b/ipc/ipc_space.c @@ -36,6 +36,8 @@ * Functions to manipulate IPC capability spaces. */ +#include <string.h> + #include <mach/boolean.h> #include <mach/kern_return.h> #include <mach/port.h> diff --git a/ipc/mach_debug.c b/ipc/mach_debug.c index 04d0c74a..acb9f974 100644 --- a/ipc/mach_debug.c +++ b/ipc/mach_debug.c @@ -33,6 +33,8 @@ * Exported kernel calls. See mach_debug/mach_debug.defs. */ +#include <string.h> + #include <mach/kern_return.h> #include <mach/port.h> #include <mach/machine/vm_types.h> @@ -453,7 +455,7 @@ mach_port_space_info( table_size - rsize_used); if (size_used != rsize_used) - bzero((char *) (table_addr + size_used), + memset((char *) (table_addr + size_used), 0, rsize_used - size_used); kr = vm_map_copyin(ipc_kernel_map, table_addr, rsize_used, @@ -488,7 +490,7 @@ mach_port_space_info( tree_size - rsize_used); if (size_used != rsize_used) - bzero((char *) (tree_addr + size_used), + memset((char *) (tree_addr + size_used), 0, rsize_used - size_used); kr = vm_map_copyin(ipc_kernel_map, tree_addr, rsize_used, |