Versions Compared

Key

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

...

Reference: https://lore.kernel.org/patchwork/patch/258361/

How is this useful?

Knowing that no error occurred but the ioctl() command was not recognized is a useful piece of information.  Suppose, for example, I have nfds open character drivers in an array fd[].  Then I could do something like this:

...

          if (errcode != ENOTTY)
            {

              /* Other errors, including EINVAL, are fatal */

              return -errcode
            }
        }
      else if (ret >= 0)
        {

          return OK;
        }
    }

...