[PATCH-v2] Re: [PATCH] Add missing strerror() strings, clean up

Nick Withers nick.withers@anu.edu.au
Fri Jul 11 02:47:00 GMT 2014


On Thu, 2014-07-10 at 21:14 -0400, Craig Howland wrote:
> On 07/10/2014 08:12 PM, Nick Withers wrote:
> > Hi Craig,
> >
> > Thanks for taking the time!
> >
> > Could you include me on any replies? I'm not subscribed.
> >
> >> On 07/10/2014 06:26 AM, Nick Withers wrote:
> >>> Hi all,
> >>>
> >>> The attached patch:
> >>> - Adds to strerror()'s strerror.c strings for:
> >>>     ...
> >>>
> >>> - Changes the following comments in errno.h to match the implementation:
> >>>     ...
> >>>     - EDOM, from "Math arg out of domain of func" to "Math
> >>> argument" (would "Mathematics argument out of domain of function" or
> >>> "Mathematical (...)" be better?)
> >> "Math argument" would be a step backwards. If it were to be changed at
> >> all, use the POSIX "Mathematics argument out of domain of
> >> function." (The existing is POSIX with 3 abbreviations, and really
> >> could be left as-is.)
> > "Math argument" is the existing message. There's a comment in errno.h
> > though, that is meant to match the message proper, and currently does
> > not. That's what's addressed here.
> >
> > However, if you'd like me to change it to "Mathematics argument out of
> > domain of function", happy to do so (I certainly like that better...).
> Yes, I misunderstood the comment, getting it backwards as you point out.  What I 
> should have said:  EDOM seems to be a better candidate for changing the 
> implementation to match the errno.h comment.  In the spirit of keeping size 
> down, using the slightly-abbreviated existing "Math arg out of domain of func" 
> from the errno.h comment seems to be a readily-understood good candidate for 
> strerror.c.  If there were a strong objection to this size growth of 16 bytes, 
> perhaps "Math arg domain" (+2) or "Math domain" (-2) could be used, both being 
> more precise and more easily associated with the EDOM name.  Since my 
> applications are not usually very tight for space, my personal preference would 
> be for the longer string that essentially matches POSIX.
> Craig

Cheers Craig,

Attached is an updated patch, which:
____

- Adds to strerror()'s strerror.c strings for:
  - EADDRNOTAVAIL, "Address not available"
  - ECONNRESET, "Connection reset by peer"
  - EILSEQ, "Illegal byte sequence"
  - ENETRESET, "Connection aborted by network"
  - ENODATA, "No data" (full comment in errno.h was "No data (for no
delay io)")
  - EOVERFLOW, "Value too large for defined data type"

- Changes EDOM strerror() string from "Math argument" ("Math arg out of
domain of func" in errno.h comments) to "Mathematics argument out of
domain of function"

- Changes EMFILE's "Too many open files" to "File descriptor value too
large"

- Changes the following comments in errno.h to match the existing
implementation:
  - EBADMSG, from "Trying to read unreadable message" to "Bad message"
  - EBUSY, from "Mount device busy" to "Device or resource busy"
  - ECONNABORTED, from "Connection aborted" to "Software caused
connection abort" (note that the previous comment reflected the
suggested text at
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html ,
perhaps here I should have changed the implementation instead?)
  - EDEADLK, from "Deadlock condition" to "Deadlock"
  - EILSEQ, from none to "Illegal byte sequence"
  - ENOLCK, from "No record locks available" to "No lock"
  - ENOLINK, from "The link has been severed" to "Virtual circuit is
gone" (reserved, according to
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html )
  - ENOMEM, from "Not enough core" to "Not enough space"
  - ENOSR, from "Out of streams resources" to "No stream resources"
  - ENOSTR, from "Device not a stream" to "Not a stream"
  - ENOTTY, from "Not a typewriter" to "Not a character device"
  - EOPNOTSUPP, from "Operation not supported on transport endpoint" to
"Operation not supported on socket"
  - EPERM, from "Not super-user" to "Not owner"
  - ERANGE, from "Math result not representable" to "Result too large"
  - EROFS, from "Read only file system", to "Read-only file system"
  - ETIME, from "Timer expired" to "Stream ioctl timeout"

- Adds strerror.c leading doc entries for:
  - ENOBUFS, "No buffer space available"
  - EOPNOTSUPP, "Operation not supported on socket"
  - EWOULDBLOCK, EAGAIN

- Changes strerror.c's leading doc section entry for ENETDOWN from
"Network interface not configured" to "Network interface is not
configured" to match the implementation and errno.h (would "Network is
down" be better?)

- Re-orders ECANCELED, ENOTRECOVERABLE, EOWNERDEAD and ESTRPIPE
alphabetically in strerror.c's leading doc section, per instructions at
the top of the file
____

Differences from the previous patch are:
____

- Changes EDOM strerror() string from "Math argument" ("Math arg out of
domain of func" in errno.h comments) to "Mathematics argument out of
domain of function"

- Changes EMFILE's "Too many open files" to "File descriptor value too
large"
____

Ta all!
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strerror-v2.patch
Type: text/x-patch
Size: 9821 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20140711/d09bf671/attachment.bin>


More information about the Newlib mailing list