From owner-freebsd-current@FreeBSD.ORG Mon Aug 5 19:24:11 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4DD7253F; Mon, 5 Aug 2013 19:24:11 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 34B6A220A; Mon, 5 Aug 2013 19:24:11 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id r75JO505015827; Mon, 5 Aug 2013 12:24:05 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <51FFFBD4.7070705@rawbw.com> Date: Mon, 05 Aug 2013 12:24:04 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130628 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: Linux epoll(7) patch References: <51FF7211.6020909@rawbw.com> <51FFC31D.3080304@mu.org> <20130805152556.GA37810@freebsd.org> <20130805153946.GA29300@dft-labs.eu> In-Reply-To: <20130805153946.GA29300@dft-labs.eu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Roman Divacky , Alfred Perlstein , current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2013 19:24:11 -0000 On 08/05/2013 08:39, Mateusz Guzik wrote: > What happens to fd after the fork? Is it closed or simply remains > non-functional? > > If the former, I suggest the patch is altered to leave fd with badfdops > in place so that epoll users get less surprised. I will try to alter it this way. However, there is no easy way of testing such case, apart from compiling specially crafted linux program. Also forking after poll is a marginal case. Doubt it ever matters in practice. I found two more problems with the patch: epoll_wait treats timeout as if it was in microseconds, when it is in milliseconds. Also epoll_wait doesn't check for the special case of timeout=-1. I corrected both issues. Will do additional testing, and will submit PR with an updated patch when done. Yuri