[newlib] RTEMS: Declare ioctl() also if _KERNEL is defined

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 6 14:47:37 UTC 2022


This fixes the following warning in libbsd:

rtems/blkdev.h:200:10: warning: implicit declaration of function 'ioctl'; did
  you mean 'ifioctl'? [-Wimplicit-function-declaration]

Remove unnecessary includes.
---
 newlib/libc/sys/rtems/include/sys/ioccom.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/ioccom.h b/newlib/libc/sys/rtems/include/sys/ioccom.h
index 2a8416c41..1044a27e9 100644
--- a/newlib/libc/sys/rtems/include/sys/ioccom.h
+++ b/newlib/libc/sys/rtems/include/sys/ioccom.h
@@ -36,7 +36,6 @@
 #define	_SYS_IOCCOM_H_
 
 #include <sys/types.h>
-#include <stdint.h>
 
 typedef unsigned long ioctl_command_t;
 
@@ -80,14 +79,10 @@ typedef unsigned long ioctl_command_t;
 #define	IOCPARM_IVAL(x)	((int)(intptr_t)(void *)*(caddr_t *)(void *)(x))
 #endif
 
-#else
-
-#include <sys/cdefs.h>
+#endif
 
 __BEGIN_DECLS
 int	ioctl(int, ioctl_command_t, ...);
 __END_DECLS
 
-#endif
-
 #endif /* !_SYS_IOCCOM_H_ */
-- 
2.35.3



More information about the devel mailing list