Fields of struct timeval have sizeof(long)
authorAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 8 Jan 2013 00:19:36 +0000 (16:19 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 8 Jan 2013 00:19:36 +0000 (16:19 -0800)
kern/src/syscall.c

index 74e8ae2..18a4b6c 100644 (file)
@@ -1392,7 +1392,7 @@ intreg_t sys_gettimeofday(struct proc *p, int *buf)
 
        long long dt = read_tsc();
        /* TODO: This probably wants its own function, using a struct timeval */
-       int kbuf[2] = {t0+dt/system_timing.tsc_freq,
+       long kbuf[2] = {t0+dt/system_timing.tsc_freq,
            (dt%system_timing.tsc_freq)*1000000/system_timing.tsc_freq};
 
        return memcpy_to_user_errno(p,buf,kbuf,sizeof(kbuf));