diff options
author | Richard Lau <riclau@uk.ibm.com> | 2020-02-07 01:45:28 +0000 |
---|---|---|
committer | Richard Lau <riclau@uk.ibm.com> | 2020-08-10 11:27:30 -0400 |
commit | ea92e9c720376470676582c3ac1bc9921c9142e7 (patch) | |
tree | 98583aeb7a473dd97d4e7913b5dcabaccb61c293 /docs/src | |
parent | 07e4168b67f6d06dac2c2e21c9a1976a0db9d312 (diff) | |
download | libuv-ea92e9c720376470676582c3ac1bc9921c9142e7.tar.gz libuv-ea92e9c720376470676582c3ac1bc9921c9142e7.zip |
aix: protect uv_exepath() from uv_set_process_title()
Store a copy of the original argv[0] to protect `uv_exepath()`
against `uv_set_process_title()` changing the value of argv[0].
Extract common code for finding a program on the current PATH.
Fixes: https://github.com/libuv/libuv/issues/2674
PR-URL: https://github.com/libuv/libuv/pull/2677
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/misc.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst index d765962e..b2725c39 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -261,9 +261,9 @@ API .. c:function:: char** uv_setup_args(int argc, char** argv) - Store the program arguments. Required for getting / setting the process title. - Libuv may take ownership of the memory that `argv` points to. This function - should be called exactly once, at program start-up. + Store the program arguments. Required for getting / setting the process title + or the executable path. Libuv may take ownership of the memory that `argv` + points to. This function should be called exactly once, at program start-up. Example: @@ -440,7 +440,8 @@ API .. c:function:: int uv_exepath(char* buffer, size_t* size) - Gets the executable path. + Gets the executable path. You *must* call `uv_setup_args` before calling + this function. .. c:function:: int uv_cwd(char* buffer, size_t* size) |