diff --git a/drivers/note/noteram_driver.c b/drivers/note/noteram_driver.c index 0cca512e41e..d19a4cb454c 100644 --- a/drivers/note/noteram_driver.c +++ b/drivers/note/noteram_driver.c @@ -604,6 +604,18 @@ static int noteram_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; + case FIONREAD: + if (arg == 0) + { + ret = -EINVAL; + } + else + { + *(FAR unsigned int *)arg = noteram_unread_length(drv); + ret = OK; + } + break; + default: break; }