The goal of this patch is to make the function real_path thread-safe. To do, the current logic which uses chdir() to do the symlink resolution needed to be rewritten to perform the symlink resolution by hand. I wanted to get the bulk of the work out there for review quickly so technically this patch doesn't make real_path thread safe yet as it still uses a static buffer to serve up the resultant path. On a future iteration I plan on removing this and pushing ownership of the returned string to the callers. For more information on why this change is desirable you can see the following threads: https://public-inbox.org/git/20161129010538.GA121643@xxxxxxxxxx/ https://public-inbox.org/git/1480555714-186183-1-git-send-email-bmwill@xxxxxxxxxx/ Brandon Williams (1): real_path: make real_path thread-safe abspath.c | 183 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 122 insertions(+), 61 deletions(-) -- 2.8.0.rc3.226.g39d4020