posix: Add error message for EAI_OVERFLOW
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
pending
|
Patch applied
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
---
sysdeps/posix/gai_strerror-strs.h | 1 +
1 file changed, 1 insertion(+)
Comments
> 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!
> > 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?
> 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
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
> 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!
@@ -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"))