Subject: None
To: None <geoff@FICUS.CS.UCLA.EDU>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-users
Date: 02/15/1995 08:30:24
>> 2) 'lseek(2)' now needs 64-bit int's (off_t)
> Unfortunately, off_t doesn't exist on every system, sigh.  Does this
> one just cause warnings, or does it actually generate incorrect code?

That depends.  If you have a prototype in scope, and all files involved
are small enough, you can pretend lseek takes 32-bit offsets, and the
prototype will promote as necessary.

But if you actually manage to pass a 32-bit offset (ie, no or an
incorrect prototype in scope, and writing a 32-bit expression for the
argument), lseek _will_ misbehave.  (The only way this could possibly
work right is when (a) the slot that lseek takes as holding the third
argument happens to contain a zero, (b) the 32-bit offset you pass
happens to land in the least-significant half of the 64-bit value lseek
takes as the offset, and (c) the high half of that 64-bit value (which
means, more or less, the value that you intended as the third argument
to lseek) is zero (ie, L_SET).  Or, of course, if the machine is 64-bit
to begin with, like the Alpha.)

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu