All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] workqueue: add missing pthreads header
@ 2018-03-16  5:21 Baruch Siach
  2018-03-16  5:21 ` [PATCH 2/2] xfs_scrub: add missing paths header Baruch Siach
  2018-03-16  5:30 ` [PATCH 1/2] workqueue: add missing pthreads header Darrick J. Wong
  0 siblings, 2 replies; 8+ messages in thread
From: Baruch Siach @ 2018-03-16  5:21 UTC (permalink / raw)
  To: linux-xfs; +Cc: Baruch Siach

Fix the following build failure with musl libc:

In file included from read_verify.c:25:0:
../include/workqueue.h:39:2: error: unknown type name 'pthread_t'
  pthread_t  *threads;
  ^~~~~~~~~
../include/workqueue.h:42:2: error: unknown type name 'pthread_mutex_t'
  pthread_mutex_t  lock;
  ^~~~~~~~~~~~~~~
../include/workqueue.h:43:2: error: unknown type name 'pthread_cond_t'
  pthread_cond_t  wakeup;
  ^~~~~~~~~~~~~~

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 include/workqueue.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/workqueue.h b/include/workqueue.h
index b4b3541701df..edb2f8ac5991 100644
--- a/include/workqueue.h
+++ b/include/workqueue.h
@@ -22,6 +22,8 @@
 #ifndef	_WORKQUEUE_H_
 #define	_WORKQUEUE_H_
 
+#include <pthread.h>
+
 struct workqueue;
 
 typedef void workqueue_func_t(struct workqueue *wq, uint32_t index, void *arg);
-- 
2.16.2


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

* [PATCH 2/2] xfs_scrub: add missing paths header
  2018-03-16  5:21 [PATCH 1/2] workqueue: add missing pthreads header Baruch Siach
@ 2018-03-16  5:21 ` Baruch Siach
  2018-03-16  5:25   ` Darrick J. Wong
  2018-03-16  5:30 ` [PATCH 1/2] workqueue: add missing pthreads header Darrick J. Wong
  1 sibling, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2018-03-16  5:21 UTC (permalink / raw)
  To: linux-xfs; +Cc: Baruch Siach

Fix the following build failure with musl libc:

xfs_scrub.c: In function ‘main’:
xfs_scrub.c:670:11: error: ‘_PATH_MOUNTED’ undeclared (first use in this function)
    mtab = _PATH_MOUNTED;
           ^~~~~~~~~~~~~

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 scrub/xfs_scrub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index ab26e6335948..eedbe34ec7b3 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -21,6 +21,7 @@
 #include <pthread.h>
 #include <stdbool.h>
 #include <stdlib.h>
+#include <paths.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/statvfs.h>
-- 
2.16.2


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

* Re: [PATCH 2/2] xfs_scrub: add missing paths header
  2018-03-16  5:21 ` [PATCH 2/2] xfs_scrub: add missing paths header Baruch Siach
@ 2018-03-16  5:25   ` Darrick J. Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Darrick J. Wong @ 2018-03-16  5:25 UTC (permalink / raw)
  To: Baruch Siach; +Cc: linux-xfs

On Fri, Mar 16, 2018 at 07:21:36AM +0200, Baruch Siach wrote:
> Fix the following build failure with musl libc:
> 
> xfs_scrub.c: In function ‘main’:
> xfs_scrub.c:670:11: error: ‘_PATH_MOUNTED’ undeclared (first use in this function)
>     mtab = _PATH_MOUNTED;
>            ^~~~~~~~~~~~~
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  scrub/xfs_scrub.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
> index ab26e6335948..eedbe34ec7b3 100644
> --- a/scrub/xfs_scrub.c
> +++ b/scrub/xfs_scrub.c
> @@ -21,6 +21,7 @@
>  #include <pthread.h>
>  #include <stdbool.h>
>  #include <stdlib.h>
> +#include <paths.h>
>  #include <sys/time.h>
>  #include <sys/resource.h>
>  #include <sys/statvfs.h>
> -- 
> 2.16.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/2] workqueue: add missing pthreads header
  2018-03-16  5:21 [PATCH 1/2] workqueue: add missing pthreads header Baruch Siach
  2018-03-16  5:21 ` [PATCH 2/2] xfs_scrub: add missing paths header Baruch Siach
@ 2018-03-16  5:30 ` Darrick J. Wong
  2018-03-16  6:08   ` Baruch Siach
  1 sibling, 1 reply; 8+ messages in thread
From: Darrick J. Wong @ 2018-03-16  5:30 UTC (permalink / raw)
  To: Baruch Siach; +Cc: linux-xfs

On Fri, Mar 16, 2018 at 07:21:35AM +0200, Baruch Siach wrote:
> Fix the following build failure with musl libc:
> 
> In file included from read_verify.c:25:0:
> ../include/workqueue.h:39:2: error: unknown type name 'pthread_t'
>   pthread_t  *threads;
>   ^~~~~~~~~
> ../include/workqueue.h:42:2: error: unknown type name 'pthread_mutex_t'
>   pthread_mutex_t  lock;
>   ^~~~~~~~~~~~~~~
> ../include/workqueue.h:43:2: error: unknown type name 'pthread_cond_t'
>   pthread_cond_t  wakeup;
>   ^~~~~~~~~~~~~~
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  include/workqueue.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/workqueue.h b/include/workqueue.h
> index b4b3541701df..edb2f8ac5991 100644
> --- a/include/workqueue.h
> +++ b/include/workqueue.h
> @@ -22,6 +22,8 @@
>  #ifndef	_WORKQUEUE_H_
>  #define	_WORKQUEUE_H_
>  
> +#include <pthread.h>

Ooops, sorry about that.

Our convention within xfsprogs sources (I think) is for most header
files to avoid having headers include other headers.  Would you mind
adding this include to read_verify.c instead?

(That said, you probably ought to wait for the maintainer (Eric) to
weigh in on this before you do any more work.)

--D

> +
>  struct workqueue;
>  
>  typedef void workqueue_func_t(struct workqueue *wq, uint32_t index, void *arg);
> -- 
> 2.16.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/2] workqueue: add missing pthreads header
  2018-03-16  5:30 ` [PATCH 1/2] workqueue: add missing pthreads header Darrick J. Wong
@ 2018-03-16  6:08   ` Baruch Siach
  2018-03-22 22:05     ` Eric Sandeen
  0 siblings, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2018-03-16  6:08 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

Hi Darrick,

On Thu, Mar 15, 2018 at 10:30:16PM -0700, Darrick J. Wong wrote:
> On Fri, Mar 16, 2018 at 07:21:35AM +0200, Baruch Siach wrote:
> > Fix the following build failure with musl libc:
> > 
> > In file included from read_verify.c:25:0:
> > ../include/workqueue.h:39:2: error: unknown type name 'pthread_t'
> >   pthread_t  *threads;
> >   ^~~~~~~~~
> > ../include/workqueue.h:42:2: error: unknown type name 'pthread_mutex_t'
> >   pthread_mutex_t  lock;
> >   ^~~~~~~~~~~~~~~
> > ../include/workqueue.h:43:2: error: unknown type name 'pthread_cond_t'
> >   pthread_cond_t  wakeup;
> >   ^~~~~~~~~~~~~~
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  include/workqueue.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/workqueue.h b/include/workqueue.h
> > index b4b3541701df..edb2f8ac5991 100644
> > --- a/include/workqueue.h
> > +++ b/include/workqueue.h
> > @@ -22,6 +22,8 @@
> >  #ifndef	_WORKQUEUE_H_
> >  #define	_WORKQUEUE_H_
> >  
> > +#include <pthread.h>
> 
> Ooops, sorry about that.
> 
> Our convention within xfsprogs sources (I think) is for most header
> files to avoid having headers include other headers.  Would you mind
> adding this include to read_verify.c instead?

I don't mind. But requiring every user of workqueue.h to remember to have 
pthread.h before, is error prone IMO.

> (That said, you probably ought to wait for the maintainer (Eric) to
> weigh in on this before you do any more work.)

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* Re: [PATCH 1/2] workqueue: add missing pthreads header
  2018-03-16  6:08   ` Baruch Siach
@ 2018-03-22 22:05     ` Eric Sandeen
  2018-03-22 22:58       ` Eric Sandeen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Sandeen @ 2018-03-22 22:05 UTC (permalink / raw)
  To: Baruch Siach, Darrick J. Wong; +Cc: linux-xfs

On 3/16/18 1:08 AM, Baruch Siach wrote:
> Hi Darrick,
> 
> On Thu, Mar 15, 2018 at 10:30:16PM -0700, Darrick J. Wong wrote:
>> On Fri, Mar 16, 2018 at 07:21:35AM +0200, Baruch Siach wrote:
>>> Fix the following build failure with musl libc:
>>>
>>> In file included from read_verify.c:25:0:
>>> ../include/workqueue.h:39:2: error: unknown type name 'pthread_t'
>>>   pthread_t  *threads;
>>>   ^~~~~~~~~
>>> ../include/workqueue.h:42:2: error: unknown type name 'pthread_mutex_t'
>>>   pthread_mutex_t  lock;
>>>   ^~~~~~~~~~~~~~~
>>> ../include/workqueue.h:43:2: error: unknown type name 'pthread_cond_t'
>>>   pthread_cond_t  wakeup;
>>>   ^~~~~~~~~~~~~~
>>>
>>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>>> ---
>>>  include/workqueue.h | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/include/workqueue.h b/include/workqueue.h
>>> index b4b3541701df..edb2f8ac5991 100644
>>> --- a/include/workqueue.h
>>> +++ b/include/workqueue.h
>>> @@ -22,6 +22,8 @@
>>>  #ifndef	_WORKQUEUE_H_
>>>  #define	_WORKQUEUE_H_
>>>  
>>> +#include <pthread.h>
>>
>> Ooops, sorry about that.
>>
>> Our convention within xfsprogs sources (I think) is for most header
>> files to avoid having headers include other headers.  Would you mind
>> adding this include to read_verify.c instead?
> 
> I don't mind. But requiring every user of workqueue.h to remember to have 
> pthread.h before, is error prone IMO.
> 
>> (That said, you probably ought to wait for the maintainer (Eric) to
>> weigh in on this before you do any more work.)

Sorry for the late reply.

Eh, I think I'm inclined to just take this as-is, I don't see a downside to it.

Thanks,
-Eric

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

* Re: [PATCH 1/2] workqueue: add missing pthreads header
  2018-03-22 22:05     ` Eric Sandeen
@ 2018-03-22 22:58       ` Eric Sandeen
  2018-03-22 23:04         ` Darrick J. Wong
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Sandeen @ 2018-03-22 22:58 UTC (permalink / raw)
  To: Baruch Siach, Darrick J. Wong; +Cc: linux-xfs

On 3/22/18 5:05 PM, Eric Sandeen wrote:
> On 3/16/18 1:08 AM, Baruch Siach wrote:

...

>>> Our convention within xfsprogs sources (I think) is for most header
>>> files to avoid having headers include other headers.  Would you mind
>>> adding this include to read_verify.c instead?
>>
>> I don't mind. But requiring every user of workqueue.h to remember to have 
>> pthread.h before, is error prone IMO.
>>
>>> (That said, you probably ought to wait for the maintainer (Eric) to
>>> weigh in on this before you do any more work.)
> 
> Sorry for the late reply.
> 
> Eh, I think I'm inclined to just take this as-is, I don't see a downside to it.

Actually now I'm on the fence, half of scrub already includes pthread.h directly :/

How many C files would need to include pthread.h to get the build going?

And, um, how can we get ourselves out of this "break musl, rinse, repeat" cycle?

-Eric

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

* Re: [PATCH 1/2] workqueue: add missing pthreads header
  2018-03-22 22:58       ` Eric Sandeen
@ 2018-03-22 23:04         ` Darrick J. Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Darrick J. Wong @ 2018-03-22 23:04 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Baruch Siach, linux-xfs

On Thu, Mar 22, 2018 at 05:58:29PM -0500, Eric Sandeen wrote:
> On 3/22/18 5:05 PM, Eric Sandeen wrote:
> > On 3/16/18 1:08 AM, Baruch Siach wrote:
> 
> ...
> 
> >>> Our convention within xfsprogs sources (I think) is for most header
> >>> files to avoid having headers include other headers.  Would you mind
> >>> adding this include to read_verify.c instead?
> >>
> >> I don't mind. But requiring every user of workqueue.h to remember to have 
> >> pthread.h before, is error prone IMO.
> >>
> >>> (That said, you probably ought to wait for the maintainer (Eric) to
> >>> weigh in on this before you do any more work.)
> > 
> > Sorry for the late reply.
> > 
> > Eh, I think I'm inclined to just take this as-is, I don't see a downside to it.
> 
> Actually now I'm on the fence, half of scrub already includes pthread.h directly :/
> 
> How many C files would need to include pthread.h to get the build going?

AFAICT vfs.c read_verify.c phase[65432].c fscounters.c need to include
it directly?  Though some might get away with it because they include
one of the other header files that ... eh why don't we just apply this
patch and move on?  Nuts to this convention. :)

--D

> And, um, how can we get ourselves out of this "break musl, rinse, repeat" cycle?
> 
> -Eric
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-03-22 23:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16  5:21 [PATCH 1/2] workqueue: add missing pthreads header Baruch Siach
2018-03-16  5:21 ` [PATCH 2/2] xfs_scrub: add missing paths header Baruch Siach
2018-03-16  5:25   ` Darrick J. Wong
2018-03-16  5:30 ` [PATCH 1/2] workqueue: add missing pthreads header Darrick J. Wong
2018-03-16  6:08   ` Baruch Siach
2018-03-22 22:05     ` Eric Sandeen
2018-03-22 22:58       ` Eric Sandeen
2018-03-22 23:04         ` Darrick J. Wong

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.