[Cbe-oss-dev] [PATCH] libspe2: cast assist call off_t arguments to int

Arnd Bergmann arnd at arndb.de
Wed Jul 18 06:55:07 EST 2007


On Tuesday 17 July 2007, Patrick Mansfield wrote:
> The cast of assist call arguments from 32 bit unsigned int (in
> argn->slot[m]) to an off_t 64 bit signed value are incorrect with 64 bit
> libspe, and some casts are missing for the newer assist calls. 
> 
> This patch casts all off_t assist call arguments to int.
> 
> lseek is the worst, without this change it gives incorrect behaviour for
> negative offsets.
> 
> Only large or negative values for lseek and lockf (negative value is an
> error) were tested.
> 
> Signed-off-by: Patrick Mansfield <patmans at us.ibm.com>

Shouldn't the fix be to change the SPU side to always use a 64 bit off_t
in the argument list? I'd expect __USE_FILE_OFFSET64 to be always
set on the SPU since we don't need to handle backwards compatibility.

With the patch you posted, you would limit the file size for certain system
calls to 4GB, which is not all that much these days.

	Arnd <><



More information about the cbe-oss-dev mailing list