From owner-svn-src-head@FreeBSD.ORG Wed Apr 18 15:22:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50A7B106564A; Wed, 18 Apr 2012 15:22:07 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id B556F8FC08; Wed, 18 Apr 2012 15:22:06 +0000 (UTC) Received: by qcsg15 with SMTP id g15so5497444qcs.13 for ; Wed, 18 Apr 2012 08:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ZaBoh4kgQsWbZuh7+abGq8Qp4TZAWYzyBTOglxYw3II=; b=bYnm6EJyPvCfSRNtj2cScaMr0PEFVHBSjpy4gV0j1qMN67ZwK1IkGn4H4WyCbtrnZP NVZRHV6t5QlR7XLq3s2MUCt3pu1/x2ZszafgGDqPaVP06A214Ii45q4nJOiXfO+qngP0 qK00WwhrUOLwWAEcjFvUorVS2uZd6D5hjqTaxPQHWGN0gmZ84QR9sa9zr1KCmi+bYsDQ a2Zi3ujoYl1l5ndLxao91c/ZhHQCR8RxQZYMu771M3CpBrLS9QKOAK2doLvzVT1X5Dg9 TJvNNnhrOA/kvx0tcOUf/iDLSJf+RPfpmu+7YlgvyTwD7Is/KNq0sThI1J81eybEB2Av SOBQ== MIME-Version: 1.0 Received: by 10.229.106.33 with SMTP id v33mr1082879qco.47.1334762526020; Wed, 18 Apr 2012 08:22:06 -0700 (PDT) Sender: giovanni.trematerra@gmail.com Received: by 10.229.137.18 with HTTP; Wed, 18 Apr 2012 08:22:04 -0700 (PDT) In-Reply-To: <20120418121559.GY2358@deviant.kiev.zoral.com.ua> References: <201204162122.q3GLM23E051048@svn.freebsd.org> <20120418121559.GY2358@deviant.kiev.zoral.com.ua> Date: Wed, 18 Apr 2012 17:22:04 +0200 X-Google-Sender-Auth: TioQpolz7rQt4upIr6TcViElMsQ Message-ID: From: Giovanni Trematerra To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r234352 - in head/sys: amd64/linux32 compat/linux i386/linux kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 18 Apr 2012 15:22:07 -0000 2012/4/18 Konstantin Belousov : > On Wed, Apr 18, 2012 at 01:52:24PM +0200, Giovanni Trematerra wrote: >> On Mon, Apr 16, 2012 at 11:22 PM, Jung-uk Kim wrote: >> > Author: jkim >> > Date: Mon Apr 16 21:22:02 2012 >> > New Revision: 234352 >> > URL: http://svn.freebsd.org/changeset/base/234352 >> > >> > Log: >> > =A0- Implement pipe2 syscall for Linuxulator. =A0This syscall appeared= in 2.6.27 >> > =A0but GNU libc used it without checking its kernel version, e. g., Fe= dora 10. >> > =A0- Move pipe(2) implementation for Linuxulator from MD files to MI f= ile, >> > =A0sys/compat/linux/linux_file.c. =A0There is no MD code for this sysc= all at all. >> > =A0- Correct an argument type for pipe() from l_ulong * to l_int *. = =A0Probably >> > =A0this was the source of MI/MD confusion. >> > >> > =A0Reviewed by: =A0emulation >> > >> > Modified: >> > =A0head/sys/amd64/linux32/linux32_dummy.c >> > =A0head/sys/amd64/linux32/linux32_machdep.c >> > =A0head/sys/amd64/linux32/syscalls.master >> > =A0head/sys/compat/linux/linux_file.c >> > =A0head/sys/i386/linux/linux_dummy.c >> > =A0head/sys/i386/linux/linux_machdep.c >> > =A0head/sys/i386/linux/syscalls.master >> > =A0head/sys/kern/sys_pipe.c >> > >> >> I don't think it's worth to change sys/kern/sys_pipe.c just to implement >> linux_pipe2 in linuxator. >> You can just revert the changes in sys_pipe.c and call kern_fcntl in lin= ux_pipe2 >> to set appropriate flags for the pipes after you created them with kern_= pipe. >> Please, take a look at this patch >> http://www.trematerra.net/patches/linux_pipe2.patch >> >> It's only test-compiled though. >> Thank you. > > I do think that what Jung-uk did is the right approach, and your suggesti= on > is wrong. The way it is done in r234352 serves the purpose of pipe2(2), > namely, the atomicity of setting O_CLOEXEC and O_NONBLOCK with respect > to execve(2). Uhm I'm overlooked that linux threads in linuxolator are actual processes a= s you pointed me out in private. Sorry for the noise.