From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4890 Path: news.gmane.org!not-for-mail From: M Farkas-Dyck Newsgroups: gmane.linux.lib.musl.general Subject: Re: [patch] expose execvpe under _(GNU|BSD)_SOURCE Date: Tue, 15 Apr 2014 23:15:14 -0500 Message-ID: References: <20140416030624.GD26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1397621732 31797 80.91.229.3 (16 Apr 2014 04:15:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Apr 2014 04:15:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4894-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 16 06:15:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WaHFv-0003WM-Jf for gllmg-musl@plane.gmane.org; Wed, 16 Apr 2014 06:15:27 +0200 Original-Received: (qmail 1696 invoked by uid 550); 16 Apr 2014 04:15:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1688 invoked from network); 16 Apr 2014 04:15:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ZcHhfT+qy08yKMiiHaXhboQGFTGmWof2qeprTwy594I=; b=cLYIDF6FLp9jvdssxn6JDDS65ufIRLj2cQJBWQfwoEQv/qWGGtL2clBgPwLogM7lSO mobqyb/F2Xnwyq20ITbUCklcyRv/e6ABVF64J9SkCK/Vs5F7aq9wJCjtax3SA/nmLN4S U6rpykioJirtn2aC/vrw7iaMejm6UhWZ2gcVzIDoTRAh72g1rgc027x0xmK24oDMd6d9 D99KU3HxG55enfed8r2p+Jvhh6XVzr7ujzh2GXv7LjZnihsJV0nCSxMg9a/zZX8IIIss S46j8qL8OpsFVeS9afjtzZw2jmD1geSzfUYzA9PS8ObBBN5PP28HFh1Zq6dLdTMHLbsB Mk4Q== X-Received: by 10.194.24.74 with SMTP id s10mr4652776wjf.43.1397621714604; Tue, 15 Apr 2014 21:15:14 -0700 (PDT) In-Reply-To: <20140416030624.GD26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4890 Archived-At: On 15/04/2014, Rich Felker wrote: > I don't really object to exposing it under _BSD_SOURCE, but is there > precedent for this? Yes: http://www.openbsd.org/cgi-bin/man.cgi?query=execvpe > Testing feature test macros with #ifdef in the libc source files is > not meaningful, and doesn't respect the namespace. There are two > possible right ways to do this: either a separate source file (so it > can't affect the namespace), or a weak alias from __execvpe to > execvpe. The latter would be preferable here since it would have zero > increase to code size. --- include/unistd.h | 3 +++ src/process/execvp.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/unistd.h b/include/unistd.h index bf10a6d..342ab68 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -88,6 +88,9 @@ int execle(const char *, const char *, ...); int execl(const char *, const char *, ...); int execvp(const char *, char *const []); int execlp(const char *, const char *, ...); +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +int execvpe(const char *, char *const [], char *const []); +#endif int fexecve(int, char *const [], char *const []); _Noreturn void _exit(int); diff --git a/src/process/execvp.c b/src/process/execvp.c index 0a33e42..5c486b1 100644 --- a/src/process/execvp.c +++ b/src/process/execvp.c @@ -47,3 +47,5 @@ int execvp(const char *file, char *const argv[]) { return __execvpe(file, argv, __environ); } + +weak_alias(__execvpe, execvpe); -- 1.8.5.2