From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 11 00:27:50 2012 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 0632B106564A for ; Wed, 11 Apr 2012 00:27:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-emulation@FreeBSD.org Date: Tue, 10 Apr 2012 20:27:40 -0400 User-Agent: KMail/1.6.2 References: <201204101856.46591.jkim@FreeBSD.org> <201204101939.33201.jkim@FreeBSD.org> In-Reply-To: <201204101939.33201.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204102027.42344.jkim@FreeBSD.org> Cc: Subject: Re: [PATCH] pipe2 for Linuxulator X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 00:27:50 -0000 On Tuesday 10 April 2012 07:39 pm, Jung-uk Kim wrote: > On Tuesday 10 April 2012 06:56 pm, Jung-uk Kim wrote: > > Th attached patch implements pipe2 syscall for Linuxulator, which > > is quite trivial. Although it was added in Linux 2.6.27 (thanks, > > netchild!), it is often used by popular Linux applications, e.g., > > Adobe Flash plugin. Please note linux_pipe() was moved from MD > > files to sys/compat/linux/linux_file.c because both amd64 and > > i386 versions looked the same and I failed to see any reason. I > > also changed file descriptor argument from l_ulong * to l_int *, > > which seemed more appropriate. Any objections? > > Oops, I missed a patch for sys/kern/kern_descript.c: > > Index: sys/kern/kern_descrip.c > =================================================================== > --- sys/kern/kern_descrip.c (revision 234112) > +++ sys/kern/kern_descrip.c (working copy) > @@ -1681,6 +1681,8 @@ finstall(struct thread *td, struct file *fp, > int * > } > fhold(fp); > fdp->fd_ofiles[*fd] = fp; > + if ((flags & O_NONBLOCK) != 0) > + fp->f_flag |= FNONBLOCK; > if ((flags & O_CLOEXEC) != 0) > fdp->fd_ofileflags[*fd] |= UF_EXCLOSE; > FILEDESC_XUNLOCK(fdp); > > > * PS: This patch is also available from here: > > > > http://people.freebsd.org/~jkim/linux_pipe2.diff > > This patch is updated with it. Oops, oops... I found that non-blocking does not really work because finit() resets the flag later. The patch was re-done to set the non-blocking flag correctly. I'm really sorry about the mess. Jung-uk Kim