public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Fedyk <mfedyk@matchmail.com>
To: Taral <taral@taral.net>
Cc: Keith Owens <kaos@ocs.com.au>, linux-kernel@vger.kernel.org
Subject: Re: /proc/net/ip_conntrack problems
Date: Mon, 29 Oct 2001 13:19:16 -0800	[thread overview]
Message-ID: <20011029131916.D20280@mikef-linux.matchmail.com> (raw)
In-Reply-To: <20011028220854.A17685@taral.net> <3974.1004329672@kao2.melbourne.sgi.com> <20011028223651.B17685@taral.net>
In-Reply-To: <20011028223651.B17685@taral.net>

On Sun, Oct 28, 2001 at 10:36:51PM -0600, Taral wrote:
> On Mon, Oct 29, 2001 at 03:27:52PM +1100, Keith Owens wrote:
> > Some /proc output is blocked, it will only return complete lines.  If
> > your buffer is not big enough to hold the next line then you don't get
> > anything at all.  Try cat /proc/net/ip_conntrack | wc.
> 
> So why are 2 lines missing when I change the blocking factor from 256 to
> 512? Even cat reads in 16k blocks... Also:
> 
> % dd if=/proc/net/ip_conntrack bs=512 | perl -ne 'print length()."\n"'
> 0+2 records in
> 0+2 records out
> 153
> 138
> 169
> 151
> 167
> 139
> 
> No line is longer than 256 chars, so why are 2 lines missing when I read
> in 256 byte blocks?
> 

Because you would need the buffer size to hit the moving target of any of
the boundaries of the lines.  So you would need (for the example above)
buffer sizes of:
153
291
460
611
778
778

16k blocks would hold all of those...

IIRC, proc files have trouble returning output larget than one page (4k)...

Mike

  reply	other threads:[~2001-10-29 21:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-29  4:08 /proc/net/ip_conntrack problems Taral
2001-10-29  4:27 ` Keith Owens
2001-10-29  4:36   ` Taral
2001-10-29 21:19     ` Mike Fedyk [this message]
2001-10-29 22:24       ` Taral

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=20011029131916.D20280@mikef-linux.matchmail.com \
    --to=mfedyk@matchmail.com \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=taral@taral.net \
    /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