[PATCH v3] Print absolute paths in printpathn when -yy is used
zubin.mithra at gmail.com
Tue Jun 17 06:38:26 UTC 2014
> you could use an alloca() buffer starting at a "large enough" value to cover
> most common cases (like 256) and put it into a loop -- when the return value
> of readlink is equal to bufsiz, double the buffer length and try again.
I think there are a few more cases where the call might fail. I tried
creating a path > 4096 in length, and used a readlink call with a
buffer quite larger than the actual path. However, the call still
failed with a "File name too long".
The code I used for testing :
Keeping that in mind, would using realloc repeatedly be a good idea?
I've jotted down a bit more about what I tested out here:
More information about the Strace-devel