History log of /freebsd-10-stable/lib/libc/stdio/ftell.c
Revision Date Author Comments
# 291050 19-Nov-2015 ache

MFC: r290549,r290729

r290549:

Reorganize code to elimitate one _sseek() call for append modes.

r290729:

1) Remove my overcomplicated error fallback and just return error
immediatelly as old code does, now for append modes too.
Real use case for such fallback is impossible (unless specially crafted).

2) Remove now unneded include I forgot to remove in prev. commits.


# 290544 08-Nov-2015 ache

MFC: r289863,r289931,r290110,r290230,r290231,r290232

r290232:

Microoptimize.

r290231:

Addition to prev. commit.
In some edge cases fp->_p can be changed in _sseek(), recalculate.

r290230:

Don't seek to the end if write buffer is empty (in append modes).
PR: 204156

r290110:

Add _flags2 per jhb@ suggestion since no room left in _flags.
Rewrite O_APPEND flag checking using new __S2OAP flag.

r289931:

According to POSIX, a write operation shall start at the current size of
the stream (if mode had 'a' as the first character).

r289863:

Since no room left in the _flags, reuse __SALC for O_APPEND.
It helps to remove _fcntl() call from _ftello() and optimize seek position
calculation in _swrite().


# 269623 06-Aug-2014 ache

MFC: r268997

For "a"-mode files and rewind/fseek + fwrite combination return meaningful
value now, like Apple does, but avoid their __sflush physical write
performance degradation as much as possible.


# 269623 06-Aug-2014 ache

MFC: r268997

For "a"-mode files and rewind/fseek + fwrite combination return meaningful
value now, like Apple does, but avoid their __sflush physical write
performance degradation as much as possible.