Skip site navigation (1)Skip section navigation (2)
Date:      10 Sep 2001 15:17:23 +0200
From:      Assar Westerlund <assar@FreeBSD.ORG>
To:        Kent Boortz <kent@erix.ericsson.se>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: How to force small TCP packets?
Message-ID:  <5lelpfmbh8.fsf@assaris.sics.se>
In-Reply-To: Kent Boortz's message of "10 Sep 2001 07:14:33 %2B0200"
References:  <d2y9nogetm.fsf@erix.ericsson.se> <20010909182745.O2965@elvis.mu.org> <d2heubk4p2.fsf@erix.ericsson.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Kent Boortz <kent@erix.ericsson.se> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5lelpfmbh8.fsf>