Port: replace bzero() by memset()
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 29 Sep 2015 10:02:14 +0000 (06:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Oct 2015 16:45:31 +0000 (12:45 -0400)
bzero() was deprecated in POSIX 2001 and removed from POSIX 2008,
while memset() is part of the C standard.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
urcu-bp.c

index a5dc6fb69470850545d64fc0e9345eba87089aad..4316b907394ee7dc1b732d37c52dd069ca1f2480 100644 (file)
@@ -62,7 +62,7 @@ AC_TYPE_UINT8_T
 AC_FUNC_MALLOC
 AC_FUNC_MMAP
 AC_CHECK_FUNCS(
-       [bzero gettimeofday munmap sched_getcpu strtoul sysconf gettid memeset strerror]
+       [memset gettimeofday munmap sched_getcpu strtoul sysconf gettid memeset strerror]
 )
 
 # Check for headers
index 20684cc4d0972a61427f8ecae0e5fd7eb5072189..22e17ccdd0a81eafe3b49917bb610f10a5e2ac3c 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -379,7 +379,7 @@ void expand_arena(struct registry_arena *arena)
                        -1, 0);
                if (new_chunk == MAP_FAILED)
                        abort();
-               bzero(new_chunk, new_chunk_len);
+               memset(new_chunk, 0, new_chunk_len);
                new_chunk->data_len =
                        new_chunk_len - sizeof(struct registry_chunk);
                cds_list_add_tail(&new_chunk->node, &arena->chunk_list);
@@ -399,7 +399,7 @@ void expand_arena(struct registry_arena *arena)
        if (new_chunk != MAP_FAILED) {
                /* Should not have moved. */
                assert(new_chunk == last_chunk);
-               bzero((char *) last_chunk + old_chunk_len,
+               memset((char *) last_chunk + old_chunk_len, 0,
                        new_chunk_len - old_chunk_len);
                last_chunk->data_len =
                        new_chunk_len - sizeof(struct registry_chunk);
@@ -413,7 +413,7 @@ void expand_arena(struct registry_arena *arena)
                -1, 0);
        if (new_chunk == MAP_FAILED)
                abort();
-       bzero(new_chunk, new_chunk_len);
+       memset(new_chunk, 0, new_chunk_len);
        new_chunk->data_len =
                new_chunk_len - sizeof(struct registry_chunk);
        cds_list_add_tail(&new_chunk->node, &arena->chunk_list);
This page took 0.043598 seconds and 4 git commands to generate.