From owner-freebsd-hackers Mon Sep 10 6:17:36 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from assaris.sics.se (assaris.sics.se [193.10.66.234]) by hub.freebsd.org (Postfix) with ESMTP id AD7EB37B405 for ; Mon, 10 Sep 2001 06:17:28 -0700 (PDT) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id PAA34818; Mon, 10 Sep 2001 15:17:24 +0200 (CEST) (envelope-from assar) To: Kent Boortz Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to force small TCP packets? References: <20010909182745.O2965@elvis.mu.org> From: Assar Westerlund Date: 10 Sep 2001 15:17:23 +0200 In-Reply-To: Kent Boortz's message of "10 Sep 2001 07:14:33 +0200" Message-ID: <5lelpfmbh8.fsf@assaris.sics.se> Lines: 23 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kent Boortz writes: > If application A do a write like > > write(socket, buf, 100); > > and application B read this like > > read(socket, buf, 100); > > without checking the result from the read operation, then this code > will probably work 99.9999% of the time. But if I could force the > kernel to pass data from a socket on to the application say one byte > at the time then this code will break 100% of the time. This makes > finding these problems more easy. Cannot you implement a shared library that you give to the applications that you want to test with your own version of read() that calls the real system call with different values of nbytes depending on your testing policy? You might want to hook socket too so that you know which fd:s are sockets (or you can probably call getsockname/getpeername on them). /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message