diff --git a/src/libs/zbxhash/sha512crypt.c b/src/libs/zbxhash/sha512crypt.c
index fce7014..12f6859 100644
--- a/src/libs/zbxhash/sha512crypt.c
+++ b/src/libs/zbxhash/sha512crypt.c
@@ -5,6 +5,8 @@ Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>.  */
 
 #ifdef __linux__
 	#include <endian.h>
+#elif defined(__illumos__)
+	#include <endian.h>
 #elif __hpux
 /* Nothing to do in HP-UX */
 #elif _AIX