#include <unistd.h>
#include <sys/mman.h>
+#include "urcu/arch.h"
#include "urcu/wfcqueue.h"
#include "urcu/map/urcu-bp.h"
#include "urcu/static/urcu-bp.h"
static
int rcu_bp_refcount;
-/*
- * RCU_MEMBARRIER is only possibly available on Linux.
- */
-#ifdef __linux__
-#include <urcu/syscall-compat.h>
-#endif
-
-/* If the headers do not support SYS_membarrier, fall back on RCU_MB */
-#ifdef SYS_membarrier
-# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__)
+/* If the headers do not support membarrier system call, fall back smp_mb. */
+#ifdef __NR_membarrier
+# define membarrier(...) syscall(__NR_membarrier, __VA_ARGS__)
#else
# define membarrier(...) -ENOSYS
#endif
-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);
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);
-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);