--- /dev/null
+Avoid wchar_t redefinition
+
+The musl C library does not define _WCHAR_T. Check also for compiler defined
+__WCHAR_TYPE__.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+
+diff -Nuar ipmiutil-2.9.5-orig/util/imb_api.h ipmiutil-2.9.5/util/imb_api.h
+--- ipmiutil-2.9.5-orig/util/imb_api.h 2014-11-04 19:46:11.000000000 +0200
++++ ipmiutil-2.9.5/util/imb_api.h 2015-09-29 07:49:40.799063825 +0300
+@@ -49,7 +49,7 @@
+ /* DOS defines wchar_t in stdlib.h */
+ #else
+ // defined(LINUX) | defined(SOLARIS)
+-#ifndef _WCHAR_T
++#if !defined(_WCHAR_T) && !defined(__WCHAR_TYPE__)
+ #define _WCHAR_T
+ typedef long wchar_t;
+ #endif
--- /dev/null
+Add missing linux/param.h header include
+
+Fixes the following build failure under musl:
+
+mem_if.c: In function ‘MapPhysicalMemory’:
+mem_if.c:337:36: error: ‘EXEC_PAGESIZE’ undeclared (first use in this function)
+ ulDiff = (ULONG)(tdStartAddress % EXEC_PAGESIZE);
+ ^
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+
+diff -Nuar ipmiutil-2.9.5-orig/util/mem_if.c ipmiutil-2.9.5/util/mem_if.c
+--- ipmiutil-2.9.5-orig/util/mem_if.c 2014-11-04 19:46:11.000000000 +0200
++++ ipmiutil-2.9.5/util/mem_if.c 2015-09-29 08:08:31.800459775 +0300
+@@ -65,6 +65,9 @@
+ #include <sys/param.h>
+ #include <sys/mman.h>
+ #include <sys/ioctl.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+ #endif
+ #if defined(SOLARIS) || defined(BSD)
+ #define EXEC_PAGESIZE 4096
--- /dev/null
+Add missing sys/select.h include
+
+POSIX.1-2001 requires sys/select.h for select(). Fixes the following build
+failure under musl:
+
+ipmimv.c: In function ‘ipmicmd_mv’:
+ipmimv.c:345:5: error: unknown type name ‘fd_set’
+ fd_set readfds;
+ ^
+ipmimv.c:346:20: error: storage size of ‘tv’ isn’t known
+ struct timeval tv;
+ ^
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+
+diff -Nuar ipmiutil-2.9.5-orig/util/ipmimv.c ipmiutil-2.9.5/util/ipmimv.c
+--- ipmiutil-2.9.5-orig/util/ipmimv.c 2014-11-04 19:46:11.000000000 +0200
++++ ipmiutil-2.9.5/util/ipmimv.c 2015-09-29 09:16:08.862828679 +0300
+@@ -62,6 +62,7 @@
+ #include <time.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
++#include <sys/select.h>
+ #if defined(MACOS)
+ #include <sys/time.h>
+ #else