Subject: Re: systrace broken in -current?
To: Jeff Ito <jeffi@rcn.com>
From: Niels Provos <provos@citi.umich.edu>
List: current-users
Date: 05/25/2004 13:41:18
On Sun, May 23, 2004 at 11:18:25AM -0400, Jeff Ito wrote:
> I don't know if this suggests an underlying error in systrace that
> this exposed, or in the sys_process.c diff, but hopefully this will 
> give someone a place to start looking. 

The following diff

Index: kern_systrace.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_systrace.c,v
retrieving revision 1.39
diff -u -r1.39 kern_systrace.c
--- kern_systrace.c	25 Apr 2004 16:42:41 -0000	1.39
+++ kern_systrace.c	25 May 2004 16:06:59 -0000
@@ -1191,7 +1191,7 @@
 	iov.iov_len = io->strio_len;
 	uio.uio_iov = &iov;
 	uio.uio_iovcnt = 1;
-	uio.uio_offset = (off_t)(long)io->strio_offs;
+	uio.uio_offset = (off_t)(unsigned long)io->strio_offs;
 	uio.uio_resid = io->strio_len;
 	uio.uio_segflg = UIO_USERSPACE;
 	uio.uio_procp = p;

solves the problem, but I have to admin that I do not understand
the original reason for the casting.  But basically, the long is
signed and then converting to (off_t) extended the signedness.

Niels.