Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement chdir_long #26

Open
IgorTodorovskiIBM opened this issue Jul 7, 2023 · 0 comments
Open

Implement chdir_long #26

IgorTodorovskiIBM opened this issue Jul 7, 2023 · 0 comments
Assignees

Comments

@IgorTodorovskiIBM
Copy link
Collaborator

Originally posted by @MikeFultonDev in #25 (review)

Currently, chdir_long calls chdir, but according to glibc's comment it should do the following:

/* This is a function much like chdir, but without the PATH_MAX limitation
94 : on the length of the directory name. A significant difference is that
95 : it must be able to modify (albeit only temporarily) the directory
96 : name. It handles an arbitrarily long directory name by operating
97 : on manageable portions of the name. On systems without the openat
98 : syscall, this means changing the working directory to more and more
99 : `distant' points along the long directory name and then restoring
100 : the working directory. If any of those attempts to save or restore
101 : the working directory fails, this function exits nonzero.
102 :
103 : Note that this function may still fail with errno == ENAMETOOLONG, but
104 : only if the specified directory name contains a component that is long
105 : enough to provoke such a failure all by itself (e.g. if the component
106 : has length PATH_MAX or greater on systems that define PATH_MAX). */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant