All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ell/signal.h: use sigset_t instead of internal libc implementation
@ 2018-11-01  9:27 maxice8
  2018-11-01  9:31 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: maxice8 @ 2018-11-01  9:27 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

Fixes compilation on musl libc which doesn't show up the internal
implementation.

Error message:

  CC       ell/main.lo
In file included from ell/main.c:35:
ell/signal.h:39:40: error: unknown type name '__sigset_t'
 struct l_signal *l_signal_create(const __sigset_t *mask,
                                        ^~~~~~~~~~
---
 ell/signal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ell/signal.h b/ell/signal.h
index 0d4fdc8..98cf0fa 100644
--- a/ell/signal.h
+++ b/ell/signal.h
@@ -36,7 +36,7 @@ typedef void (*l_signal_notify_cb_t) (struct l_signal *signal,
 					uint32_t signo, void *user_data);
 typedef void (*l_signal_destroy_cb_t) (void *user_data);
 
-struct l_signal *l_signal_create(const __sigset_t *mask,
+struct l_signal *l_signal_create(const sigset_t *mask,
 			l_signal_notify_cb_t callback,
 			void *user_data, l_signal_destroy_cb_t destroy);
 void l_signal_remove(struct l_signal *signal);
-- 
2.19.1


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

* Re: [PATCH] ell/signal.h: use sigset_t instead of internal libc implementation
  2018-11-01  9:27 [PATCH] ell/signal.h: use sigset_t instead of internal libc implementation maxice8
@ 2018-11-01  9:31 ` Marcel Holtmann
  2018-11-01 17:00   ` Othman, Ossama
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2018-11-01  9:31 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

Hi Maxwell,

> On Nov 1, 2018, at 10:27, maxice8 <thinkabit.ukim@gmail.com> wrote:

Please use full name in author information.

> Fixes compilation on musl libc which doesn't show up the internal
> implementation.
> 
> Error message:
> 
>  CC       ell/main.lo
> In file included from ell/main.c:35:
> ell/signal.h:39:40: error: unknown type name '__sigset_t'
> struct l_signal *l_signal_create(const __sigset_t *mask,
>                                        ^~~~~~~~~~

I tried to make this work with -std=c99 and I am kinda lost on what the right approach here is. Define _USE_POSIX or what is the recommendation?

Regards

Marcel


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

* Re: [PATCH] ell/signal.h: use sigset_t instead of internal libc implementation
  2018-11-01  9:31 ` Marcel Holtmann
@ 2018-11-01 17:00   ` Othman, Ossama
  0 siblings, 0 replies; 3+ messages in thread
From: Othman, Ossama @ 2018-11-01 17:00 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

Hi Marcel,

Sorry about the duplicate e-mail.  I neglected to reply to all earlier.

On Thu, Nov 1, 2018 at 2:31 AM Marcel Holtmann <marcel@holtmann.org> wrote:
> > On Nov 1, 2018, at 10:27, maxice8 <thinkabit.ukim@gmail.com> wrote:
> > Error message:
> >
> >  CC       ell/main.lo
> > In file included from ell/main.c:35:
> > ell/signal.h:39:40: error: unknown type name '__sigset_t'
> > struct l_signal *l_signal_create(const __sigset_t *mask,
> >                                        ^~~~~~~~~~
>
> I tried to make this work with -std=c99 and I am kinda lost on what the right approach here is. Define _USE_POSIX or what is the recommendation?

Ideally ELL's public API should not depend on the definition of a
feature test macro, but if one is going to be defined I'd avoid
__USE_POSIX since it's a glibc implementation detail.  I'd go with
_DEFAULT_SOURCE, which I think is specific to glibc, or one of the
standard _POSIX_SOURCE, _POSIX_C_SOURCE (>= 1), or _XOPEN_SOURCE.
Relevant feature test macro documentation:

http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html

BTW, this problem isn't specific to -std=c99 builds.  It occurs with
-std=c11 and -ansi, too.

HTH,
-Ossama

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

end of thread, other threads:[~2018-11-01 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-01  9:27 [PATCH] ell/signal.h: use sigset_t instead of internal libc implementation maxice8
2018-11-01  9:31 ` Marcel Holtmann
2018-11-01 17:00   ` Othman, Ossama

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.