History log of /src/usr.bin/stat/readlink.1
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
# 1.7 03-May-2025 kre

Make readlink(1) compliant with the POSIX-2004 (Issue 8).

POSIX 2004 requires that if a given file name to readlink(1)
doesn't refer to a symlink, an error be printed.

That conflicts with historic usage on NetBSD where readlink is
silent in that case (except for the exit status) -- rather than
altering our default behaviour, look for POSIXLY_CORRECT in the
environment, and issue an error only in that case (just means
switching between -q and -v as the default noise option).

While here, generate usage if no file args are given - POSIX
requires at least 1 (it actually specifies exactly 1) and while
we can extend that without issues to allow more than one, allowing
0 args (just because we do that for stat(1) and readlink(1) is
the same code) makes no sense at all for readlink - stdin cannot
possibly be a symbolic link.

Also, in the case of stat(1) if we do have no args, and the
fstat(STDIN) fails for some reason, don't claim that it is
lstat (or stat, depending upon -L) which failed:
stat: (stdin): lstat: Bad file descriptor
makes no sense at all. This can occur with something like
stat <&-
which is kind of obscure, but it is easy to DTRT.

No pullups planned.


Revision tags: netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.6 21-Jul-2022 wiz

branches: 1.6.4;
readlink: sort SEE ALSO


# 1.5 21-Jul-2022 kre

Add an Xr to realpath(1) (which does much the same as readlink -f).
Try not to forget the damn comma!


# 1.4 22-Jun-2022 wiz

Remove dot at end of SEE ALSO.


# 1.3 22-Jun-2022 uwe

readlink(1): Add italic correction.


# 1.2 22-Jun-2022 uwe

readlink(1): Add missing .El, use non-random .Bl -width


# 1.1 22-Jun-2022 kre

Divide stat.1 into stat.1 (now only includes stat(1)) and readlink.1

Apologies to cvs commit purists, but making this division required
line by line reading of the man pages, and I simply could not resist
also correcting some errors, addressing some omissions, improving some
wording ... all at the same time.