diff options
author | Mark Shinwell <shinwell@codesourcery.com> | 2006-09-29 00:41:08 +0400 |
---|---|---|
committer | Mark Shinwell <shinwell@codesourcery.com> | 2006-09-29 00:41:08 +0400 |
commit | 0a6395c36ff87a07d945d918869aad6851106485 (patch) | |
tree | 5e23f3951ae6dc3e16e5b454a26f83dac2ead599 | |
parent | 9fbad39d7751d4ff54139f1c930567569d489b4e (diff) |
* libiberty.h: Declare pex_run_in_environment.
libiberty/
* pex-common.c: New function pex_run_in_environment.
* pex-common.h: Add environment parameter to exec_child.
* pex-msdos.c: Add environment parameter to pex_msdos_exec_child.
* pex-djgpp.c: Add environment parameter to pex_djgpp_exec_child.
(pex_djgpp_exec_child): Pass environment to child process.
* pex-unix.c: Add environment parameter to pex_unix_exec_child.
(pex_unix_exec_child): Pass environment to child process.
* pex-win32.c: Add environment parameter to pex_win32_exec_child.
New function env_compare for comparing VAR=VALUE pairs.
(win32_spawn): Assemble environment block and pass to CreateProcess.
(spawn_script): Pass environment through to win32_spawn.
(pex_win32_exec_child): Pass environment through to spawn_script and
win32_spawn.
* functions.texi: Regenerate.
* pexecute.txh: Document pex_run_in_environment.
-rw-r--r-- | ChangeLog.csl | 22 | ||||
-rw-r--r-- | include/libiberty.h | 17 |
2 files changed, 39 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index cf7b0ba8d..8fcce895b 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,25 @@ +2006-09-28 Mark Shinwell <shinwell@codesourcery.com> + + include/ + * libiberty.h: Declare pex_run_in_environment. + + libiberty/ + * pex-common.c: New function pex_run_in_environment. + * pex-common.h: Add environment parameter to exec_child. + * pex-msdos.c: Add environment parameter to pex_msdos_exec_child. + * pex-djgpp.c: Add environment parameter to pex_djgpp_exec_child. + (pex_djgpp_exec_child): Pass environment to child process. + * pex-unix.c: Add environment parameter to pex_unix_exec_child. + (pex_unix_exec_child): Pass environment to child process. + * pex-win32.c: Add environment parameter to pex_win32_exec_child. + New function env_compare for comparing VAR=VALUE pairs. + (win32_spawn): Assemble environment block and pass to CreateProcess. + (spawn_script): Pass environment through to win32_spawn. + (pex_win32_exec_child): Pass environment through to spawn_script and + win32_spawn. + * functions.texi: Regenerate. + * pexecute.txh: Document pex_run_in_environment. + 2006-09-19 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> Ian Lance Taylor <ian@wasabisystems.com> diff --git a/include/libiberty.h b/include/libiberty.h index 6bd318e0f..1328d3eb1 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -448,6 +448,23 @@ extern const char *pex_run (struct pex_obj *obj, int flags, const char *outname, const char *errname, int *err); +/* As for pex_run (), but takes an extra parameter to enable the + environment for the child process to be specified. + + ENV The environment for the child process, specified as + an array of character pointers. Each element of the + array should point to a string of the form VAR=VALUE, + with the exception of the last element which must be + a null pointer. +*/ + +extern const char *pex_run_in_environment (struct pex_obj *obj, int flags, + const char *executable, + char * const *argv, + char * const *env, + const char *outname, + const char *errname, int *err); + /* Return a `FILE' pointer FP for the standard input of the first program in the pipeline; FP is opened for writing. You must have passed `PEX_USE_PIPES' to the `pex_init' call that returned OBJ. |