- Passing NULL should result in EINVAL
- Passing an empty path should result in ENOENT
- Failure with a non-null buffer should leave a partial result. As pointed out in a comment in the test case, this reveals a discrepancy between the documentation and reality. I am not sure if we want to fix the code (and risk breaking existing consumers) or amend the documentation to point out that this feature is both non-portable and not always as helpful as it sounds.
Sponsored by: Klara, Inc.