public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ray Lee <ray-lk@madrabbit.org>
To: John McCutchan <ttb@tentacle.dhs.org>
Cc: Chris Friesen <cfriesen@nortelnetworks.com>,
	Edgar Toernig <froese@gmx.de>, Robert Love <rml@novell.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [RFC][PATCH] inotify 0.9.2
Date: Wed, 22 Sep 2004 18:46:53 -0700	[thread overview]
Message-ID: <1095904012.11637.81.camel@orca.madrabbit.org> (raw)
In-Reply-To: <1095820046.22558.4.camel@vertex>

On Tue, 2004-09-21 at 19:27, John McCutchan wrote:
> On Tue, 2004-09-21 at 11:43, Chris Friesen wrote:
> > Edgar Toernig wrote:
> > > Robert Love wrote:
> > > 
> > >> struct inotify_event {
> > >> 	int wd;
> > >> 	int mask;
> > >>-	char filename[256];
> > >>+	char filename[PATH_MAX];
> > >> };
> > > 
> > > 
> > > You really want to shove >4kB per event to userspace???
> > 
> > Ouch.
> > 
> > Maybe make it variable-size?  On average it would likely be shorter.
> > 
> > struct inotify_event {
> > 	int wd;
> > 	int mask;
> > 	short namelen;
> > 	char filename[0];
> > };
> 
> This makes reading events from inotify a pain, first you need to read up
> to namelen, then read namelen more bytes. 
> 

Not the case. A mildly smarter userspace program would merely read
everything outstanding (or everything up to a fixed buffer length), and
then unserialize the events based on the boundaries it can figure out
from the first portion of the structure.

This is a way common technique.

At least in code I write, anyway :-).

Ray


  reply	other threads:[~2004-09-23  1:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20  3:56 [RFC][PATCH] inotify 0.9.2 John McCutchan
2004-09-20 21:52 ` Robert Love
2004-09-21  5:21 ` Robert Love
2004-09-21 15:34   ` Edgar Toernig
2004-09-21 15:43     ` Chris Friesen
2004-09-22  2:27       ` John McCutchan
2004-09-23  1:46         ` Ray Lee [this message]
2004-09-23  3:42           ` John McCutchan
2004-09-23  4:52             ` Ray Lee
2004-09-23  5:10               ` Robert Love
2004-09-23  5:29                 ` Ray Lee
2004-09-21 15:46     ` Robert Love
2004-09-21  5:26 ` Robert Love
2004-09-21  5:44 ` Robert Love
2004-09-21 16:04 ` Robert Love
2004-09-21 18:56   ` Robert Love
2004-09-21 20:55     ` Robert Love
2004-09-22  2:32     ` John McCutchan
2004-09-22  3:49       ` Robert Love

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=1095904012.11637.81.camel@orca.madrabbit.org \
    --to=ray-lk@madrabbit.org \
    --cc=cfriesen@nortelnetworks.com \
    --cc=froese@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@novell.com \
    --cc=ttb@tentacle.dhs.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox