I’m trying to analyse some code (not written by myself) which calls readlink with a positive bufsize, and then tests if the result is zero. I can’t see how the result can be zero, with everything I’ve tried it is either -1, size of the real link or size of the soft link.
Can the result be zero, and if so how?
The POSIX description of
readlink()says:Since the empty string is not a valid file name, I can see no way that the return value will be zero if the
bufsizeis bigger than 0.