Re: sim/arm/armos.c: IsTTY [PATCH]

Daniel Jacobowitz
2005-08-30T02:37:31Z

On Mon, Aug 15, 2005 at 12:04:13PM -0700, Shaun Jackman wrote:
> This patch adds support for the ARM IsTTY, Remove, and Rename SWI calls.
>
> Please cc me in your reply. Cheers,
> Shaun
>
> 2005-08-15 Shaun Jackman <sjackman@gmail.com>
>
> * sim/arm/armos.c (unlink): Remove this macro. It is unused
> in this file and conflicts with sim_callback->unlink.
> (SWIremove): New function.
> (SWIrename): Ditto.
> (ARMul_OSHandleSWI): Handle the RDP calls SWI_IsTTY,
> SWI_Remove, and SWI_Rename, as well as the RDI calls
> AngelSWI_Reason_IsTTY, AngelSWI_Reason_Remove, and
> AngelSWI_Reason_Rename.

It looks plausible to me; Richard, any comments?

> + char dummy[2000];
> + int i;
> +
> + for (i = 0; (dummy[i] = ARMul_SafeReadByte (state, path + i)); i++)
> + ;

Please no buffer overflows be adding. Also, there's plenty of ways to
write this without the ugly empty loop body...

--
Daniel Jacobowitz
CodeSourcery, LLC