Skip to contentSkip to conversation

New: I am not sure why the definition of EAI_SYSTEM, from getaddrinfo, was changed from POSIX

Bug 214171 [email protected] 1 participant 2 messages Aug 25, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=214171

Bug ID: 214171
Summary: I am not sure why the definition of EAI_SYSTEM, from
getaddrinfo, was changed from POSIX
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
Assignee: [email protected]
Reporter: [email protected]
Regression: No

https://man7.org/linux/man-pages/man3/freeaddrinfo.3p.html says:

"[EAI_SYSTEM] A system error occurred; the error code can be found in errno."

Which makes a lot of sense. The function can fall because of name-resolution specific problem (EAI_NODATA). But otherwise it must be a plain old generic error that can be expressed with errno, so you should look in errno.

It's not explicitly said. But IMHO it's clear that it would be a bug to return EAI_SYSTEM without setting errno/setting errno to zero.

But then https://man7.org/linux/man-pages/man3/getaddrinfo.3.html replaces it with:

"EAI_SYSTEM Other system error, check errno for details."

Which, I'm not a native speaker, but it seems to me to leave returning EAI_SYSTEM and setting errno to 0 more open to interpretation. You can argue that in such a case errno == 0 simply means "no details".

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 214171] I am not sure why the definition of EAI_SYSTEM, from getaddrinfo, was changed from POSIX

https://bugzilla.kernel.org/show_bug.cgi?id=214171

Alejandro Colomar (man-pages) ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Alejandro Colomar (man-pages) ([email protected]) --- It seems reasonable to have doubts about if (ret == EAI_SYSTEM && errno == 0) can happen, with the current wording.

Perhaps we can use a wording similar to most pages' RETURN VALUE section:

[
EAI_SYSTEM Other system error; errno is set to indicate the error. ]

This is more explicit in that "errno is _set_".

Hmm?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.