Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: pathconf() again



> Random questions:  Can someone explain how one is supposed to determine a
> useful buffer size for e.g. readlink() if pathconf() returns `unlimited'?

What I was told is that one should malloc an arbitrary amount, say 512
bytes, then realloc to double the buffer size if it's too small.  Rinse
and repeat.

> For that matter, how does one even know what directory name to pass into
> pathconf() in that case?

I assume you want the PATH_MAX of the filesystem where the link lives,
and not the psychically-determined filesystem to which it's pointing.



Messages sorted by: Reverse Date, Date, Thread, Author