Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hsi.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxl!houxm!ihnp4!zehntel!hplabs!hao!kpno!hsi!stevens From: stevens@hsi.UUCP Newsgroups: net.unix-wizards Subject: read() from a tape Message-ID: <120@hsi.UUCP> Date: Tue, 8-Nov-83 08:23:48 EST Article-I.D.: hsi.120 Posted: Tue Nov 8 08:23:48 1983 Date-Received: Sun, 13-Nov-83 10:30:42 EST Organization: Health Systems Intl. New Haven,CT Lines: 22 On a VAX running 4.1bsd I found some code in a tape reading program that went int length; length = read(tapefd, buf, 62000); if (length < 0) /* error */ ... if (length != -1) length &= 0xffff; I removed the mask and sure enough, a read of a 3120 byte tape record returned a length of 65536+3120, hence the mask was required. I reduced the buffer size and the length to read to 30,000 bytes and the returned value became 3120, so the mask was not needed. Anyone know whats going on ? (The tape driver is tm.c.) Richard Stevens Health Systems International, New Haven, CT { decvax | hao | seismo | sdcsvax } ! kpno ! hsi ! stevens ihnp4 ! hsi ! stevens