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

Gedare Bloom gedare at rtems.org
Wed Jul 6 19:16:38 UTC 2022


On Wed, Jul 6, 2022 at 1:14 PM Gedare Bloom <gedare at rtems.org> wrote:
>
> Why are the includes for stdint and cdefs removed also?
>
> On Wed, Jul 6, 2022 at 8:47 AM Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
> >
> > 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.
Sorry, you said they're unnecessary here.  OK with me

> > ---
> >  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

Maybe add !_KERNEL here for good measure.

> >
> >  __BEGIN_DECLS
> >  int    ioctl(int, ioctl_command_t, ...);
> >  __END_DECLS
> >
> > -#endif
> > -
> >  #endif /* !_SYS_IOCCOM_H_ */
> > --
> > 2.35.3
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list