Skip site navigation (1)Skip section navigation (2)
Date:      10 Sep 2003 15:55:10 +0200
From:      Kern Sibbald <kern@sibbald.com>
To:        deischen@freebsd.org
Cc:        Dan Langille <dan@langille.org>
Subject:   Re: comments on proposed uthread_write.c changes
Message-ID:  <1063202110.27639.66.camel@rufus>
In-Reply-To: <Pine.GSO.4.10.10309100932400.6143-100000@pcnet5.pcnet.com>
References:  <Pine.GSO.4.10.10309100932400.6143-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-ojI6Dm1Z7wsvZ6m2tnfi
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2003-09-10 at 15:34, Daniel Eischen wrote:
> On 10 Sep 2003, Kern Sibbald wrote:
>=20
> > Hello,
> >=20
> > On Wed, 2003-09-10 at 02:34, Garrett Wollman wrote:
> > > <<On Tue, 9 Sep 2003 19:46:12 -0400 (EDT), Daniel Eischen <eischen@vi=
grid.com> said:
> > >=20
> > > >   Libc_r's write treats a return of 0 from __sys_write() as a
> > > >   partial write and continues looping.
> > >=20
> > > This is a bug.  The Standard is quite clear that a write of zero byte=
s
> > > is not possible unless the supplied buffer length is zero.  In the
> > > specific case of non-blocking files, if data might be written but
> > > doing so would cause the calling thread to block, write() must return
> > > -1 with errno set to [EAGAIN]; it may not return zero.  Therefore, a
> > > zero return from write() always indicates a permanent condition.
> > >=20
> > > -GAWollman
> >=20
> > Can you explain how you came to the conclusion that a non-zero
> > write may not return zero?  Keep in mind that from the
> > user's or my standpoint, we are talking about blocking
> > writes.
>=20
> He saying that it is an exception and should be returned
> as such to the caller.

Thanks, sorry I completely misunderstood.

Dan has now installed FreeBSD 5 and libkse.  The test
program runs fine.  However, I just built Bacula with
libkse. The first "trivial" regression test=20
backs up the Bacula build tree and then restores it.
The backup went OK (at least without erring), the
restore hung, and it is repeatable.
Needless to say, that isn't good.

Conclusion: I hope we find a fix to the current pthreads
code since it has functioned perfectly for a long time
now with the exception of the zero return value.


--=-ojI6Dm1Z7wsvZ6m2tnfi
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/Xy0+NgfoSvWqwEgRAtwaAKCgn+YfayeKNOoXNva/+Mb8v93i5ACdF/i6
awVGm6OBvXuxfBx8DB82lv0=
=yTpg
-----END PGP SIGNATURE-----

--=-ojI6Dm1Z7wsvZ6m2tnfi--



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