Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!lll-tis!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: What real non-UNIX 'C' compilers implement... Message-ID: <672@sugar.UUCP> Date: Tue, 8-Sep-87 10:35:55 EDT Article-I.D.: sugar.672 Posted: Tue Sep 8 10:35:55 1987 Date-Received: Thu, 10-Sep-87 07:22:19 EDT Organization: Sugar Land UNIX - Houston, TX Lines: 38 To: Doug Gwynn. Mail is off the hook, so I'll post a reply here. I think it's of general interest, anyway. > [ Doug sent me mail saying most non-UNIX 'C' compilers probably don't > implement read/write anyway ] Well, actually, every non-UNIX 'C' compiler I've used has had read and write. In fact, some have not had fread/fwrite (the ones that emulated pre-version-7 libraries). Usually fread and fwrite are implemented in terms of read and write, even when that is a brain damaged thing to do (Lattice 'C' on the IBM does this and breaks fseek for text files. Manx 'C' on the Amiga does this despite the AmogaDOS having a read and a write with identical semantics to UNIX). On a couple, read/write are used for binary I/O and fread and fwrite and (mainly) fprintf and fgets are used for text I/O. Database: VAX/VMS 'C'. DECUS 'C' for the PDP-11 is so screwed up I can't remember what it implemented. BDS-C for the Z80, no fread/fwrite (actually implemented UNIXio functions with stdio names). Small-C for the 8080 with the library that came with my copy. Lattice and Manx 'C' on the Amiga. Lattice, Microsoft, and de Smet 'C' on the IBM-PC. I would probably recommend implementing read/write because in preactical terms that's what most people tend to use for binary file-fiddling. And you don't want to disappoint people wanting to port their binary file-fiddlers, now would you? But make them efficient... on MS-DOS, frex, make them straight mappings to the MS-DOS "UNIX-style" I/O. On the Amiga, make them aliases for Read and Write (etc.)... this will break people who do read(0) and write(1), but these people are probably doing pipe(&pip) and fork() and stuff anyway. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter -- 'U` <-- Public domain wolf.