public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH,hurd] Fix arbitrary error code
@ 2022-04-12  9:44 Samuel Thibault
  2022-04-12  9:53 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Thibault @ 2022-04-12  9:44 UTC (permalink / raw)
  To: libc-alpha, Florian Weimer

ELIBBAD is Linux-specific, Hurd has EGRATUITOUS instead.

diff --git a/nss/nss_test_errno.c b/nss/nss_test_errno.c
index 680f8a07b9..d27368f4f3 100644
--- a/nss/nss_test_errno.c
+++ b/nss/nss_test_errno.c
@@ -28,7 +28,13 @@ static void __attribute__ ((constructor))
 init (void)
 {
   /* An arbitrary error code which is otherwise not used.  */
+#if defined(__linux__)
   errno = ELIBBAD;
+#elif defined(__GNU__)
+  errno = EGRATUITOUS;
+#else
+#error missing arbitrary error code
+#endif
 }
 
 /* Lookup functions for pwd follow that do not return any data.  */

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

* Re: [PATCH,hurd] Fix arbitrary error code
  2022-04-12  9:44 [PATCH,hurd] Fix arbitrary error code Samuel Thibault
@ 2022-04-12  9:53 ` Florian Weimer
  2022-04-12  9:57   ` Samuel Thibault
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2022-04-12  9:53 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: libc-alpha

* Samuel Thibault:

> ELIBBAD is Linux-specific, Hurd has EGRATUITOUS instead.
>
> diff --git a/nss/nss_test_errno.c b/nss/nss_test_errno.c
> index 680f8a07b9..d27368f4f3 100644
> --- a/nss/nss_test_errno.c
> +++ b/nss/nss_test_errno.c
> @@ -28,7 +28,13 @@ static void __attribute__ ((constructor))
>  init (void)
>  {
>    /* An arbitrary error code which is otherwise not used.  */
> +#if defined(__linux__)
>    errno = ELIBBAD;
> +#elif defined(__GNU__)
> +  errno = EGRATUITOUS;
> +#else
> +#error missing arbitrary error code
> +#endif
>  }
>  
>  /* Lookup functions for pwd follow that do not return any data.  */

I don't see a build failure because of this?

Maybe we can pick another shared error code?

Related question: Would it be possible to add ELIBEXEC to Hurd some day?

Thanks,
Florian


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

* Re: [PATCH,hurd] Fix arbitrary error code
  2022-04-12  9:53 ` Florian Weimer
@ 2022-04-12  9:57   ` Samuel Thibault
  2022-04-12 10:31     ` Florian Weimer
  2022-04-12 20:45     ` Samuel Thibault
  0 siblings, 2 replies; 6+ messages in thread
From: Samuel Thibault @ 2022-04-12  9:57 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

Florian Weimer, le mar. 12 avril 2022 11:53:01 +0200, a ecrit:
> > +++ b/nss/nss_test_errno.c
> > @@ -28,7 +28,13 @@ static void __attribute__ ((constructor))
> >  init (void)
> >  {
> >    /* An arbitrary error code which is otherwise not used.  */
> > +#if defined(__linux__)
> >    errno = ELIBBAD;
> > +#elif defined(__GNU__)
> > +  errno = EGRATUITOUS;
> > +#else
> > +#error missing arbitrary error code
> > +#endif
> >  }
> >  
> >  /* Lookup functions for pwd follow that do not return any data.  */
> 
> I don't see a build failure because of this?

The build failure happens during make check, not during make.

> Maybe we can pick another shared error code?

Yep, sure, I'm just not sure what should be used.

> Related question: Would it be possible to add ELIBEXEC to Hurd some day?

That should be easy to implement, yes. We can already just enable its
definition in glibc, and we'll be able to implement it in Hurd's exec
server.

Samuel

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

* Re: [PATCH,hurd] Fix arbitrary error code
  2022-04-12  9:57   ` Samuel Thibault
@ 2022-04-12 10:31     ` Florian Weimer
  2022-04-12 20:18       ` Samuel Thibault
  2022-04-12 20:45     ` Samuel Thibault
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2022-04-12 10:31 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: libc-alpha

* Samuel Thibault:

>> I don't see a build failure because of this?
>
> The build failure happens during make check, not during make.

Huh.  For me, it does not.

>> Maybe we can pick another shared error code?
>
> Yep, sure, I'm just not sure what should be used.

We can use an arbitrary constant such as -1009.

Thanks,
Florian


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

* Re: [PATCH,hurd] Fix arbitrary error code
  2022-04-12 10:31     ` Florian Weimer
@ 2022-04-12 20:18       ` Samuel Thibault
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Thibault @ 2022-04-12 20:18 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

Florian Weimer, le mar. 12 avril 2022 12:31:06 +0200, a ecrit:
> * Samuel Thibault:
> 
> >> I don't see a build failure because of this?
> >
> > The build failure happens during make check, not during make.
> 
> Huh.  For me, it does not.

Maybe I was not precise enough: the build failure happens on GNU/Hurd
systems only, where make check can actually not only build but also run
programs.

> >> Maybe we can pick another shared error code?
> >
> > Yep, sure, I'm just not sure what should be used.
> 
> We can use an arbitrary constant such as -1009.

Ok, done so!

Samuel

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

* Re: [PATCH,hurd] Fix arbitrary error code
  2022-04-12  9:57   ` Samuel Thibault
  2022-04-12 10:31     ` Florian Weimer
@ 2022-04-12 20:45     ` Samuel Thibault
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Thibault @ 2022-04-12 20:45 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

Samuel Thibault, le mar. 12 avril 2022 11:57:42 +0200, a ecrit:
> Florian Weimer, le mar. 12 avril 2022 11:53:01 +0200, a ecrit:
> > Related question: Would it be possible to add ELIBEXEC to Hurd some day?
> 
> That should be easy to implement, yes. We can already just enable its
> definition in glibc, and we'll be able to implement it in Hurd's exec
> server.

Now done so.

Samuel

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

end of thread, other threads:[~2022-04-12 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  9:44 [PATCH,hurd] Fix arbitrary error code Samuel Thibault
2022-04-12  9:53 ` Florian Weimer
2022-04-12  9:57   ` Samuel Thibault
2022-04-12 10:31     ` Florian Weimer
2022-04-12 20:18       ` Samuel Thibault
2022-04-12 20:45     ` Samuel Thibault

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