libc/newlib/libc/sys/arm
Andy Koppe 3017f23f1c Avoid ARM SWI Seek when querying file position
Issuing an ARM semi-hosting Seek command when just querying file
position with SEEK_CUR and offset zero is unnecessary, because unlike
the lseek() Unix system call the Seek command does not actually return
the file position. For that reason, syscalls.c for ARM keeps track of
file position in the 'poslog', so we can just return that.

Moreover, since the Seek command only accepts an absolute file position,
SEEK_CUR operations are implemented by adding the relative offset to the
position in the poslog. If the host implements non-binary files with
implicit carriage return characters but doesn't discount those implicit
CRs when implementing Seek (by just mapping straight to Windows file
operations), this actually ended up wrongly changing file position when
using SEEK_CUR with offset zero or functions like ftell() or fgetpos()
that are based on that.

Also, use off_t rather than int for the poslog.
2018-09-03 09:40:39 +02:00
..
sys Add definitions for NBBY to arm and rtems targets 2015-12-07 16:31:00 +01:00
Makefile.am Move ARM access.c from machine to sys 2017-05-25 12:34:53 -04:00
Makefile.in Move ARM access.c from machine to sys 2017-05-25 12:34:53 -04:00
access.c Move ARM access.c from machine to sys 2017-05-25 12:34:53 -04:00
aclocal.m4 2012-12-20 Jeff Johnston <jjohnstn@redhat.com> 2012-12-20 21:10:27 +00:00
aeabi_atexit.c add forward declaration to __cxa_atexit to aeabi_atexit, to prevent warnings 2018-02-16 12:16:07 +01:00
arm.h Make macro checks ARMv8-M baseline proof 2016-01-28 11:26:37 +01:00
configure Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin for smaller and faster code. 2018-08-31 15:40:42 -04:00
configure.in 2006-04-13 Ralf Corsepius <ralf.corsepius@rtems.org> 2006-04-13 19:56:32 +00:00
crt0.S Make macro checks ARMv8-M baseline proof 2016-01-28 11:26:37 +01:00
libcfunc.c * libc/sys/arm/syscalls.c (do_AngelSWI): Delete. 2013-07-19 09:57:51 +00:00
swi.h Make macro checks ARMv8-M baseline proof 2016-01-28 11:26:37 +01:00
syscalls.c Avoid ARM SWI Seek when querying file position 2018-09-03 09:40:39 +02:00
trap.S 2006-02-07 Paul Brook <paul@codesourcery.com> 2006-02-07 18:44:54 +00:00