Building kwboot for musl instead of glibc results in a couple of errors:

  error: unknown type name 'fd_set'
  error: storage size of 'tv' isn't known
    142 |         struct timeval tv;
  warning: implicit declaration of function 'FD_ZERO'
  warning: implicit declaration of function 'FD_SET'
  warning: implicit declaration of function 'select'
  warning: implicit declaration of function 'FD_ISSET'

POSIX specifies[1] that all these symbols shall be defined by <sys/select.h>,
so include this missing header.

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/select.h.html

Reported-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/openembedded-core/[email protected]/
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 scripts/kwboot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 1cbb456935f2..2a4f6bc5fc58 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -22,6 +22,7 @@
 #include <termios.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#include <sys/select.h>
 
 /*
  * Marvell BootROM UART Sensing
-- 
2.30.2


Reply via email to