Index: src/sys/compat/linux/linux_file.c =================================================================== RCS file: /home/scvs/src/sys/compat/linux/linux_file.c,v retrieving revision 1.119.2.1 diff -u -p -u -p -r1.119.2.1 linux_file.c --- src/sys/compat/linux/linux_file.c 3 Aug 2009 08:13:06 -0000 1.119.2.1 +++ src/sys/compat/linux/linux_file.c 25 Feb 2010 20:08:47 -0000 @@ -226,6 +226,7 @@ linux_lseek(struct thread *td, struct li int whence; } */ tmp_args; int error; + l_off_t l_off; #ifdef DEBUG if (ldebug(lseek)) @@ -236,6 +237,10 @@ linux_lseek(struct thread *td, struct li tmp_args.offset = (off_t)args->off; tmp_args.whence = args->whence; error = lseek(td, &tmp_args); + /* Check for overflow like Linux does. */ + l_off = *(off_t *)td->td_retval; + if (((off_t)l_off) != *(off_t *)td->td_retval) + error = EOVERFLOW; return error; }