X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=OrZ8hj6QsI1AgCKt 12ux6MGAjwZxFWqA9X+Rsk9YKQL88pGGE3Va56iffaS5xLt+WJAyStNg47GumRQP k12pi5hzokIeD6jTjtjXURir44kwoPjNgr2GqBDH+mAdetpn2fePB6drvwanW2Lb Q/z0J96bHpFjN3aaO65vGPSK8hs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=QRDGrvfy0FX0fg8KuPIxDE UZTCE=; b=rdQsKVjUNsKcPdYNaTaiHDIL5iMbPU+D6rRAcznumTLx24DVqGkgjh qnRyoy6Zy91V6p9Zn9kxsPeHXxqc6IhwYV3PpqurOyKerQc0FNbJI0xDTXcHW+dS z7UZgT4wGLJuWtP3ZUR7GFRd9+a5gKMEF5tZ1U0Wh0r687nRh3kYg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=HX-Envelope-From:sk:Christi, Hx-languages-length:1276, homepage, cygwin-patches X-HELO: mailout03.t-online.de Subject: Re: Use a default path in exec*p*() if PATH is unset? To: cygwin AT cygwin DOT com References: <7b94712a-465d-421b-bc76-720e443708d3 AT t-online DOT de> <6991638b-2400-dacd-28ee-e2d2c9d91ed4 AT gmail DOT com> From: Christian Franke Message-ID: <36d1b8e6-4d03-eb00-37f0-e12c9f1c792b@t-online.de> Date: Tue, 11 Apr 2017 21:02:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49 MIME-Version: 1.0 In-Reply-To: <6991638b-2400-dacd-28ee-e2d2c9d91ed4@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes cyg Simple wrote: > > -i, --ignore-environment start with an empty environment > > A relative use of the executable will not be found if the environment is > empty. Not necessarily (see Linux, *BSD, ...). POSIX says this is "implementation-defined" - under the assumption that 'env' uses execvp() which is the case for the GNU coreutils version. >> Interestingly the approach in newlib/libc/posix/execvp.c differs from >> Cygwin and others: >> execvp() with PATH unset calls execv(). This has the same effect as >> execvp() with PATH set to current directory only. >> > Why do you assume that this is an issue with execvp? I never did (otherwise this would be a thread on cygwin-patches list). The above only means that it is IMO interesting that the Cygwin source package contains two implementations of execvp() which handle the unset PATH situation differently. > The user should > not expect that an undefined behavior behaves the same way on other > systems. Of course. But even then it is a reasonable question which possible alternative should be implemented by Cygwin. Cygwin homepage says "Get that Linux feeling, ...". So "implementation-defined" behavior should possibly be close to Linux :-) Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple