From: "Chad N. Tindel" <chad@tindel.net>
To: David Stevens <dlstevens@us.ibm.com>
Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com,
netdev-bounce@oss.sgi.com,
Stephen Hemminger <shemminger@osdl.org>
Subject: Re: Wrong UIDs reported in /proc/net/tcp
Date: Thu, 18 Nov 2004 18:49:11 -0500 [thread overview]
Message-ID: <20041118234911.GA66056@calma.pair.com> (raw)
In-Reply-To: <OFE512064F.DBA4A3CD-ON88256F50.007A2A62-88256F50.007A5E0F@us.ibm.com>
> Assuming so, another solution would be to stat/fstat the file, add some to
> it to account
> for growth, allocate a buffer that big and read the whole thing in one
> shot. Then the
> results should be self-consistent.
Yeah the kernel doesn't let you read more than 1 page of data. Thats how big
the block of memory that it passes to the proc handler is.
http://lxr.linux.no/source/fs/proc/generic.c#L61
IIRC, each line in /proc/net/tcp is 115 bytes or something like that, so if
a page is 4k, then you can only read 4096/115 = 35 sockets worth of info per
read() call.
Chad
next prev parent reply other threads:[~2004-11-18 23:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-09 20:53 Wrong UIDs reported in /proc/net/tcp Chad N. Tindel
2004-11-09 21:06 ` Herbert Xu
2004-11-09 22:43 ` Chad N. Tindel
2004-11-09 22:58 ` Herbert Xu
2004-11-09 23:04 ` Chad N. Tindel
2004-11-09 23:18 ` Herbert Xu
2004-11-18 19:02 ` Chad N. Tindel
2004-11-18 21:03 ` Herbert Xu
2004-11-18 21:27 ` Stephen Hemminger
2004-11-18 22:07 ` Herbert Xu
2004-11-18 22:16 ` David Stevens
2004-11-18 23:40 ` Herbert Xu
2004-11-18 23:49 ` Chad N. Tindel [this message]
2004-11-18 23:56 ` David Stevens
2004-11-19 1:26 ` Herbert Xu
2004-11-19 21:01 ` Chad N. Tindel
2004-11-19 14:27 ` Henrik Nordstrom
2004-11-09 21:11 ` akepner
2004-11-09 22:41 ` Chad N. Tindel
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=20041118234911.GA66056@calma.pair.com \
--to=chad@tindel.net \
--cc=dlstevens@us.ibm.com \
--cc=linux-net@vger.kernel.org \
--cc=netdev-bounce@oss.sgi.com \
--cc=netdev@oss.sgi.com \
--cc=shemminger@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).