Page MenuHomeFreeBSD

lockf.1: Organize and provide error numbers
Needs ReviewPublic

Authored by ziaee on Jan 15 2025, 8:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 25, 8:07 PM
Unknown Object (File)
Dec 31 2025, 6:56 AM
Unknown Object (File)
Dec 12 2025, 4:32 AM
Unknown Object (File)
Dec 11 2025, 5:24 PM
Unknown Object (File)
Nov 23 2025, 12:00 AM
Unknown Object (File)
Nov 5 2025, 5:21 AM
Unknown Object (File)
Nov 4 2025, 12:40 AM
Unknown Object (File)
Oct 30 2025, 3:36 AM
Subscribers

Details

Reviewers
carlavilla
mhorne
kevans
Group Reviewers
manpages
Summary
Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

Reported by:	Antranig Vartanian <antranigv@freebsd.am>
MFC after:	3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71044
Build 67927: arc lint + arc unit

Event Timeline

ziaee requested review of this revision.Jan 15 2025, 8:15 PM

Revert s/Dv/Sy/g, I did that to align with sysexits(3), however this was
a mistake as I think apropos Dv=EX_USAGE is an outstanding workflow. I
now believe that error messages should always be Dv.

Use Er to markup error constants according to mdoc(7), and use
Dv to markup the exit numbers to enable apropos Dv=64.

usr.bin/lockf/lockf.1
216

Okay, now I see where you were coming from with D48619...

It seems clear to me that apropos Er=EX_USAGE should lead to this page. But I am not sure that apropos Dv=64 needs to.

If the status code I am investigating comes from lockf(1), then I surely know which man page to check, no?

222–223

.Po/.Pc save some headaches here.

Honestly, IMHO what would be best is Er=$actual_returned_number, but mandoc isn't written that way. The workflow for Er is actually purely imagined for me at this point since it doesn't exist yet for anything I've checked, which is normally completely unacceptable, but my rationale is that confirming to the standard will create allowance for the workflow.

One idea for Dv contributed by kevans@ is debugging complex shell scripts with $?, which I think would be reinforcing design consistency.

ziaee retitled this revision from lockf.1: Minor polish to lockf.1: Organize and provide error numbers.Fri, Feb 27, 12:18 AM
ziaee edited the summary of this revision. (Show Details)
ziaee added a reviewer: kevans.

redo this commit without using Dvs. I think that organizing this page
and fufilling the requested error numbers is valuable and systemic
deficiencies in marking up error constants vs codes is not something
i can do anything about right now.