From owner-cvs-lib Fri Sep 13 13:03:17 1996 Return-Path: owner-cvs-lib Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA12910 for cvs-lib-outgoing; Fri, 13 Sep 1996 13:03:17 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA12887; Fri, 13 Sep 1996 13:02:54 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by who.cdrom.com (8.7.5/8.6.11) with SMTP id NAA13448 ; Fri, 13 Sep 1996 13:02:35 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id FAA22959; Sat, 14 Sep 1996 05:56:33 +1000 Date: Sat, 14 Sep 1996 05:56:33 +1000 From: Bruce Evans Message-Id: <199609131956.FAA22959@godzilla.zeta.org.au> To: cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-lib@freefall.freebsd.org, pst@freefall.freebsd.org Subject: Re: cvs commit: src/lib/libc/stdio funopen.3 Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Modified: lib/libc/stdio funopen.3 > Log: > fwopen() argument type mis-described > > Obtained from: NetBSD lib/2751 (der Mouse) Hmmm, the fwopen() and fropen() function arg types are mis-designed - they are incompatible write() and read, e.g,: ssize_t write (int fd, void const *buf, size_t nbytes); ||||||| |||| |||||| int (*writefn) (void *cookie, char const *buf, int nbytes); This matters if size_t is larger than int and if write() can sucessfully return a negative count. It is easy to write a writefn that can successfully returns a negative count and easy to return such a count on a 16-bit system. __sfvwrite() misinterprets negative counts as errors although the man page says that only -1 is an error. Bruce