--- parted-3.1.orig/libparted/fs/xfs/platform_defs.h
+++ parted-3.1/libparted/fs/xfs/platform_defs.h
@@ -35,6 +35,7 @@
 #define __XFS_PLATFORM_DEFS_H__
 
 #include <stdio.h>
+#include <fcntl.h>
 #include <stdarg.h>
 #include <assert.h>
 #include <endian.h>
