From owner-freebsd-threads@freebsd.org Sun Mar 20 15:26:58 2016 Return-Path: Delivered-To: freebsd-threads@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 6F7A9AD793F for ; Sun, 20 Mar 2016 15:26:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5EFCFB24 for ; Sun, 20 Mar 2016 15:26:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mailman.ysv.freebsd.org (Postfix) id 5AA30AD793E; Sun, 20 Mar 2016 15:26:58 +0000 (UTC) Delivered-To: threads@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 57AC7AD793D for ; Sun, 20 Mar 2016 15:26:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 149BCB21 for ; Sun, 20 Mar 2016 15:26:57 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from toad2.stack.nl (toad2.stack.nl [IPv6:2001:610:1108:5010::161]) by mx1.stack.nl (Postfix) with ESMTP id BD3CD35930C; Sun, 20 Mar 2016 16:26:54 +0100 (CET) Received: by toad2.stack.nl (Postfix, from userid 1677) id D3C67892B9; Sun, 20 Mar 2016 16:26:54 +0100 (CET) Date: Sun, 20 Mar 2016 16:26:54 +0100 From: Jilles Tjoelker To: Konstantin Belousov Cc: threads@freebsd.org Subject: Re: Removing the pid 1 code Message-ID: <20160320152654.GA55504@stack.nl> References: <20160319200826.GF1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160319200826.GF1741@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 15:26:58 -0000 On Sat, Mar 19, 2016 at 10:08:26PM +0200, Konstantin Belousov wrote: > We have very special code executed during the libthr initialisation, > which attempts to set up session and controlling terminal when running > as pid 1. I do not see why do we need this, e.g. why behaviour of > a program must be different due to the presence of libthr and running as > pid 1. The code is there from 1998' libc_r. > Please either provide arguments why should we do that, or agree with > the following change. I decided to pre-resolve getpid() just in case, > as it is done by the current code, but even this is probably not neccessary. I agree this should be removed. It might cause /rescue/init to behave strangely, for example. This change might break rare applications, so mentioning it in the release notes is wise. The applications will be easy to fix. -- Jilles Tjoelker