[122] in Pthreads mailing list archive
Re: (f)read problem
daemon@ATHENA.MIT.EDU (Ronald Wahl)
Thu Sep 14 07:59:57 1995
Date: Thu, 14 Sep 1995 13:08:04 +0200 (MET DST)
From: Ronald Wahl <Ronald.Wahl@Informatik.TU-Chemnitz.DE>
To: "H.J. Lu" <hjl@nynexst.com>
Cc: pthreads-mailinglist <pthreads@MIT.EDU>
In-Reply-To: <Pine.LNX.3.91.950914021143.246A-100000@goliath.csn.tu-chemnitz.de>
On Thu, 14 Sep 1995, Ronald Wahl wrote:
>
> Hi,
>
> One thread of my program should read a directory listing from an ftp
> server. I do this in blocks of size 4096 bytes. On little directories it
> will do the job (in most cases) but on large directories I get a "Bad
> address" on the read call (fread does not return in this case). Sometimes
> the read call does only read 1024 bytes instead of 4096. Maybe there is a
> bug in the pthreads library (I use 1.60beta3 with linux-1.2.13). I guess
> it has to do with a signal (maybe from the pthread scheduler) interrupting
> the read call.
I have fixed the problem. A hidden and nasty bug in my program caused the
"Bad address" error and it's probably normal that I got sometimes less than
4096 bytes --> I have to read again from the socket.
Ronald.
+-------------------------------------------------------------------+
| Ronald Wahl rwa@informatik.tu-chemnitz.de |
| >> PGP key available by finger << http://www.tu-chemnitz.de/~row |
+-------------------------------------------------------------------+
| PGP fingerprint: 9D 4A 66 7C A9 9F 6A 5F 90 45 D5 0C DF E5 CB 71 |
+-------------------------------------------------------------------+