public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Rical Jasan <ricaljasan@pacific.net>
To: Zack Weinberg <zackw@panix.com>
Cc: Joseph Myers <joseph@codesourcery.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Carlos O'Donell <carlos@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH v3 4/7] manual: Refactor errno @comments.
Date: Fri, 19 May 2017 09:46:00 -0000	[thread overview]
Message-ID: <f59e01a9-c20f-0fc8-81b9-efcf7fad0a1f@pacific.net> (raw)
In-Reply-To: <CAKCAbMjDXquNKsuJnqRt3thDM6yWD1AtfjN1uTQ--71=+zo8ig@mail.gmail.com>

On 05/18/2017 05:32 AM, Zack Weinberg wrote:
> On Thu, May 18, 2017 at 5:42 AM, Rical Jasan <ricaljasan@pacific.net> wrote:
>> On 05/17/2017 06:21 AM, Zack Weinberg wrote:
>>> I think the error *numbers* shouldn't be embedded in the manual.  Only
>>
>> I had the same thought; very surprising to find the sources were being
>> generated from the manual.  I also thought it was strange because I
>> remember a conversation a while back where it was pointed out the source
>> and documentation are under different licences and generally couldn't
>> cross-reference each other like that. [1]  That conversation should have
>> been on libc-alpha, but happened on libc-help (my fault).
> 
> Abstractly, it is important for the exact (English) text of the
> strerror() messages to appear verbatim in the manual, so that when

We could render the error strings with @errno so that the errors, codes,
and strings are only recorded once, and also protected by the nature of
using a custom macro.

> people get an error that they don't know what it means, they can
> search the manual for it.

@errno can generate a @cindex for them too, so the string still only
needs to be recorded once, and, e.g., "Operation not permitted" winds up
in the Concept Index.

> Given that, it's obviously desirable not to
> have to maintain them in two places, and since errlist.c has been
> generated from errnos.texi for a very long time, I don't think we have
> to worry about the legalities of copying between GPL and GFDL files.
> 
> I'd personally prefer to keep the strerror messages in the manual
> because then they are right next to the longer descriptions of what
> the error means, and people editing the manual will know that the
> longer description needs to make sense of the strerror message. This
> isn't super important, since this part of the manual hasn't changed
> much in many years, but on the other hand, it may be time for someone
> to go through the whole manual and revise it...

Yeah, the whole thing.  :)

> A counterargument is that each kernel port may have its own additional
> error constants that should be documented, and conversely, the manual
> should make really clear which error numbers are system-specific.

Are error "numbers" (e.g., 27) system-specific, or did you mean error
constants there too (e.g., EPERM)?

I'm not exactly sure what information you would want to convey with it,
or how (thinking of rendering), but we could extend @errno in some way,
I suppose:

@errnox{EKERN_TIMEDOUT, 27, Mach, Kernel operation timed out}

Maybe defined like:

@macro errnox {err, val, sys, msg}
@cindex \msg\
\msg\.  Specific to \sys\.

@end macro

(I used @*x there since many of the errors may be common across systems,
so we may not want to render the "Specific to ..."; something that
doesn't look like a list might be better, like @syserrno.)

Is that along the lines of what you were getting at?

> Right now all of Linux's error constants appear in the manual, but a
> whole bunch of Hurd error constants don't (the ones starting with
> EMACH_, EKERN_, EMIG_, and ED_ - which may mean they don't wind up in
> errlist.c and strerror() doesn't work for them, which is bad) and
> quite a few constants that do appear in the manual don't have
> definitions on Linux:
> 
> EAUTH
> EBACKGROUND
> EBADRPC
> ED
> EDIED
> EFTYPE
> EGRATUITOUS
> EGREGIOUS
> EIEIO
> ENEEDAUTH
> EPROCLIM
> EPROCUNAVAIL
> EPROGMISMATCH
> EPROGUNAVAIL
> ERPCMISMATCH
> 
> (I also notice that there are a lot of errors that don't *have* long
> descriptions, but that's a separate issue.)

There are a lot of blank descriptions, descriptions that are nothing but
the error string repeated, long descriptions that don't repeat the error
string verbatim, missing error values, and missing errors.  I don't mind
picking this up next.

I submitted a v4 for this patchset that changes the patch for this
thread to use @errno.  It takes a conservative approach to changing
errlist.awk and errnos.awk, amounting to little more than a refactoring
of the errno.texi processing.  It will have to be rebased if your work
goes in first, but I figured it best to post it so it can get reviewed
in the meantime.

Rical

  reply	other threads:[~2017-05-19  9:46 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 10:55 [PATCH v2 0/5] Header & Standards Cleanup Rical Jasan
2016-12-06 10:55 ` [PATCH v2 1/5] manual: Refactor header and standards annotations Rical Jasan
2016-12-06 13:49   ` Zack Weinberg
2016-12-06 15:33   ` Joseph Myers
2016-12-19 10:37     ` Rical Jasan
2016-12-19 13:48       ` Joseph Myers
2017-02-07  6:46   ` Rical Jasan
2016-12-06 10:55 ` [PATCH v2 2/5] manual: Convert @tables of variables to @vtables Rical Jasan
2016-12-06 13:50   ` Zack Weinberg
2016-12-06 15:46   ` Joseph Myers
2016-12-07 15:18   ` Nix
2016-12-08  1:38     ` Rical Jasan
2016-12-21 10:08       ` Rical Jasan
2016-12-21 12:42         ` Joseph Myers
2016-12-06 10:55 ` [PATCH v2 4/5] manual: Enforce header and standard requirements Rical Jasan
2016-12-06 10:56 ` [PATCH v2 3/5] manual: Add new header and standards annotations Rical Jasan
2016-12-06 13:23   ` Zack Weinberg
2016-12-06 14:27     ` Andreas Schwab
2016-12-06 16:24     ` Joseph Myers
2016-12-06 19:23       ` Zack Weinberg
2016-12-06 21:42         ` Joseph Myers
2016-12-07 16:32   ` Joseph Myers
2016-12-08  2:56     ` Rical Jasan
2016-12-08 14:02       ` Joseph Myers
2016-12-12  9:01         ` Rical Jasan
2016-12-14 18:18           ` Joseph Myers
2016-12-14 23:30             ` Rical Jasan
2016-12-15  9:58               ` Rical Jasan
2016-12-15 13:01                 ` Joseph Myers
2017-02-07  5:13                   ` Rical Jasan
2017-02-07 16:41                     ` Joseph Myers
2017-02-08  8:50                       ` Rical Jasan
2017-02-08 13:52                         ` Joseph Myers
2017-02-12  6:01                           ` Rical Jasan
2017-04-04  3:58                             ` Rical Jasan
2017-04-04 11:26                               ` Joseph Myers
2017-04-05  3:08                                 ` Rical Jasan
2017-06-16 13:40                                   ` Zack Weinberg
2017-06-16  8:28     ` Rical Jasan
2016-12-06 11:42 ` [PATCH v2 5/5] manual: Clean up miscellaneous standards Rical Jasan
2017-05-16  9:55 ` [PATCH v3 0/7] manual: Header & Standards Cleanup Rical Jasan
2017-05-16  9:55   ` [PATCH v3 2/7] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-16  9:55   ` [PATCH v3 1/7] manual: Provide one-off standards conversion script Rical Jasan
2017-05-16  9:55   ` [PATCH v3 3/7] manual: Fix up invalid header and standards syntax Rical Jasan
2017-05-16 11:51     ` Joseph Myers
2017-05-17  4:49       ` Rical Jasan
2017-05-17 10:03         ` Joseph Myers
2017-05-18  8:10       ` Rical Jasan
2017-05-16 10:27   ` [PATCH v3 7/7] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-16 10:28   ` [PATCH v3 5/7] manual: Convert @tables of annotated @items to @vtables Rical Jasan
2017-05-16 11:53     ` Joseph Myers
2017-05-18  8:11       ` Rical Jasan
2017-05-16 10:28   ` [PATCH v3 6/7] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-16 10:29   ` [PATCH v3 4/7] manual: Refactor errno @comments Rical Jasan
2017-05-16 11:06     ` Joseph Myers
2017-05-17  4:44       ` Rical Jasan
2017-05-17 13:21         ` Zack Weinberg
2017-05-17 13:31           ` Zack Weinberg
2017-05-18  9:42           ` Rical Jasan
2017-05-18 12:32             ` Zack Weinberg
2017-05-19  9:46               ` Rical Jasan [this message]
2017-05-19 20:50                 ` Zack Weinberg
2017-05-19  6:20         ` Rical Jasan
2017-05-18  9:58       ` Rical Jasan
2017-05-19  9:33   ` [PATCH v4 0/5] manual: Header & Standards Cleanup Rical Jasan
2017-05-19  9:33     ` [PATCH v4 2/5] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-19 21:02       ` Zack Weinberg
2017-05-20  6:05         ` Rical Jasan
2017-05-19  9:34     ` [PATCH v4 3/5] manual: Convert errno @comments to new @errno macro Rical Jasan
2017-05-19 21:03       ` Zack Weinberg
2017-05-20  6:05         ` Rical Jasan
2017-05-19  9:34     ` [PATCH v4 5/5] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-19  9:34     ` [PATCH v4 1/5] manual: Provide one-off standards conversion script Rical Jasan
2017-05-19  9:36     ` [PATCH v4 4/5] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-19 21:05     ` [PATCH v4 0/5] manual: Header & Standards Cleanup Zack Weinberg
2017-05-22  9:03       ` Rical Jasan
2017-05-24 13:12         ` Rical Jasan
2017-05-24 13:29           ` Zack Weinberg
2017-05-26  5:01     ` [PATCH v5 0/3] " Rical Jasan
2017-05-26  5:01       ` [PATCH v5 0/3] manual: Header & Standards Cleanup [conversion script] Rical Jasan
2017-05-26  5:01       ` [PATCH v5 3/3] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-26  5:01       ` [PATCH v5 2/3] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-26  5:01       ` [PATCH v5 1/3] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-31  9:23       ` [PATCH v5 0/3] manual: Header & Standards Cleanup Rical Jasan
2017-06-08 11:46         ` [PING] " Rical Jasan
2017-06-08 13:41           ` Zack Weinberg
2017-06-09  2:31             ` Rical Jasan
2017-06-15  8:47               ` Rical Jasan
2017-06-15  8:32           ` Rical Jasan
2017-06-15 18:01             ` Joseph Myers
2017-06-16  4:38               ` Rical Jasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f59e01a9-c20f-0fc8-81b9-efcf7fad0a1f@pacific.net \
    --to=ricaljasan@pacific.net \
    --cc=carlos@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mtk.manpages@gmail.com \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).