For musl libc instead of including , which leads to an error when redefining ioctl(3) and close(3), just define the prototype for ioctl(). --- benchmarks/gem_exec_tracer.c 2015-08-17 18:38:30.000000000 +0200 +++ benchmarks/gem_exec_tracer.c 2015-09-13 17:03:34.768431063 +0200 @@ -32,7 +32,11 @@ #include #include #include +#if defined(__GLIBC__) #include +#else +int ioctl(int fd, unsigned long request, ...); +#endif #include #include #include --- tools/aubdump.c 2015-09-08 19:01:19.000000000 +0200 +++ tools/aubdump.c 2015-09-13 17:06:27.850430550 +0200 @@ -32,7 +32,11 @@ #include #include #include +#if defined(__GLIBC__) #include +#else +int ioctl(int fd, unsigned long request, ...); +#endif #include #include #include