Re: inotify and /proc/

2007-07-31 Thread Valdis . Kletnieks
On Mon, 30 Jul 2007 22:56:27 CDT, Joseph Pingenot said:
> From Al Viro on Tuesday, 31 July, 2007:
> >On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote:
> >> I'm trying to implement pwait.  It blocks until a specified PID exits,
> >>   and then it exits.
> >er... ptrace(2)?
> 
> Should work for most common usage scenarios, although will suspect that it
>   won't for for processes owned by another user (at least, I hope
>   it wouldn't).
> 
> What is dangerous about inotify on a proc file?

And if it's dangerous, should the inotify system call fail when trying to
set the watch?  Bailout with a -EBADIDEA or something?



pgp33gMwjEtFq.pgp
Description: PGP signature


Re: inotify and /proc/

2007-07-31 Thread Andrew Morton
On Tue, 31 Jul 2007 20:31:49 +0200 Diego Calleja <[EMAIL PROTECTED]> wrote:

> El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot <[EMAIL PROTECTED]> 
> escribió:
> 
> > More background, please?
> > 
> > What's the way to check for a process exiting without spinning?
> 
> 
> I don't know if it's useful for you, but CONFIG_CONNECTOR and 
> CONFIG_PROC_EVENTS
> will report process creation/exit/fork/etc through a netlink interface.

yup.  See example code in Documentation/accounting/getdelays.c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-31 Thread Diego Calleja
El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot <[EMAIL PROTECTED]> 
escribió:

> More background, please?
> 
> What's the way to check for a process exiting without spinning?


I don't know if it's useful for you, but CONFIG_CONNECTOR and CONFIG_PROC_EVENTS
will report process creation/exit/fork/etc through a netlink interface.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-31 Thread Ray Lee
On 7/30/07, Joseph Pingenot <[EMAIL PROTECTED]> wrote:
> What's the way to check for a process exiting without spinning?

I think you can get it from the taskstats interface, though I haven't
tried it. See Documentation/accounting/ for details.

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


Re: inotify and /proc/

2007-07-30 Thread Chris Friesen

Joseph Pingenot wrote:


While we're on the subject, is there some way to receive notification
  that some aspect of a process changes (in this case, stopping using
  CPU, but not exiting).


For some internal stuff a while back I did a patch that allows any 
process to register for status change notifications.  Basically, the 
registered process gets put on a list and gets the same notifications 
(killed/stopped/exited, etc.) as the real parent.


Useful for this type of thing.

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


Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:56:27PM -0500, Joseph Pingenot wrote:
> >From Al Viro on Tuesday, 31 July, 2007:
> >On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote:
> >> I'm trying to implement pwait.  It blocks until a specified PID exits,
> >>   and then it exits.
> >er... ptrace(2)?
> 
> Should work for most common usage scenarios, although will suspect that it
>   won't for for processes owned by another user (at least, I hope
>   it wouldn't).
> 
> What is dangerous about inotify on a proc file?

Playing with the lifetime rules, for starters...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>From Al Viro on Tuesday, 31 July, 2007:
>On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote:
>> I'm trying to implement pwait.  It blocks until a specified PID exits,
>>   and then it exits.
>er... ptrace(2)?

Should work for most common usage scenarios, although will suspect that it
  won't for for processes owned by another user (at least, I hope
  it wouldn't).

What is dangerous about inotify on a proc file?

-- 
[EMAIL PROTECTED]///
"There is also an entire branch in the physical therapy field dedicated
 to the treatment of little-finger injuries caused by excessive Emacs
 use."  --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///260 IATL / The University of Iowa / Iowa City, IA  52242///
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote:
> I'm trying to implement pwait.  It blocks until a specified PID exits,
>   and then it exits.

er... ptrace(2)?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Kyle McMartin
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote:
> From Al Viro on Tuesday, 31 July, 2007:
> >On Mon, Jul 30, 2007 at 10:31:13PM -0500, Joseph Pingenot wrote:
> >> >From Joseph Pingenot on Monday, 30 July, 2007:
> >> >From Al Viro on Tuesday, 31 July, 2007:
> >> >>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
> >> >>> I was trying to use inotify to watch process changes (especially 
> >> >>> process
> >> >>>   termination) by watching /proc/.
> >> >>> Sadly, although I could see something reading various files, nothing
> >> >>>   was issued when the process I was watching exited and the directory
> >> >>>   went away.
> >> >>> Is this intentional, or a bug?
> >> >>It's a bug you intend to introduce in your program...  IOW, don't
> >> >>do that.
> >> >More background, please?
> >> >What's the way to check for a process exiting without spinning?
> >> I should also specify that the process being waited on is not a
> >>   child process-it's just some other process on the system.
> >Umm...  Any details on intended use?  IOW, is that "I want to write
> >an utility that would wait for given PID to exit, just for the hell
> >of it" or is there something you are trying to implement using that?
> 
> I'm trying to implement pwait.  It blocks until a specified PID exits,
>   and then it exits.
>

ptrace with options set to PTRACE_O_TRACEEXIT?

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


Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>From Al Viro on Tuesday, 31 July, 2007:
>On Mon, Jul 30, 2007 at 10:31:13PM -0500, Joseph Pingenot wrote:
>> >From Joseph Pingenot on Monday, 30 July, 2007:
>> >From Al Viro on Tuesday, 31 July, 2007:
>> >>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
>> >>> I was trying to use inotify to watch process changes (especially process
>> >>>   termination) by watching /proc/.
>> >>> Sadly, although I could see something reading various files, nothing
>> >>>   was issued when the process I was watching exited and the directory
>> >>>   went away.
>> >>> Is this intentional, or a bug?
>> >>It's a bug you intend to introduce in your program...  IOW, don't
>> >>do that.
>> >More background, please?
>> >What's the way to check for a process exiting without spinning?
>> I should also specify that the process being waited on is not a
>>   child process-it's just some other process on the system.
>Umm...  Any details on intended use?  IOW, is that "I want to write
>an utility that would wait for given PID to exit, just for the hell
>of it" or is there something you are trying to implement using that?

I'm trying to implement pwait.  It blocks until a specified PID exits,
  and then it exits.

You can use it to do other stuff after a program finishes.

While we're on the subject, is there some way to receive notification
  that some aspect of a process changes (in this case, stopping using
  CPU, but not exiting).

Thanks for the time to help me figure this out.

-Joseph

-- 
[EMAIL PROTECTED]///
"There is also an entire branch in the physical therapy field dedicated
 to the treatment of little-finger injuries caused by excessive Emacs
 use."  --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///260 IATL / The University of Iowa / Iowa City, IA  52242///
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:31:13PM -0500, Joseph Pingenot wrote:
> >From Joseph Pingenot on Monday, 30 July, 2007:
> >From Al Viro on Tuesday, 31 July, 2007:
> >>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
> >>> I was trying to use inotify to watch process changes (especially process
> >>>   termination) by watching /proc/.
> >>> Sadly, although I could see something reading various files, nothing
> >>>   was issued when the process I was watching exited and the directory
> >>>   went away.
> >>> Is this intentional, or a bug?
> >>It's a bug you intend to introduce in your program...  IOW, don't
> >>do that.
> >More background, please?
> >What's the way to check for a process exiting without spinning?
> 
> I should also specify that the process being waited on is not a
>   child process-it's just some other process on the system.

Umm...  Any details on intended use?  IOW, is that "I want to write
an utility that would wait for given PID to exit, just for the hell
of it" or is there something you are trying to implement using that?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:25:21PM -0500, Joseph Pingenot wrote:
> >From Al Viro on Tuesday, 31 July, 2007:
> >On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
> >> I was trying to use inotify to watch process changes (especially process
> >>   termination) by watching /proc/.
> >> Sadly, although I could see something reading various files, nothing
> >>   was issued when the process I was watching exited and the directory
> >>   went away.
> >> Is this intentional, or a bug?
> >It's a bug you intend to introduce in your program...  IOW, don't
> >do that.
> 
> More background, please?
> 
> What's the way to check for a process exiting without spinning?

Depends on what that process is and how it is related to watching
one...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>From Joseph Pingenot on Monday, 30 July, 2007:
>From Al Viro on Tuesday, 31 July, 2007:
>>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
>>> I was trying to use inotify to watch process changes (especially process
>>>   termination) by watching /proc/.
>>> Sadly, although I could see something reading various files, nothing
>>>   was issued when the process I was watching exited and the directory
>>>   went away.
>>> Is this intentional, or a bug?
>>It's a bug you intend to introduce in your program...  IOW, don't
>>do that.
>More background, please?
>What's the way to check for a process exiting without spinning?

I should also specify that the process being waited on is not a
  child process-it's just some other process on the system.

-- 
[EMAIL PROTECTED]///
"There is also an entire branch in the physical therapy field dedicated
 to the treatment of little-finger injuries caused by excessive Emacs
 use."  --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///260 IATL / The University of Iowa / Iowa City, IA  52242///
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>From Al Viro on Tuesday, 31 July, 2007:
>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
>> I was trying to use inotify to watch process changes (especially process
>>   termination) by watching /proc/.
>> Sadly, although I could see something reading various files, nothing
>>   was issued when the process I was watching exited and the directory
>>   went away.
>> Is this intentional, or a bug?
>It's a bug you intend to introduce in your program...  IOW, don't
>do that.

More background, please?

What's the way to check for a process exiting without spinning?

-Joseph

-- 
[EMAIL PROTECTED]///
"There is also an entire branch in the physical therapy field dedicated
 to the treatment of little-finger injuries caused by excessive Emacs
 use."  --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///260 IATL / The University of Iowa / Iowa City, IA  52242///
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
> I was trying to use inotify to watch process changes (especially process
>   termination) by watching /proc/.
> 
> Sadly, although I could see something reading various files, nothing
>   was issued when the process I was watching exited and the directory
>   went away.
> 
> Is this intentional, or a bug?

It's a bug you intend to introduce in your program...  IOW, don't
do that.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


inotify and /proc/

2007-07-30 Thread Joseph Pingenot
I was trying to use inotify to watch process changes (especially process
  termination) by watching /proc/.

Sadly, although I could see something reading various files, nothing
  was issued when the process I was watching exited and the directory
  went away.

Is this intentional, or a bug?

-Joseph
-- 
[EMAIL PROTECTED]///
"There is also an entire branch in the physical therapy field dedicated
 to the treatment of little-finger injuries caused by excessive Emacs
 use."  --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///260 IATL / The University of Iowa / Iowa City, IA  52242///
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc?

2007-06-24 Thread Kyle Moffett

On Jun 22, 2007, at 18:51:10, C. Scott Ananian wrote:
Back to kernel-land: in an IPv6 only world, it might make sense to  
export a /proc file compatible with the format of /etc/resolv.conf,  
with one DNS server address per line.  If glibc uses/used inotify  
on /etc/resolv.conf, then symlinking /etc/resolv.conf to /proc/net/ 
ipv6_dns allows glibc to get kernel DNS autoconfiguration updates  
without a special case.  [Assuming that glibc was smart enough to  
watch the referenced file and not the symlink...]


A draft patch to implement /proc/net/ipv6_dns is attached, just to  
make the discussion concrete. [Not guaranteed to apply cleanly, as  
I'm not sure that gmail won't munge the whitespace.  But it should  
be readable at least.]


E, I suspect you're likely to get a lot of NAKs from people on  
this one.


1)  Why must the kernel grok the DNS portions of the packets?  Can't  
you just have a little userspace daemon which listens for the  
appropriate ICMPv6 messages and updates /etc/resolv.conf  
accordingly?  That way you could even have userspace policy about  
which DNS information is acceptable for the given system.


2)  New files in /proc which aren't directly related to processes are  
strictly forbidden.  Hopefully eventually (IE: in several years when  
appropriate replacements are widely used) the /proc/meminfo, /proc/ 
cpuinfo, /proc/mdstat, and other similar non-process-related files  
can be made to go away, but we certainly aren't adding new ones.


3)  It's really ugly to generate random text data from kernelspace,  
because then people write 42 different userspace parsers for the text  
data and each one has subtle incompatibilities which make it  
impossible to extend the file in the future.  This is why (2) is true.


4)  Within 30 sec of such a patch going in, the virtualization people  
are going to start griping at you for not properly implementing a  
virtual namespace-ized IPv6 DNS autoconfiguration proc-file.  Since  
that really can't be done easily without putting lots of policy in  
the kernel it's probably easier to just follow the advice in (1) and  
do it in userspace.


Cheers,
Kyle Moffett

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


Re: inotify and /proc?

2007-06-22 Thread Al Viro
On Fri, Jun 22, 2007 at 06:51:10PM -0400, C. Scott Ananian wrote:
 
> No, clearly inotify on all files in /proc is not the right thing to
> do.  But I'm writing support for "RDNSS in RA" -- IPv6 Router
> Advertisement messages can include a DNS server specification, which
> makes IPv6 completely autoconfiguring.

Why the hell do you need idiotify on it?  Just make poll(2) work and
be done with that; see e.g. how /proc//mounts does it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: inotify and /proc?

2007-06-22 Thread C. Scott Ananian

On 6/21/07, Arnd Bergmann <[EMAIL PROTECTED]> wrote:

On Thursday 21 June 2007, C. Scott Ananian wrote:
> I'd like to make a read-only /proc file which supports inotify -- that
> is, the kernel can send change notifications to userland via the
> inotify mechanism. I've found fsnotify_modify() (in
> include/linux/fsnotify.h) which seems to do what I want, but it takes
> a struct dentry * -- how can I get a dentry from a struct
> proc_dir_entry and increment its ref count to keep it around? Any
> help would be appreciated. Thanks!
It sounds a little fishy to want that in the first place. If we wanted
inotify on /proc, it should work on all files I guess, but that's
an immense amount of work.


No, clearly inotify on all files in /proc is not the right thing to
do.  But I'm writing support for "RDNSS in RA" -- IPv6 Router
Advertisement messages can include a DNS server specification, which
makes IPv6 completely autoconfiguring.

Side note for a second: glibc's resolver is really brain dead!  Only
reading /etc/resolv.conf once at startup is clearly the Wrong Thing
for any sort of mobile application, where applications can easily
persist across suspend/resume into multiple networks.  Glibc should
use inotify on /etc/resolv.conf and re-read the DNS configuration when
network-manager (say) updates it.

Back to kernel-land: in an IPv6 only world, it might make sense to
export a /proc file compatible with the format of /etc/resolv.conf,
with one DNS server address per line.  If glibc uses/used inotify on
/etc/resolv.conf, then symlinking /etc/resolv.conf to
/proc/net/ipv6_dns allows glibc to get kernel DNS autoconfiguration
updates without a special case.  [Assuming that glibc was smart enough
to watch the referenced file and not the symlink...]

A draft patch to implement /proc/net/ipv6_dns is attached, just to
make the discussion concrete. [Not guaranteed to apply cleanly, as I'm
not sure that gmail won't munge the whitespace.  But it should be
readable at least.]
--scott

--
( http://cscott.net/ )
-
diff -ruHpN -X dontdiff linux-2.6.22-rc5-orig/include/net/ip6_fib.h
linux-2.6.22-rc5/include/net/ip6_fib.h
--- linux-2.6.22-rc5-orig/include/net/ip6_fib.h 2007-06-16
22:09:12.0 -0400
+++ linux-2.6.22-rc5/include/net/ip6_fib.h  2007-06-20 14:17:58.0 
-0400
@@ -79,6 +79,7 @@ struct rt6key
};

struct fib6_table;
+struct rdns6_info;

struct rt6_info
{
@@ -105,6 +106,8 @@ struct rt6_info
struct rt6key   rt6i_src;

u8  rt6i_protocol;
+
+struct rdns6_info   *rt6i_rdnss;
};

static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
diff -ruHpN -X dontdiff linux-2.6.22-rc5-orig/include/net/ip6_rdnss.h
linux-2.6.22-rc5/include/net/ip6_rdnss.h
--- linux-2.6.22-rc5-orig/include/net/ip6_rdnss.h   1969-12-31
19:00:00.0 -0500
+++ linux-2.6.22-rc5/include/net/ip6_rdnss.h2007-06-21 18:16:33.0 
-0400
@@ -0,0 +1,58 @@
+#ifndef _NET_IP6_RDNSS_H
+#define _NET_IP6_RDNSS_H
+
+#ifdef __KERNEL__
+
+#include 
+
+struct nd_opt_rdnss {
+   __u8type;
+   __u8length;
+#if defined(__BIG_ENDIAN_BITFIELD)
+   __u8priority:4,
+   open:1,
+   reserved1:3;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+   __u8reserved1:3,
+   open:1,
+   priority:4;
+#else
+# error not little or big endian
+#endif
+   __u8reserved2;
+   __be32  lifetime;
+   struct in6_addr rdnss[1];   /* 1 or more */
+};
+
+struct rdns6_entry {
+   struct rdns6_entry *next;
+   struct in6_addr rdnss;
+   __u8priority;
+   __u8open;
+   __u32   lifetime;
+   unsigned long   expires;
+};
+
+struct rdns6_info {
+   rwlock_tlock;
+   struct timer_list   expiry_timer;
+   struct rdns6_entry *rdnss_list;
+   struct inet6_dev *  in6_dev; /* back pointer for netlink notify */
+   int expire_all : 1, /* remove entries on ifdown */
+   free_me : 1; /* safely free this struct */
+};
+
+/* Receive and process an RA message with the given RDNSS options. */
+extern voidrdns6_ra_rcv(struct inet6_dev *dev, struct rt6_info *rt,
+struct nd_opt_rdnss **opts, int opt_cnt);
+/* Expire all of the dns server info from a route (as on an ifdown). */
+extern voidrdns6_info_expire_all(struct rt6_info *rt);
+/* Delete the DNS list information from a struct rt6_info. */
+extern voidrdns6_info_del(struct rt6_info *rt);
+
+/* Generate the /proc/net/ipv6_dns file. */
+extern int rdns6_proc_info(char *buffer, char **start,
+

Re: inotify and /proc?

2007-06-21 Thread Arnd Bergmann
On Thursday 21 June 2007, C. Scott Ananian wrote:
> 
> I'd like to make a read-only /proc file which supports inotify -- that
> is, the kernel can send change notifications to userland via the
> inotify mechanism.  I've found fsnotify_modify() (in
> include/linux/fsnotify.h) which seems to do what I want, but it takes
> a struct dentry * -- how can I get a dentry from a struct
> proc_dir_entry and increment its ref count to keep it around?  Any
> help would be appreciated.  Thanks!

It sounds a little fishy to want that in the first place. If we wanted
inotify on /proc, it should work on all files I guess, but that's
an immense amount of work.

What file are you talking about in particular?
Why does it have to be in /proc?
Why not use another notification mechanism -- blocking read(), poll(),
uevent, ...?

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


inotify and /proc?

2007-06-21 Thread C. Scott Ananian

I'd like to make a read-only /proc file which supports inotify -- that
is, the kernel can send change notifications to userland via the
inotify mechanism.  I've found fsnotify_modify() (in
include/linux/fsnotify.h) which seems to do what I want, but it takes
a struct dentry * -- how can I get a dentry from a struct
proc_dir_entry and increment its ref count to keep it around?  Any
help would be appreciated.  Thanks!
--scott

--
( http://cscott.net/ )
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/