From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23415 invoked by alias); 9 Sep 2005 17:16:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23389 invoked by uid 22791); 9 Sep 2005 17:16:01 -0000 Received: from qproxy.gmail.com (HELO qproxy.gmail.com) (72.14.204.196) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 09 Sep 2005 17:16:01 +0000 Received: by qproxy.gmail.com with SMTP id k11so61275qbf for ; Fri, 09 Sep 2005 10:15:59 -0700 (PDT) Received: by 10.64.199.8 with SMTP id w8mr2166qbf; Fri, 09 Sep 2005 10:15:59 -0700 (PDT) Received: by 10.65.20.15 with HTTP; Fri, 9 Sep 2005 10:15:59 -0700 (PDT) Message-ID: <7f45d9390509091015782cd176@mail.gmail.com> Date: Fri, 09 Sep 2005 17:16:00 -0000 From: Shaun Jackman Reply-To: sjackman@gmail.com To: Richard Earnshaw Subject: Re: sim/arm/armos.c: IsTTY [PATCH] Cc: gdb-patches@sources.redhat.com In-Reply-To: <1126170388.18092.16.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7f45d9390508151204ca0b146@mail.gmail.com> <20050830023718.GB16189@nevyn.them.org> <7f45d93905090709516f912861@mail.gmail.com> <1126170388.18092.16.camel@pc960.cambridge.arm.com> X-SW-Source: 2005-09/txt/msg00056.txt.bz2 2005/9/8, Richard Earnshaw : > 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 =3D 0; i < sizeof buf; i++) if ((*p++ =3D ARMul_SafeReadByte (state, name++)) =3D=3D '\0') break; if (i =3D=3D sizeof buf) { state->Reg[0] =3D -1; OSptr->ErrorNo =3D cb_host_to_target_errno(sim_callback, ENAMETOOLONG); return; } Cheers, Shaun