History log of /freebsd-10-stable/lib/libc/stdio/fmemopen.c
Revision Date Author Comments
# 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().


# 277016 11-Jan-2015 ngie

MFC discussed with: jilles, -developers

MFC r266971:

- Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).
Update the manpage to reflect this change.
- Always set the current position to the first null-byte when opening in append
mode. This makes the implementation compatible with glibc's. Update the test
suite.

Reported by: pho
Approved by: cognet


# 277016 11-Jan-2015 ngie

MFC discussed with: jilles, -developers

MFC r266971:

- Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).
Update the manpage to reflect this change.
- Always set the current position to the first null-byte when opening in append
mode. This makes the implementation compatible with glibc's. Update the test
suite.

Reported by: pho
Approved by: cognet