All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Adrian Bunk <bunk@kernel.org>,
	linux-kernel@vger.kernel.org,
	Davide Libenzi <davidel@xmailserver.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace
Date: Tue, 16 Sep 2008 17:43:45 +0300	[thread overview]
Message-ID: <20080916144344.GE17082@localhost.localdomain> (raw)
In-Reply-To: <48CFBE51.1060200@redhat.com>

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

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

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 += 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 <linux/fcntl.h>
 #include <linux/types.h>
+#include <linux/dcache.h>
+#include <linux/fs.h>
 
 /*
  * 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 <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_watch *watch)
 
 #endif	/* CONFIG_INOTIFY */
 
-#endif	/* __KERNEL __ */
-
 #endif	/* _LINUX_INOTIFY_H */

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-09-16 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 12:22 [PATCH] linux/inotify.h: do not include <linux/fcntl.h> in userspace Kirill A. Shutemov
2008-09-16 12:58 ` Adrian Bunk
2008-09-16 13:02   ` Kirill A. Shutemov
2008-09-16 13:31     ` Adrian Bunk
2008-09-16 14:10     ` Ulrich Drepper
2008-09-16 14:43       ` Kirill A. Shutemov [this message]
2008-09-16 16:09       ` Adrian Bunk
2008-09-17  9:32         ` Kirill A. Shutemov
2008-09-17 10:04           ` Kirill A. Shutemov
2008-09-17 10:12             ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080916144344.GE17082@localhost.localdomain \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@kernel.org \
    --cc=davidel@xmailserver.org \
    --cc=drepper@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.