public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH glibc] posix: Add error message for EAI_OVERFLOW
@ 2023-05-25 12:45 Dridi Boukelmoune
  2023-05-29 13:34 ` Arjun Shankar
  0 siblings, 1 reply; 6+ messages in thread
From: Dridi Boukelmoune @ 2023-05-25 12:45 UTC (permalink / raw)
  To: libc-alpha; +Cc: Dridi Boukelmoune

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
---
 sysdeps/posix/gai_strerror-strs.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysdeps/posix/gai_strerror-strs.h b/sysdeps/posix/gai_strerror-strs.h
index 19040a5138..667c4b2d4a 100644
--- a/sysdeps/posix/gai_strerror-strs.h
+++ b/sysdeps/posix/gai_strerror-strs.h
@@ -15,3 +15,4 @@ _S(EAI_NOTCANCELED, N_("Request not canceled"))
 _S(EAI_ALLDONE, N_("All requests done"))
 _S(EAI_INTR, N_("Interrupted by a signal"))
 _S(EAI_IDN_ENCODE, N_("Parameter string not correctly encoded"))
+_S(EAI_OVERFLOW, N_("Result too large for supplied buffer"))
-- 
2.40.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH glibc] posix: Add error message for EAI_OVERFLOW
  2023-05-25 12:45 [PATCH glibc] posix: Add error message for EAI_OVERFLOW Dridi Boukelmoune
@ 2023-05-29 13:34 ` Arjun Shankar
  2023-05-29 14:59   ` Arjun Shankar
  0 siblings, 1 reply; 6+ messages in thread
From: Arjun Shankar @ 2023-05-29 13:34 UTC (permalink / raw)
  To: Dridi Boukelmoune; +Cc: libc-alpha

> Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
> ---
>  sysdeps/posix/gai_strerror-strs.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/sysdeps/posix/gai_strerror-strs.h b/sysdeps/posix/gai_strerror-strs.h
> index 19040a5138..667c4b2d4a 100644
> --- a/sysdeps/posix/gai_strerror-strs.h
> +++ b/sysdeps/posix/gai_strerror-strs.h
> @@ -15,3 +15,4 @@ _S(EAI_NOTCANCELED, N_("Request not canceled"))
>  _S(EAI_ALLDONE, N_("All requests done"))
>  _S(EAI_INTR, N_("Interrupted by a signal"))
>  _S(EAI_IDN_ENCODE, N_("Parameter string not correctly encoded"))
> +_S(EAI_OVERFLOW, N_("Result too large for supplied buffer"))
> --
> 2.40.1
>

Thanks! This looks good to me.

Reviewed-by: Arjun Shankar <arjun@redhat.com>

...and I already pushed it!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH glibc] posix: Add error message for EAI_OVERFLOW
  2023-05-29 13:34 ` Arjun Shankar
@ 2023-05-29 14:59   ` Arjun Shankar
  2023-05-29 16:48     ` Dridi Boukelmoune
  0 siblings, 1 reply; 6+ messages in thread
From: Arjun Shankar @ 2023-05-29 14:59 UTC (permalink / raw)
  To: Dridi Boukelmoune; +Cc: libc-alpha

> > Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
> > ---
> >  sysdeps/posix/gai_strerror-strs.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/sysdeps/posix/gai_strerror-strs.h b/sysdeps/posix/gai_strerror-strs.h
> > index 19040a5138..667c4b2d4a 100644
> > --- a/sysdeps/posix/gai_strerror-strs.h
> > +++ b/sysdeps/posix/gai_strerror-strs.h
> > @@ -15,3 +15,4 @@ _S(EAI_NOTCANCELED, N_("Request not canceled"))
> >  _S(EAI_ALLDONE, N_("All requests done"))
> >  _S(EAI_INTR, N_("Interrupted by a signal"))
> >  _S(EAI_IDN_ENCODE, N_("Parameter string not correctly encoded"))
> > +_S(EAI_OVERFLOW, N_("Result too large for supplied buffer"))
> > --
> > 2.40.1
> >
>
> Thanks! This looks good to me.
>
> Reviewed-by: Arjun Shankar <arjun@redhat.com>
>
> ...and I already pushed it!

It would be nice to have a new test for gai_strerror: whether it
returns a unique string for each of the errors it should handle. It
also seems that `gai_strerror (0)` returns "Unknown error". It would
be nice if it returned "Success" instead. strerror already does the
same, presumably from sysdeps/gnu/errlist.h. Would you be interested
in fixing one or both of these up?

-- 
Arjun Shankar
he/him/his


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH glibc] posix: Add error message for EAI_OVERFLOW
  2023-05-29 14:59   ` Arjun Shankar
@ 2023-05-29 16:48     ` Dridi Boukelmoune
  2023-05-30 11:32       ` Carlos O'Donell
  0 siblings, 1 reply; 6+ messages in thread
From: Dridi Boukelmoune @ 2023-05-29 16:48 UTC (permalink / raw)
  To: Arjun Shankar; +Cc: libc-alpha

> It would be nice to have a new test for gai_strerror: whether it
> returns a unique string for each of the errors it should handle. It
> also seems that `gai_strerror (0)` returns "Unknown error". It would
> be nice if it returned "Success" instead. strerror already does the
> same, presumably from sysdeps/gnu/errlist.h. Would you be interested
> in fixing one or both of these up?

I will have a look at how glibc is tested and give it a try.

Dridi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH glibc] posix: Add error message for EAI_OVERFLOW
  2023-05-29 16:48     ` Dridi Boukelmoune
@ 2023-05-30 11:32       ` Carlos O'Donell
  2023-06-10  7:19         ` Dridi Boukelmoune
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos O'Donell @ 2023-05-30 11:32 UTC (permalink / raw)
  To: Dridi Boukelmoune, Arjun Shankar; +Cc: libc-alpha

On 5/29/23 12:48, Dridi Boukelmoune via Libc-alpha wrote:
>> It would be nice to have a new test for gai_strerror: whether it
>> returns a unique string for each of the errors it should handle. It
>> also seems that `gai_strerror (0)` returns "Unknown error". It would
>> be nice if it returned "Success" instead. strerror already does the
>> same, presumably from sysdeps/gnu/errlist.h. Would you be interested
>> in fixing one or both of these up?
> 
> I will have a look at how glibc is tested and give it a try.

Thanks!

The 'gai_strerror()' function is indirectly tested by getaddrinfo() tests in posix/*

To add a test for this you would:

- Add a new test in posix/* e.g. posix/tst-gai_strerror.c
- Add the test to posix/Makefile 'tests' target (lines 191-320) in the correct
  alpha sort position.
  Note: python scripts/sort-makefile-lines.py will sort lines for you.
- Use '#include <support/test-driver.c>' infrastructure.
  e.g. posix/tst-fnmatch7.c

Additional notes here:
https://sourceware.org/glibc/wiki/Testing/Builds

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH glibc] posix: Add error message for EAI_OVERFLOW
  2023-05-30 11:32       ` Carlos O'Donell
@ 2023-06-10  7:19         ` Dridi Boukelmoune
  0 siblings, 0 replies; 6+ messages in thread
From: Dridi Boukelmoune @ 2023-06-10  7:19 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Arjun Shankar, libc-alpha

> The 'gai_strerror()' function is indirectly tested by getaddrinfo() tests in posix/*
>
> To add a test for this you would:
>
> - Add a new test in posix/* e.g. posix/tst-gai_strerror.c
> - Add the test to posix/Makefile 'tests' target (lines 191-320) in the correct
>   alpha sort position.
>   Note: python scripts/sort-makefile-lines.py will sort lines for you.
> - Use '#include <support/test-driver.c>' infrastructure.
>   e.g. posix/tst-fnmatch7.c
>
> Additional notes here:
> https://sourceware.org/glibc/wiki/Testing/Builds

With your tips and `make help` I was able to submit a test case.

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-10  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 12:45 [PATCH glibc] posix: Add error message for EAI_OVERFLOW Dridi Boukelmoune
2023-05-29 13:34 ` Arjun Shankar
2023-05-29 14:59   ` Arjun Shankar
2023-05-29 16:48     ` Dridi Boukelmoune
2023-05-30 11:32       ` Carlos O'Donell
2023-06-10  7:19         ` Dridi Boukelmoune

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).