intel/common: include unistd.h for ioctl() prototype on Solaris
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Tue, 8 Oct 2019 22:36:48 +0000 (15:36 -0700)
committerEric Engestrom <eric.engestrom@intel.com>
Wed, 16 Oct 2019 12:45:57 +0000 (13:45 +0100)
Fixes build errors of:
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h: In function ‘gen_ioctl’:
../src/intel/common/gen_gem.h:68:15: error: implicit declaration of function ‘ioctl’ [-Werror=implicit-function-declaration]
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~
In file included from ../include/c11/threads_posix.h:35,
                 from ../include/c11/threads.h:66,
                 from ../src/mesa/main/mtypes.h:39,
                 from ../src/intel/compiler/brw_compiler.h:30,
                 from ../src/intel/vulkan/anv_private.h:51,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
/usr/include/unistd.h: At top level:
/usr/include/unistd.h:471:12: error: conflicting types for ‘ioctl’
  471 | extern int ioctl(int, int, ...);
      |            ^~~~~
/usr/include/unistd.h:471:1: note: a parameter list with an ellipsis can’t match an empty parameter name list declaration
  471 | extern int ioctl(int, int, ...);
      | ^~~~~~
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h:68:15: note: previous implicit declaration of ‘ioctl’ was here
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
src/intel/common/gen_gem.h

index c4dda6de65796ee60a4c48f384b5962ec93d00ae..fc48d54386bd80eb56e831c7803dbac2f6293d6c 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <errno.h>
 #include <stdint.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 
 static inline uint64_t