powerpc: Fix struct termio related ioctl macros
Madhavan Srinivasan
maintainerPATCH 1/1 powerpc: Fix struct termio related ioctl macros
Since termio interface is now obsolete, include/uapi/asm/ioctls.h has some constant macros referring to "struct termio", this caused build failure at userspace.
In file included from /usr/include/asm/ioctl.h:12,
from /usr/include/asm/ioctls.h:5,
from tst-ioctls.c:3:tst-ioctls.c: In function 'get_TCGETA':
tst-ioctls.c:12:10: error: invalid application of 'sizeof' to incomplete type 'struct termio'
12 | return TCGETA;
| ^~~~~~Even though termios.h provides "struct termio", trying to juggle definitions around to make it compile could introduce regressions. So better to open code it.
--- arch/powerpc/include/uapi/asm/ioctls.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/include/uapi/asm/ioctls.h +4 -4
@@ -23,10 +23,10 @@#define TCSETSW _IOW('t', 21, struct termios)#define TCSETSF _IOW('t', 22, struct termios) -#define TCGETA _IOR('t', 23, struct termio) -#define TCSETA _IOW('t', 24, struct termio) -#define TCSETAW _IOW('t', 25, struct termio) -#define TCSETAF _IOW('t', 28, struct termio) +#define TCGETA 0x80147417/* _IOR('t', 23, struct termio) */ +#define TCSETA 0x40147418/* _IOW('t', 24, struct termio) */ +#define TCSETAW 0x40147419/* _IOW('t', 25, struct termio) */ +#define TCSETAF 0x4014741c/* _IOW('t', 28, struct termio) */ #define TCSBRK _IO('t', 29)#define TCXONC _IO('t', 30)
Signature · 1 line
2.49.0
Quoted 12 lines · Madhavan Srinivasan
Since termio interface is now obsolete,
include/uapi/asm/ioctls.hhas some constant macros referring to "struct termio", this caused build failure at userspace.In file included from
/usr/include/asm/ioctl.h:12,
from/usr/include/asm/ioctls.h:5,
from tst-ioctls.c:3:tst-ioctls.c: In function 'get_TCGETA':
tst-ioctls.c:12:10: error: invalid application of 'sizeof' to incomplete type 'struct termio'12 | return TCGETA; | ^~~~~~
Quoted 7 lines
Even though
termios.hprovides "struct termio", trying to juggle definitions around to make it compile could introduce regressions. So better to open code it.Reported-by Tulio Magno <[email protected]>Suggested-by Nicholas Piggin <[email protected]>Signed-off-by Madhavan Srinivasan <[email protected]>
I've tested and confirmed this patch does fix the issue.
Thank you!
Signature · 1 line
Tulio Magno