<linux/fcntl.h> conflicts with glibc's <fcntl.h>. It breaks building kdelibs, kdepim and pinot. It's regression itroduced by commit 4006553. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Cc: Ulrich Drepper <drepper@redhat.com> Cc: Davide Libenzi <davidel@xmailserver.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> --- 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 <linux/fcntl.h> +#endif #include <linux/types.h> /* -- 1.5.6.5.GIT --
We should rather fix the actual bug.
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
--
/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 --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/
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 <fcntl.h>
#include <sys/syscall.h>
#include <linux/types.h>
// Linux kernel headers are documented to not compile
#define _S390_BITOPS_H
#include <linux/inotify.h>
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 <sys/inotify.h>
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
--
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 And? None of these programs should use <linux/inotify.h>. There has for the longest time been a <sys/inotify.h> header which doesn't need any kernel headers. In fact, <linux/inotify.h> 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----- --
Ok. Let's unexport <linux/inotify.h>.
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 +=3D igmp.h
unifdef-y +=3D inet_diag.h
unifdef-y +=3D in.h
unifdef-y +=3D in6.h
-unifdef-y +=3D inotify.h
unifdef-y +=3D input.h
unifdef-y +=3D ip.h
unifdef-y +=3D 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 <linux/fcntl.h>
#include <linux/types.h>
+#include <linux/dcache.h>
+#include <linux/fs.h>
=20
/*
* 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
=20
-#ifdef __KERNEL__
-
-#include <linux/dcache.h>
-#include <linux/fs.h>
-
/*
* struct inotify_watch - represents a watch request on a specific inode
*
@@ -230,6 +227,4 @@ static inline void put_inotify_watch(struct inotify_wat=
ch *watch)
=20
#endif /* CONFIG_INOTIFY */
=20
-#endif /* __KERNEL __ */
-
#endif /* _LINUX_INOTIFY_H */
--=20
Regards, Kirill A. Shutemov
+ Belarus, Minsk
+ ALT Linux Team, http://www.altlinux.com/
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
--
glibc and dietlibc provide <sys/inotify.h>. newlib and uclibc don't. klibc provides <sys/inotify.h> but it depends on <linux/inotify.h> --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/
Oh.. Sorry. uclibc provides <sys/inotify.h>. So unexporting <linux/inotify.h> breaks only klibc. --=20 Regards, Kirill A. Shutemov + Belarus, Minsk + ALT Linux Team, http://www.altlinux.com/
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 <linux/inotify.h>, but ideally in the long term all
libc implementations should use <linux/inotify.h>.
Whether, and if yes when, libc implementations starts using
<linux/inotify.h> 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
--
