From ba8abb56431eeffc45f6fc5000b07b0aa20b9765 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Mon, 30 Dec 2024 15:43:46 +0800 Subject: [PATCH] sys/ioctl: extend the IOCTL defintion that compatible with linux kernel Add the generic _IO() macro and aliases for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS, aligning the ioctl.h definitions with the Linux kernel API to improve source compatibility when porting LTP linux kernel testcase code to NuttX Signed-off-by: guoshichao --- include/sys/ioctl.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h index 61eaf31f2d1..6483935ac45 100644 --- a/include/sys/ioctl.h +++ b/include/sys/ioctl.h @@ -68,6 +68,13 @@ * Pre-processor Definitions ****************************************************************************/ +/* The compatibility IOCTL definitions */ + +#define _IO(type,nr) _IOC((type),(nr)) + +#define FS_IOC_GETFLAGS FIOC_GETFLAGS +#define FS_IOC_SETFLAGS FIOC_SETFLAGS + #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C"