diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-01-18 13:29:36 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-01-21 23:01:27 +0530 |
commit | fb7bff12e81c677a6622f724edd4d4987dd9d971 (patch) | |
tree | 6aeb710a4d50940306999e5df8b701ea52ce389f /support/temp_file.h | |
parent | 6b8dbbd03ac88f169b65b5c7d7278576a11d2e44 (diff) | |
download | glibc-fb7bff12e81c677a6622f724edd4d4987dd9d971.tar.gz glibc-fb7bff12e81c677a6622f724edd4d4987dd9d971.tar.xz glibc-fb7bff12e81c677a6622f724edd4d4987dd9d971.zip |
support: Add helpers to create paths longer than PATH_MAX
Add new helpers support_create_and_chdir_toolong_temp_directory and support_chdir_toolong_temp_directory to create and descend into directory trees longer than PATH_MAX. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'support/temp_file.h')
-rw-r--r-- | support/temp_file.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/support/temp_file.h b/support/temp_file.h index 50a443abe4..8459ddda72 100644 --- a/support/temp_file.h +++ b/support/temp_file.h @@ -44,6 +44,15 @@ int create_temp_file_in_dir (const char *base, const char *dir, returns. The caller should free this string. */ char *support_create_temp_directory (const char *base); +/* Create a temporary directory tree that is longer than PATH_MAX and schedule + it for deletion. BASENAME is used as a prefix for the unique directory + name, which the function returns. The caller should free this string. */ +char *support_create_and_chdir_toolong_temp_directory (const char *basename); + +/* Change into the innermost directory of the directory tree BASE, which was + created using support_create_and_chdir_toolong_temp_directory. */ +void support_chdir_toolong_temp_directory (const char *base); + __END_DECLS #endif /* SUPPORT_TEMP_FILE_H */ |