From owner-svn-src-all@freebsd.org Sat Apr 2 06:15:15 2016 Return-Path: Delivered-To: svn-src-all@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 67AA2AEBEE5; Sat, 2 Apr 2016 06:15:15 +0000 (UTC) (envelope-from dchagin@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 382071075; Sat, 2 Apr 2016 06:15:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u326FE9f065478; Sat, 2 Apr 2016 06:15:14 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u326FEGt065477; Sat, 2 Apr 2016 06:15:14 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604020615.u326FEGt065477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 2 Apr 2016 06:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297502 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 06:15:15 -0000 Author: dchagin Date: Sat Apr 2 06:15:14 2016 New Revision: 297502 URL: https://svnweb.freebsd.org/changeset/base/297502 Log: MFC r297296: Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object. Modified: stable/10/sys/compat/linux/linux_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Apr 2 01:59:53 2016 (r297501) +++ stable/10/sys/compat/linux/linux_event.c Sat Apr 2 06:15:14 2016 (r297502) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -868,8 +869,24 @@ static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { + struct eventfd *efd; - return (ENXIO); + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EINVAL); + + switch (cmd) + { + case FIONBIO: + if (*(int *)data) + efd->efd_flags |= LINUX_O_NONBLOCK; + else + efd->efd_flags &= ~LINUX_O_NONBLOCK; + case FIOASYNC: + return (0); + default: + return (ENXIO); + } } /*ARGSUSED*/