From owner-svn-src-head@freebsd.org Fri Jun 2 16:30:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA24BFACC6; Fri, 2 Jun 2017 16:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D15268DC7; Fri, 2 Jun 2017 16:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52GUeYv016829; Fri, 2 Jun 2017 16:30:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52GUeTM016828; Fri, 2 Jun 2017 16:30:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201706021630.v52GUeTM016828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Jun 2017 16:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319500 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 16:30:41 -0000 Author: hselasky Date: Fri Jun 2 16:30:40 2017 New Revision: 319500 URL: https://svnweb.freebsd.org/changeset/base/319500 Log: 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 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 15:32:11 2017 (r319499) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Jun 2 16:30:40 2017 (r319500) @@ -826,6 +826,10 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t 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() */