diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9ea990d..5050e60 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -506,22 +506,24 @@ static int sys_inotify_rm_watch(int fd, int32_t wd)
   return (inotify_rm_watch(fd, wd));
 }
 #endif
-#ifdef CONFIG_INOTIFY1
-#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
-static int sys_inotify_init1(int flags)
-{
-  return (inotify_init1(flags));
-}
-#endif
-#endif
 #else
 /* Userspace can usually survive runtime without inotify */
 #undef TARGET_NR_inotify_init
-#undef TARGET_NR_inotify_init1
 #undef TARGET_NR_inotify_add_watch
 #undef TARGET_NR_inotify_rm_watch
 #endif /* CONFIG_INOTIFY  */
 
+#ifdef CONFIG_INOTIFY1
+#include <sys/inotify.h>
+#if defined(TARGET_NR_inotify_init1) && defined(__NR_inotify_init1)
+static int sys_inotify_init1(int flags)
+{
+  return (inotify_init1(flags));
+}
+#endif
+#else
+#undef TARGET_NR_inotify_init1
+#endif /* CONFIG_INOTIFY1 */
 
 extern int personality(int);
 extern int flock(int, int);
