libc/newlib/libc
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
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype ctype: Avoid GCC note in towctrans_l.c 2018-07-30 10:47:57 +02:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
include Drop non-reserved parameter names from sys/signal.h 2018-08-29 17:46:27 +02:00
locale newlib: newlocale: fix typo rendering ctype_ptr invalid 2018-08-08 09:26:32 +02:00
machine Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin for smaller and faster code. 2018-08-31 15:40:42 -04:00
misc RISC-V: Do not use _init/_fini 2018-07-30 10:47:57 +02:00
posix newlib: wordexp: drop dangerous fprintf 2018-08-08 10:50:19 +02:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search Reduce qsort stack consumption 2018-03-16 10:21:23 +01:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp makedoc: make errors visible 2017-12-07 11:54:11 +00:00
stdio Use nanf("") instead of nanf(NULL) 2018-08-29 15:57:27 +02:00
stdio64 ansification: remove _EXFNPTR, _EXPARM 2018-01-17 11:47:27 -06:00
stdlib Use nanf("") instead of nanf(NULL) 2018-08-29 15:57:27 +02:00
string Use __inhibit_loop_to_libcall in all memset/memcpy implementations 2018-08-29 16:05:37 +02:00
sys Avoid ARM SWI Seek when querying file position 2018-09-03 09:40:39 +02:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05: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 ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00