From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 20 23:26:16 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFD61065675; Fri, 20 Jan 2012 23:26:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id A70028FC13; Fri, 20 Jan 2012 23:26:15 +0000 (UTC) Received: by lahe6 with SMTP id e6so837992lah.13 for ; Fri, 20 Jan 2012 15:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=aDmq1vMZDWCFbbzieqkVEo5bwEUByY26SetQgvgEpRU=; b=Io0bEJSS30afVRnraTA+tjmtvGLum7uv/dE3shEV0u2Bo2o8MGmlLVme6Llgsk+quG ZnqlWJAErT5WzSXqA9lfpxn/Ud5M7Q7OYue4F7lhNfFFADOQCldKhD1uxPqQjkWWqH32 0bfBmjlBl4RiKPwgufyNmZUo2xLxYc/prn5O8= Received: by 10.152.148.230 with SMTP id tv6mr296851lab.12.1327101974138; Fri, 20 Jan 2012 15:26:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.25.196 with HTTP; Fri, 20 Jan 2012 15:25:42 -0800 (PST) In-Reply-To: References: <20120112100840.GV31224@deviant.kiev.zoral.com.ua> From: Eitan Adler Date: Fri, 20 Jan 2012 18:25:42 -0500 Message-ID: To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Cc: jilles@freebsd.org, FreeBSD Hackers , Colin Percival Subject: Re: dup3 syscall - atomic set O_CLOEXEC with dup2 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 23:26:16 -0000 SSBmaWd1cmUgdGhpcyBpc24ndCB3YW50ZWQ/CgpPbiBUaHUsIEphbiAxMiwgMjAxMiBhdCAxMDow NyBQTSwgRWl0YW4gQWRsZXIgPGxpc3RzQGVpdGFuYWRsZXIuY29tPiB3cm90ZToKPiBPa2F5IC0g aGVyZSBpcyB2ZXJzaW9uIDIgKGNvbXBpbGUgYW5kIHJ1biB0ZXN0ZWQpCj4KPiBJbmRleDogc3lz L2tlcm4va2Vybl9kZXNjcmlwLmMKPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cj4gLS0tIHN5cy9rZXJuL2tlcm5fZGVz Y3JpcC5jIMKgIMKgIChyZXZpc2lvbiAyMjk4MzApCj4gKysrIHN5cy9rZXJuL2tlcm5fZGVzY3Jp cC5jIMKgIMKgICh3b3JraW5nIGNvcHkpCj4gQEAgLTExMCw2ICsxMTAsNyBAQAo+IMKgLyogRmxh Z3MgZm9yIGRvX2R1cCgpICovCj4gwqAjZGVmaW5lIERVUF9GSVhFRCDCoCDCoCDCoDB4MSDCoCDC oCAvKiBGb3JjZSBmaXhlZCBhbGxvY2F0aW9uICovCj4gwqAjZGVmaW5lIERVUF9GQ05UTCDCoCDC oCDCoDB4MiDCoCDCoCAvKiBmY250bCgpLXN0eWxlIGVycm9ycyAqLwo+ICsjZGVmaW5lIERVUF9D TE9FWEVDIMKgIMKgMHg0IMKgIMKgIC8qIEVuYWJsZSBPX0NMT0VYRUMgb24gdGhlIG5ldyBmZCAq Lwo+Cj4gwqBzdGF0aWMgaW50IGRvX2R1cChzdHJ1Y3QgdGhyZWFkICp0ZCwgaW50IGZsYWdzLCBp bnQgb2xkLCBpbnQgbmV3LAo+IMKgIMKgIHJlZ2lzdGVyX3QgKnJldHZ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