Commit ef20f638 authored by Pádraig Brady's avatar Pádraig Brady Committed by Facebook Github Bot

folly: fix sysMembarrier() with newer kernel headers

Summary:
When __NR_membarrier is defined (on newer kernels),
we don't define the constants, but also by default
don't include the membarrier header to define the necessary constants.
Therefore split the definition of the syscall value and
the constants used with it, to ensure both are defined.

Reviewed By: yfeldblum

Differential Revision: D6292178

fbshipit-source-id: 31ba9d4a698a4f5e14ae34de0acf8f851d75527d
parent 18de341f
...@@ -26,10 +26,12 @@ ...@@ -26,10 +26,12 @@
#define FOLLY_USE_SYS_MEMBARRIER 1 #define FOLLY_USE_SYS_MEMBARRIER 1
#if !defined(__NR_membarrier) #if !defined(__NR_membarrier)
#define __NR_membarrier 324 #define __NR_membarrier 324
#endif
#if FOLLY_HAVE_LINUX_MEMBARRIER_H
#include <linux/membarrier.h> // @manual
#else
#define MEMBARRIER_CMD_QUERY 0 #define MEMBARRIER_CMD_QUERY 0
#define MEMBARRIER_CMD_SHARED 1 #define MEMBARRIER_CMD_SHARED 1
#elif FOLLY_HAVE_LINUX_MEMBARRIER_H
#include <linux/membarrier.h> // @manual
#endif #endif
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment