diff --git a/lib/libspl/include/unistd.h b/lib/libspl/include/unistd.h index dfb2937459..769e13a283 100644 --- a/lib/libspl/include/unistd.h +++ b/lib/libspl/include/unistd.h @@ -29,13 +29,19 @@ #ifndef _SYS_UNISTD_H #define _SYS_UNISTD_H -#ifndef HAVE_ISSETUGID -#include -#define issetugid() (geteuid() == 0 || getegid() == 0) +#if !defined(HAVE_IOCTL_IN_UNISTD_H) +# if defined(HAVE_IOCTL_IN_SYS_IOCTL_H) +# include +# elif defined(HAVE_IOCTL_IN_STROPTS_H) +# include +# else +# error "System call ioctl() unavailable" +# endif #endif -#ifdef HAVE_IOCTL_IN_UNISTD_H -#include +#if !defined(HAVE_ISSETUGID) +# include +# define issetugid() (geteuid() == 0 || getegid() == 0) #endif #if !defined(__sun__) && !defined(__sun)