We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished.
Code like cmp -h and xz takes advantage of this.
Details
- Reviewers
kib - Group Reviewers
manpages - Commits
- rS309026: open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW.
None
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
lib/libc/sys/open.2 | ||
---|---|---|
509 ↗ | (On Diff #22362) | s/fails with/returns error/ ? 'fails' implies that the implementation misbehaves, while there the narrative is about proper handling of a condition. |
The proposed wording is awkward.
See my suggestions for improvement.
lib/libc/sys/open.2 | ||
---|---|---|
509 ↗ | (On Diff #22362) | Agreed. Or maybe ".Fx sets errno to EMLINK if O_NOFOLLOW is set in flags and the final component of pathname is a symbolic link instead of ELOOP specified by POSIX" plus blelow or ".Fx sets errno to EMLINK instead of ELOOP as specified by POSIX when O_NOFOLLOW is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in on of its non-final component." |
518–520 ↗ | (On Diff #22362) | "to distinguish the case of too many symbolic link traversals in the non-final components of the pathname from the case of a symbolic link in the final component." is shorter and imho clearer. |
lib/libc/sys/open.2 | ||
---|---|---|
510 ↗ | (On Diff #22444) | .Va errno |