--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -8,6 +8,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#define _GNU_SOURCE
 #include <errno.h>
 #include <env_flags.h>
 #include <fcntl.h>