From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c86eb13dd395066 X-Google-Attributes: gid103376,public From: ohk@edeber.tfdt-o.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: CRC in Ada? Date: 1997/03/10 Message-ID: #1/1 X-Deja-AN: 224383243 References: <1997Mar2.220652@nova.wright.edu> Organization: Telenor Online Public Access Newsgroups: comp.lang.ada Date: 1997-03-10T00:00:00+00:00 List-Id: In article dewar@merv.cs.nyu.edu (Robert Dewar) writes: OUe-Hjalmar says > I think you are missing something here. Altough in Unix it IS possible > to do reads of arbitrary length, the standard IO library of C > definitely does IO in blocks. The getc/putc functions are > usually implemented as macros, which just manipulate the buffer. Of You cannot make such statements (the standard IO lbrary of C definitely does IO in blocks). The standard speaks only of interfaces, not of implementation, there is nothing in the standardized interface that requires IO to be done in blocks. This may be an implementation characterstic of some or even most or even all current implementations, but it is NOT a fundamental property of the standard IO library. Yes, of course you are right. I plead guilty of using imprecise language. But I still would say that this is the only reasonable implementation, especially as functions to explicitly control the buffering and flush the buffer is part of the specification. You could just as well argue that if you use the write system call, you have no guarantee that the OS does not actually write a single byte at a time to the disk... Maybe the standards should say something about the precise semantics at this level as well. Anyway, you seem to have missed my point, which is that as all the Unix standard IO libraries I am aware og does block IO anyway, it would not be any harder to implement such a library on any other OS which have block IO but not single char IO as part of the system calls. The flexibility of the Unix read and write calls is not needed by the usual implementations of the C standard IO library. Ole-Hj. Kristensen