[PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace - Kernel

This is a discussion on [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace - Kernel ; conflicts with glibc's . It breaks building kdelibs, kdepim and pinot. It's regression itroduced by commit 4006553. Signed-off-by: Kirill A. Shutemov Cc: Ulrich Drepper Cc: Davide Libenzi Cc: David Woodhouse Cc: Andrew Morton --- include/linux/inotify.h | 2 ++ 1 files ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

  1. [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    conflicts with glibc's .

    It breaks building kdelibs, kdepim and pinot. It's regression itroduced
    by commit 4006553.

    Signed-off-by: Kirill A. Shutemov
    Cc: Ulrich Drepper
    Cc: Davide Libenzi
    Cc: David Woodhouse
    Cc: Andrew Morton
    ---
    include/linux/inotify.h | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/include/linux/inotify.h b/include/linux/inotify.h
    index bd57857..792b6f0 100644
    --- a/include/linux/inotify.h
    +++ b/include/linux/inotify.h
    @@ -7,8 +7,10 @@
    #ifndef _LINUX_INOTIFY_H
    #define _LINUX_INOTIFY_H

    +#ifdef __KERNEL__
    /* For O_CLOEXEC and O_NONBLOCK */
    #include
    +#endif
    #include

    /*
    --
    1.5.6.5.GIT

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 03:22:43PM +0300, Kirill A. Shutemov wrote:
    > conflicts with glibc's .
    >
    > It breaks building kdelibs, kdepim and pinot.


    We should rather fix the actual bug.

    What is the error message?

    >...
    > --- a/include/linux/inotify.h
    > +++ b/include/linux/inotify.h
    > @@ -7,8 +7,10 @@
    > #ifndef _LINUX_INOTIFY_H
    > #define _LINUX_INOTIFY_H
    >
    > +#ifdef __KERNEL__
    > /* For O_CLOEXEC and O_NONBLOCK */
    > #include
    > +#endif
    >...


    This breaks the header for users of IN_CLOEXEC/IN_NONBLOCK.

    cu
    Adrian

    --

    "Is there not promise of rain?" Ling Tan asked suddenly out
    of the darkness. There had been need of rain for many days.
    "Only a promise," Lao Er said.
    Pearl S. Buck - Dragon Seed

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 03:58:02PM +0300, Adrian Bunk wrote:
    > On Tue, Sep 16, 2008 at 03:22:43PM +0300, Kirill A. Shutemov wrote:
    > > conflicts with glibc's .
    > >
    > > It breaks building kdelibs, kdepim and pinot.

    >
    > We should rather fix the actual bug.
    >
    > What is the error message?


    /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    flock'
    /usr/include/bits/fcntl.h:142: error: previous definition of 'struct
    flock'
    /usr/include/asm-generic/fcntl.h:140: error: redefinition of 'struct
    flock64'
    /usr/include/bits/fcntl.h:157: error: previous definition of 'struct
    flock64'

    >
    > >...
    > > --- a/include/linux/inotify.h
    > > +++ b/include/linux/inotify.h
    > > @@ -7,8 +7,10 @@
    > > #ifndef _LINUX_INOTIFY_H
    > > #define _LINUX_INOTIFY_H
    > >
    > > +#ifdef __KERNEL__
    > > /* For O_CLOEXEC and O_NONBLOCK */
    > > #include
    > > +#endif
    > >...

    >
    > This breaks the header for users of IN_CLOEXEC/IN_NONBLOCK.
    >
    > cu
    > Adrian
    >
    > --
    >
    > "Is there not promise of rain?" Ling Tan asked suddenly out
    > of the darkness. There had been need of rain for many days.
    > "Only a promise," Lao Er said.
    > Pearl S. Buck - Dragon Seed
    >


    --
    Regards, Kirill A. Shutemov
    + Belarus, Minsk
    + ALT Linux Team, http://www.altlinux.com/

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkjPrmoACgkQbWYnhzC5v6o5SwCfZUjiM2Zs+Z P33Dz8c2UYES4y
    Q2sAn12wEHdrCtli41HbTyeAoEbQ9DZ5
    =TTOZ
    -----END PGP SIGNATURE-----


  4. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 04:02:36PM +0300, Kirill A. Shutemov wrote:
    > On Tue, Sep 16, 2008 at 03:58:02PM +0300, Adrian Bunk wrote:
    > > On Tue, Sep 16, 2008 at 03:22:43PM +0300, Kirill A. Shutemov wrote:
    > > > conflicts with glibc's .
    > > >
    > > > It breaks building kdelibs, kdepim and pinot.

    > >
    > > We should rather fix the actual bug.
    > >
    > > What is the error message?

    >
    > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > flock'
    > /usr/include/bits/fcntl.h:142: error: previous definition of 'struct
    > flock'
    > /usr/include/asm-generic/fcntl.h:140: error: redefinition of 'struct
    > flock64'
    > /usr/include/bits/fcntl.h:157: error: previous definition of 'struct
    > flock64'
    >...


    Kernel headers and glibc headers are an own story, Ulrich might know
    best about that.


    But I'm wondering, why is kdelibs doing

    <-- snip -->

    ....
    #include
    #include
    #include
    // Linux kernel headers are documented to not compile
    #define _S390_BITOPS_H
    #include

    static inline int inotify_init (void)
    {
    return syscall (__NR_inotify_init);
    }
    ....

    <-- snip -->


    pinot even contains a file with the inotify syscall numbers for all
    architectures.


    inotify_init(2) already documents the following usage:

    <-- snip -->

    ....
    #include

    int inotify_init(void);
    ....

    <-- snip -->


    Unless someone knows a good reason against that (and no matter how the
    kernel situation will change) I'll send patches to get KDE fixed in this
    respect.


    cu
    Adrian

    --

    "Is there not promise of rain?" Ling Tan asked suddenly out
    of the darkness. There had been need of rain for many days.
    "Only a promise," Lao Er said.
    Pearl S. Buck - Dragon Seed

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Kirill A. Shutemov wrote:
    >> What is the error message?

    >
    > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > flock'


    And? None of these programs should use . There has
    for the longest time been a header which doesn't need
    any kernel headers. In fact, should not be exported.

    - --
    ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkjPvlEACgkQ2ijCOnn/RHTO0ACfR2NrTZ97pK34xZKM5pzlRbL6
    Nb4AoJ27y9MU+Udr50GZVfZZXjg3ENWg
    =7Pol
    -----END PGP SIGNATURE-----
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 07:10:25AM -0700, Ulrich Drepper wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Kirill A. Shutemov wrote:
    > >> What is the error message?

    > >
    > > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > > flock'

    >
    > And? None of these programs should use . There has
    > for the longest time been a header which doesn't need
    > any kernel headers. In fact, should not be exported.


    Ok. Let's unexport .

    diff --git a/include/linux/Kbuild b/include/linux/Kbuild
    index b68ec09..dbb8107 100644
    --- a/include/linux/Kbuild
    +++ b/include/linux/Kbuild
    @@ -240,7 +240,6 @@ unifdef-y += igmp.h
    unifdef-y += inet_diag.h
    unifdef-y += in.h
    unifdef-y += in6.h
    -unifdef-y += inotify.h
    unifdef-y += input.h
    unifdef-y += ip.h
    unifdef-y += ipc.h
    diff --git a/include/linux/inotify.h b/include/linux/inotify.h
    index bd57857..0188b6a 100644
    --- a/include/linux/inotify.h
    +++ b/include/linux/inotify.h
    @@ -10,6 +10,8 @@
    /* For O_CLOEXEC and O_NONBLOCK */
    #include
    #include
    +#include
    +#include

    /*
    * struct inotify_event - structure read from the inotify device for each event
    @@ -69,11 +71,6 @@ struct inotify_event {
    #define IN_CLOEXEC O_CLOEXEC
    #define IN_NONBLOCK O_NONBLOCK

    -#ifdef __KERNEL__
    -
    -#include
    -#include
    -
    /*
    * struct inotify_watch - represents a watch request on a specific inode
    *
    @@ -230,6 +227,4 @@ static inline void put_inotify_watch(struct inotify_watch *watch)

    #endif /* CONFIG_INOTIFY */

    -#endif /* __KERNEL __ */
    -
    #endif /* _LINUX_INOTIFY_H */

    --
    Regards, Kirill A. Shutemov
    + Belarus, Minsk
    + ALT Linux Team, http://www.altlinux.com/

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkjPxiAACgkQbWYnhzC5v6r9ugCePHgekSA09P 6xXQafeKfiNFSz
    CBsAn33khQS6veaAKKTZGiR7IxxTqC7I
    =a/es
    -----END PGP SIGNATURE-----


  7. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 07:10:25AM -0700, Ulrich Drepper wrote:
    > Kirill A. Shutemov wrote:
    > >> What is the error message?

    > >
    > > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > > flock'

    >
    > And? None of these programs should use . There has
    > for the longest time been a header which doesn't need
    > any kernel headers. In fact, should not be exported.


    Even if userspace applications shouldn't use it directly this doesn't
    sound right:

    We shouldn't force all libc implementations to copy the contents into a
    private header.

    cu
    Adrian

    --

    "Is there not promise of rain?" Ling Tan asked suddenly out
    of the darkness. There had been need of rain for many days.
    "Only a promise," Lao Er said.
    Pearl S. Buck - Dragon Seed

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Tue, Sep 16, 2008 at 07:09:02PM +0300, Adrian Bunk wrote:
    > On Tue, Sep 16, 2008 at 07:10:25AM -0700, Ulrich Drepper wrote:
    > > Kirill A. Shutemov wrote:
    > > >> What is the error message?
    > > >
    > > > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > > > flock'

    > >
    > > And? None of these programs should use . There has
    > > for the longest time been a header which doesn't need
    > > any kernel headers. In fact, should not be exported.

    >
    > Even if userspace applications shouldn't use it directly this doesn't
    > sound right:
    >
    > We shouldn't force all libc implementations to copy the contents into a
    > private header.


    glibc and dietlibc provide . newlib and uclibc don't. klibc
    provides but it depends on

    --
    Regards, Kirill A. Shutemov
    + Belarus, Minsk
    + ALT Linux Team, http://www.altlinux.com/

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkjQzrgACgkQbWYnhzC5v6rexgCeOX71hr0PMB VcyHR6q5Ull6/F
    BM8An3hqbUS7BymlyCO+MHaIzKIrL3xf
    =4dw1
    -----END PGP SIGNATURE-----


  9. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Wed, Sep 17, 2008 at 12:32:40PM +0300, Kirill A. Shutemov wrote:
    > On Tue, Sep 16, 2008 at 07:09:02PM +0300, Adrian Bunk wrote:
    > > On Tue, Sep 16, 2008 at 07:10:25AM -0700, Ulrich Drepper wrote:
    > > > Kirill A. Shutemov wrote:
    > > > >> What is the error message?
    > > > >
    > > > > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > > > > flock'
    > > >
    > > > And? None of these programs should use . There has
    > > > for the longest time been a header which doesn't need
    > > > any kernel headers. In fact, should not be exported.

    > >
    > > Even if userspace applications shouldn't use it directly this doesn't
    > > sound right:
    > >
    > > We shouldn't force all libc implementations to copy the contents into a
    > > private header.

    >
    > glibc and dietlibc provide . newlib and uclibc don't. klibc
    > provides but it depends on


    Oh.. Sorry. uclibc provides .

    So unexporting breaks only klibc.

    --
    Regards, Kirill A. Shutemov
    + Belarus, Minsk
    + ALT Linux Team, http://www.altlinux.com/

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iEYEARECAAYFAkjQ1iYACgkQbWYnhzC5v6pENgCgicRtGvHc8v nsItMnIVqYAXF3
    gO0AoI0F92rknKAdxC6h2c23885Q0wVN
    =nxTm
    -----END PGP SIGNATURE-----


  10. Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace

    On Wed, Sep 17, 2008 at 01:04:23PM +0300, Kirill A. Shutemov wrote:
    > On Wed, Sep 17, 2008 at 12:32:40PM +0300, Kirill A. Shutemov wrote:
    > > On Tue, Sep 16, 2008 at 07:09:02PM +0300, Adrian Bunk wrote:
    > > > On Tue, Sep 16, 2008 at 07:10:25AM -0700, Ulrich Drepper wrote:
    > > > > Kirill A. Shutemov wrote:
    > > > > >> What is the error message?
    > > > > >
    > > > > > /usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct
    > > > > > flock'
    > > > >
    > > > > And? None of these programs should use . There has
    > > > > for the longest time been a header which doesn't need
    > > > > any kernel headers. In fact, should not be exported.
    > > >
    > > > Even if userspace applications shouldn't use it directly this doesn't
    > > > sound right:
    > > >
    > > > We shouldn't force all libc implementations to copy the contents into a
    > > > private header.

    > >
    > > glibc and dietlibc provide . newlib and uclibc don't. klibc
    > > provides but it depends on

    >
    > Oh.. Sorry. uclibc provides .
    >
    > So unexporting breaks only klibc.


    klibc is actually doing the right thing.

    The userspace kernel headers situation used to be a complete mess, and
    it is therefore understandable that some libc implementations are
    currently not using , but ideally in the long term all
    libc implementations should use .

    Whether, and if yes when, libc implementations starts using
    is not our business, but we have to ensure that it
    works for the libc implementations that do use it.

    cu
    Adrian

    --

    "Is there not promise of rain?" Ling Tan asked suddenly out
    of the darkness. There had been need of rain for many days.
    "Only a promise," Lao Er said.
    Pearl S. Buck - Dragon Seed

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread