This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: sim/arm/armos.c: IsTTY [PATCH]
- From: Shaun Jackman <sjackman at gmail dot com>
- To: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 9 Sep 2005 11:15:59 -0600
- Subject: Re: sim/arm/armos.c: IsTTY [PATCH]
- References: <7f45d9390508151204ca0b146@mail.gmail.com> <20050830023718.GB16189@nevyn.them.org> <7f45d93905090709516f912861@mail.gmail.com> <1126170388.18092.16.camel@pc960.cambridge.arm.com>
- Reply-to: sjackman at gmail dot com
2005/9/8, Richard Earnshaw <rearnsha@gcc.gnu.org>:
> 1) PATH_MAX isn't ANSI (it's POSIX, or something like that). So you
> can't rely on it being defined. I think for this case you can probably
> just define it to 1024 anyway if it's missing, but see
> libiberty/lrealpath.c if you want the gory details.
I'll use the ANSI FILENAME_MAX as Eli suggested.
> 2) If you do overflow the path limit, you need to set the simulator's
> errno value and return. Use cb_host_to_target_errno(sim_callback,
> ENAMETOOLONG) to set it.
Is this the correct way to use cb_host_to_target_errno?
for (i = 0; i < sizeof buf; i++)
if ((*p++ = ARMul_SafeReadByte (state, name++)) == '\0')
break;
if (i == sizeof buf) {
state->Reg[0] = -1;
OSptr->ErrorNo = cb_host_to_target_errno(sim_callback, ENAMETOOLONG);
return;
}
Cheers,
Shaun