perf bench futex: Fix build on musl + clang

When building with clang on a musl libc system, Alpine Linux, we end up
hitting a problem where memset() is used but its prototype is not
present, add it to avoid this:

  bench/futex-wake.c:99:3: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)'
        [-Werror,-Wimplicit-function-declaration]
                  CPU_ZERO(&cpu);
                  ^
  /usr/include/sched.h:127:23: note: expanded from macro 'CPU_ZERO'
  #define CPU_ZERO(set) CPU_ZERO_S(sizeof(cpu_set_t),set)
                        ^
  /usr/include/sched.h:110:30: note: expanded from macro 'CPU_ZERO_S'
  #define CPU_ZERO_S(size,set) memset(set,0,size)
                               ^
  bench/futex-wake.c:99:3: note: include the header <string.h> or explicitly provide a declaration for 'memset'

Found while updating my test build containers to build perf with clang in more
systems.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-jh10vaz2r98zl6gm5iau8prr@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b8d1fd7e
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include <errno.h> #include <errno.h>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
/* For the CLR_() macros */ /* For the CLR_() macros */
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
......
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