Add support for setting the non-blocking I/O flag for LinuxKPI

character devices. In Linux the FIONBIO IOCTL is handled by the kernel
and not the drivers. Also need return success for the FIOASYNC ioctl
due to existing logic in kern_fcntl() even though it is not supported
currently.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-06-02 16:30:40 +00:00
parent d04e6601fa
commit 639af71ab1

View File

@ -826,6 +826,10 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
return (error);
filp->f_flags = file->f_flag;
/* the LinuxKPI supports blocking and non-blocking I/O */
if (cmd == FIONBIO || cmd == FIOASYNC)
return (0);
linux_set_current(td);
size = IOCPARM_LEN(cmd);
/* refer to logic in sys_ioctl() */