From: Michael Jeanson Date: Tue, 29 Sep 2015 10:02:14 +0000 (-0400) Subject: Port: replace bzero() by memset() X-Git-Tag: v0.9.0~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d3ac5bb7c43cbe5412a4e3a13692ec7a90b9fbbb;p=userspace-rcu.git Port: replace bzero() by memset() bzero() was deprecated in POSIX 2001 and removed from POSIX 2008, while memset() is part of the C standard. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/configure.ac b/configure.ac index a5dc6fb..4316b90 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/urcu-bp.c b/urcu-bp.c index 20684cc..22e17cc 100644 --- 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);