OSDN Git Service

2007-08-10 Carlos O'Donell <carlos@codesourcery.com>
authorjjohnstn <jjohnstn>
Fri, 10 Aug 2007 19:36:46 +0000 (19:36 +0000)
committerjjohnstn <jjohnstn>
Fri, 10 Aug 2007 19:36:46 +0000 (19:36 +0000)
commitae4d0e54482047b69444a4b2d430f2a1c0341878
treed5324481b2991cc8a162c18226428e297677860f
parentdc4b32269e11ddc96195d373cb0d158a04375b40
2007-08-10  Carlos O'Donell  <carlos@codesourcery.com>

        2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>

        * arm/syscalls.c (_stat): Use _close

        * arm/syscalls.c (struct poslog): Rename to...
        (struct fdent): ... this.
        (FILE_HANDLE_OFFSET): Remove.
        (findslot): Return a struct fdent* if fd is valid, otherwise return NULL.
        (newslot): New function.
        (remap_handle): Remove.
        (initialise_monitor_handles): Use stdout as fallback for stderr.
        (wrap): Rename to...
        (checkerror): ...  this.
        (_swiread): Use checkerror() for the return of SWI calls.  Correct the use of r0.
        (_read): Use findslot().  Return EBADF on bad handle.
        (_swilseek): Call findslot().  Check for valid whence.  Check for negative offset when using
        SEEK_CUR, and check for overflow.  Use checkerror().  Check *_Flen calls for errors.
        (_swiwrite): Correct the use of r0.
        (_write): Call findslot().
        (_swiopen): Call findslot().  Check for valid flags.  Use checkerror().  Call newslot().
        Handle O_TRUNC, and O_WRONLY.  Return index into openfiles[] for fd.
        (_swiclose): Correct the use of r0.
        (_close): Handle stderr == stdout case.  Only reclaim handle if _swiclose succeeded.
        (_getpid): Use __attribute__((unused)).
        (_sbrk): Fix formatting.
        (_swistat): New function.
        (_stat): Call _swistat().
        (_fstat): Call _swistat().
        (_unlink): Correct the use of r0.
        (isatty): Call finslot().  Correct the use of r0.
        (_system): Call checkerror().  Correct the use of r0.
        (_rename): Correct the use of r0.
libgloss/ChangeLog
libgloss/arm/syscalls.c