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

Richard Earnshaw
2005-09-06T16:22:51Z

On Tue, 2005-08-30 at 03:37, Daniel Jacobowitz wrote:
> 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?
>

I've no objections, these are part of the standard SWI set, so I see no
real reason not to implement them if we can.

> > + 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...

Agreed.

R.