1 /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
3 * GNU Library General Public License (LGPL) version 2 or later.
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
10 #ifndef __DO_LARGEFILE
14 libc_hidden_proto(FTELL
)
16 int fgetpos(FILE * __restrict stream
, register fpos_t * __restrict pos
)
18 #ifdef __STDIO_MBSTATE
21 __STDIO_AUTO_THREADLOCK_VAR
;
23 __STDIO_AUTO_THREADLOCK(stream
);
25 if ((pos
->__pos
= FTELL(stream
)) >= 0) {
26 __COPY_MBSTATE(&(pos
->__mbstate
), &(stream
->__state
));
27 pos
->__mblen_pending
= stream
->__ungot_width
[0];
31 __STDIO_AUTO_THREADUNLOCK(stream
);
37 return ((pos
->__pos
= FTELL(stream
)) >= 0) ? 0 : -1;