powerpc: Add compat_sys_truncate
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 28 Jul 2009 01:54:32 +0000 (11:54 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:12:34 +0000 (10:12 +1000)
commitdd90bbd5fb763ab8924135a30956030c7a7b94fc
treee8cb73517611d26b74086025958e88404994f028
parentc79b29735d28d819380b584d6707b4110ee759f3
powerpc: Add compat_sys_truncate

The truncate syscall has a signed long parameter, so when using a 32-
bit userspace with a 64-bit kernel the argument is zero-extended
instead of sign-extended. Adding the compat_sys_truncate function
fixes the issue.

This was noticed during an LSB truncate test failure. The test was
checking for the correct error number set when truncate is called with
a length of -1. The test can be found at:

http://bzr.linuxfoundation.org/lsb/devel/runtime-test?cmd=inventory;rev=stewb%40linux-foundation.org-20090626205411-sfb23cc0tjj7jzgm;path=modules/vsx-pcts/tset/POSIX.os/files/truncate/

BenH: Added compat_sys_ftruncate() as well, same issue.

Signed-off-by: Chase Douglas <cndougla@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/systbl.h
arch/powerpc/kernel/sys_ppc32.c