`ioctl` can fail with EACCES; for example: https://github.com/freebsd/freebsd/blob/master/sys/kern/tty.c#L1874 But `man 2 ioctl` only lists EBADF, ENOTTY, EINVAL, and EFAULT.
Created attachment 228974 [details] ioctl(2) patch Document EACCES as a possible return value for ioctl().