From owner-freebsd-current@FreeBSD.ORG Sat Jun 21 23:23:03 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E43D1065679; Sat, 21 Jun 2008 23:23:03 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 3C55C8FC14; Sat, 21 Jun 2008 23:23:03 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id A97181CCA9; Sun, 22 Jun 2008 01:23:01 +0200 (CEST) Date: Sun, 22 Jun 2008 01:23:01 +0200 From: Ed Schouten To: David Xu Message-ID: <20080621232301.GU93496@hoeg.nl> References: <485B7FFC.4040509@FreeBSD.org> <485B884A.70006@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zzd9Wh/bp6DhMAqJ" Content-Disposition: inline In-Reply-To: <485B884A.70006@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Current , Philip Paeps Subject: Re: execvpe port breakage X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 21 Jun 2008 23:23:03 -0000 --Zzd9Wh/bp6DhMAqJ Content-Type: multipart/mixed; boundary="uWCTLymdFNG0vGYZ" Content-Disposition: inline --uWCTLymdFNG0vGYZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable David, * David Xu wrote: > Looks like the application defined its own version of execvpe() ? > I think we should change name execvpe in our header file to something > else to avoid conflict. What do you think about the attached patch? --=20 Ed Schouten WWW: http://80386.nl/ --uWCTLymdFNG0vGYZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="execvpe.diff" Content-Transfer-Encoding: quoted-printable Index: include/unistd.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/unistd.h (revision 179921) +++ include/unistd.h (working copy) @@ -335,7 +335,6 @@ int execv(const char *, char * const *); int execve(const char *, char * const *, char * const *); int execvp(const char *, char * const *); -int execvpe(const char *, char * const *, char * const *); pid_t fork(void); long fpathconf(int, int); char *getcwd(char *, size_t); Index: lib/libc/gen/exec.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/gen/exec.3 (revision 179921) +++ lib/libc/gen/exec.3 (working copy) @@ -38,7 +38,6 @@ .Nm exect , .Nm execv , .Nm execvp , -.Nm execvpe , .Nm execvP .Nd execute a file .Sh LIBRARY @@ -65,8 +64,6 @@ .Ft int .Fn execvp "const char *file" "char *const argv[]" .Ft int -.Fn execvpe "const char *file" "char *const argv[]" "char *const envp[]" -.Ft int .Fn execvP "const char *file" "const char *search_path" "char *const argv[= ]" .Sh DESCRIPTION The @@ -121,10 +118,9 @@ pointer. .Pp The -.Fn execle , -.Fn exect +.Fn execle and -.Fn execvpe +.Fn exect functions also specify the environment of the executed process by following the .Dv NULL @@ -146,7 +142,6 @@ The functions .Fn execlp , .Fn execvp , -.Fn execvpe , and .Fn execvP will duplicate the actions of the shell in searching for an executable file @@ -157,7 +152,6 @@ .Fn execlp and .Fn execvp , -.Fn execvpe , search path is the path specified in the environment by .Dq Ev PATH variable. @@ -283,8 +277,7 @@ .Fn execl , .Fn execle , .Fn execlp , -.Fn execvp , -.Fn execvpe +.Fn execvp and .Fn execvP functions @@ -326,7 +319,3 @@ .Fn execvP function first appeared in .Fx 5.2 . -The -.Fn execvpe -function first appeared in -.Fx 8.0 . Index: lib/libc/gen/posix_spawn.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/gen/posix_spawn.c (revision 179921) +++ lib/libc/gen/posix_spawn.c (working copy) @@ -39,6 +39,7 @@ #include #include #include "un-namespace.h" +#include "libc_private.h" =20 extern char **environ; =20 @@ -212,7 +213,7 @@ _exit(127); } if (use_env_path) - execvpe(path, argv, envp !=3D NULL ? envp : environ); + _execvpe(path, argv, envp !=3D NULL ? envp : environ); else _execve(path, argv, envp !=3D NULL ? envp : environ); error =3D errno; Index: lib/libc/gen/exec.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/gen/exec.c (revision 179921) +++ lib/libc/gen/exec.c (working copy) @@ -46,6 +46,7 @@ =20 #include #include "un-namespace.h" +#include "libc_private.h" =20 extern char **environ; =20 @@ -140,7 +141,7 @@ int execvp(const char *name, char * const *argv) { - return (execvpe(name, argv, environ)); + return (_execvpe(name, argv, environ)); } =20 static int @@ -272,7 +273,7 @@ } =20 int -execvpe(const char *name, char * const argv[], char * const envp[]) +_execvpe(const char *name, char * const argv[], char * const envp[]) { const char *path; =20 Index: lib/libc/include/libc_private.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/include/libc_private.h (revision 179921) +++ lib/libc/include/libc_private.h (working copy) @@ -195,4 +195,7 @@ /* Without back-compat translation */ extern int __sys_fcntl(int, int, ...); =20 +/* execve() with PATH processing to implement posix_spawnp() */ +int _execvpe(const char *, char * const *, char * const *); + #endif /* _LIBC_PRIVATE_H_ */ --uWCTLymdFNG0vGYZ-- --Zzd9Wh/bp6DhMAqJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkhdjVUACgkQ52SDGA2eCwV+3wCdFhZ0qYw8rHRRkCplSqsbZyob bOcAnRLubJXMYJBactGF0JPAqTiyZQ5t =MnHe -----END PGP SIGNATURE----- --Zzd9Wh/bp6DhMAqJ--