Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!noao!mcdsun!rover!fred From: fred@rover.UUCP (Fred Christiansen) Newsgroups: comp.unix.wizards Subject: need help porting SysV driver to Berkeley Message-ID: <487@rover.UUCP> Date: Fri, 28-Aug-87 15:32:38 EDT Article-I.D.: rover.487 Posted: Fri Aug 28 15:32:38 1987 Date-Received: Sun, 30-Aug-87 06:32:53 EDT Reply-To: fred@rover.UUCP (Fred Christiansen) Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 24 a co-worker is attempting to port a driver from System V/68 (SysV) to a Sun (Berkeley). he brought this question to me, which i can't answer. can someone help? if a user does a read(), like: n = read( fd, buf, sizeof( buf ) ); then inside a SysV kernel, u.u_base is the address of `buf', while u.u_count is `sizeof( buf )'. after the copyout(), i decrement u.u_count by the number of bytes copied. then, by someone between the driver read return and the read() return, someone subtracts u.u_count from `sizeof( buf )' so that the return value of read() is the number of bytes read. the co-worker has read Sun's device driver writer's guide, but does not understand (so cannot explain to me) the use of `struct uio' and `struct iovec'. under SunOS, read()'s are returning 0. what needs to get set so the real number of bytes read gets returned. thanks! -- Fred Christiansen ("Canajun, eh?") | seismo!noao!mcdsun!nud!fred (ARPA gate) Motorola Microcomputer Div., Tempe, AZ | utzoo!mnetor!mot!fred "The greatest thing a father can do for| ihnp4!mot!fred his children is to love their mother." | hplabs!motsj1!ellygroup ...