Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

"In computing, 'Not a typewriter' or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is now used to indicate that an invalid ioctl (input/output control) number was specified in an ioctl system call." Reference: https://en.wikipedia.org/wiki/Not_a_typewriter

...

In ioctl() implementations in NuttX, -ENOTTY is always returned if the ioctl() command is not recognized.  You will often see driver ioctl() implementions implement ions with a general structure similar to the file followiningfollowing:

int driver_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
int ret;

switch (cmd)
{
...

default:
ret = -ENOTTY;
break;
}
}

return ret;
}

Note that -ENOTTY is returned internally in NuttX. With This will subsequently be used to set the errno value to ENOTTY and to return -1 to indicate the error condition.

...