Subject: Re: New kernel break programmes.
To: Andy Heffernan <ahh@netcom.com>
From: Andy Heffernan <ahh@netcom.com>
List: amiga-dev
Date: 04/27/1994 21:41:16
[blah blah -- more of the same]
> 	I tried using older, pre-off_t strip and ar binaries after
> setting up a link to libc.so.4.0, but they have the same problem, even
> though they use the old syscall which should lead them to
> oftruncate().  (Verified using ktrace.)  Time to start digging...

Folks with ftruncate() problems might want to try this patch:

*** sys/ufs/ufs_vnops.c-orig	Mon Apr 25 03:29:15 1994
--- sys/ufs/ufs_vnops.c	Wed Apr 27 21:19:06 1994
***************
*** 275,281 ****
  	if (vap->va_size != VNOVAL) {
  		if (vp->v_type == VDIR)
  			return (EISDIR);
! 		if (error = itrunc(ip, vap->va_size, 0)) /* XXX IO_SYNC? */
  			return (error);
  	}
  	if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) {
--- 275,281 ----
  	if (vap->va_size != VNOVAL) {
  		if (vp->v_type == VDIR)
  			return (EISDIR);
! 		if (error = itrunc(ip, (u_long)vap->va_size, 0)) /* XXX IO_SYNC? */
  			return (error);
  	}
  	if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) {

This fixes both ar and strip for me.

The semantics of long long elude me when it comes to parameter passing;
I would expect the compiler to implicitly typecast vap->va_size (which
is a long long) to int (which is what itrunc() wants) but I guess I am
wrong.  I wonder if byte-ordering is what has kept this from being an issue
with the 386 folks...

------------------------------------------------------------------------------