History log of /src/lib/libc/tests/stdio/fmemopen2_test.c (Results 1 – 18 of 18)
Revision Date Author Comments
# 6b9f7133 23-Oct-2024 Ed Maste <emaste@FreeBSD.org>

libc: Add one more check in new fmemopen test

Reported by: jrtc27
Fixes: 0953460ce149 ("libc: fix access mode tests in fmemopen(3)")


# 0953460c 23-Oct-2024 Ed Maste <emaste@FreeBSD.org>

libc: fix access mode tests in fmemopen(3)

Previously a stream opened as read-only could be written to. Add a test
case for the fix.

Also correct another incorrect access mode check that worked by

libc: fix access mode tests in fmemopen(3)

Previously a stream opened as read-only could be written to. Add a test
case for the fix.

Also correct another incorrect access mode check that worked by
accident, and improve the tests for that.

PR: 281953
Reported by: Erkki Moorits, fuz
Reviewed by: fuz, khng (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47265

show more ...


# 559a218c 01-Nov-2023 Warner Losh <imp@FreeBSD.org>

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Kee

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42385

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 6b9f7133 23-Oct-2024 Ed Maste <emaste@FreeBSD.org>

libc: Add one more check in new fmemopen test

Reported by: jrtc27
Fixes: 0953460ce149 ("libc: fix access mode tests in fmemopen(3)")


# 0953460c 23-Oct-2024 Ed Maste <emaste@FreeBSD.org>

libc: fix access mode tests in fmemopen(3)

Previously a stream opened as read-only could be written to. Add a test
case for the fix.

Also correct another incorrect access mode check that worked by

libc: fix access mode tests in fmemopen(3)

Previously a stream opened as read-only could be written to. Add a test
case for the fix.

Also correct another incorrect access mode check that worked by
accident, and improve the tests for that.

PR: 281953
Reported by: Erkki Moorits, fuz
Reviewed by: fuz, khng (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47265

show more ...


# 559a218c 01-Nov-2023 Warner Losh <imp@FreeBSD.org>

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Kee

libc: Purge unneeded cdefs.h

These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42385

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# c1755e51 19-Apr-2016 Enji Cooper <ngie@FreeBSD.org>

Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell
on the FILE object

This fixes potential null pointer dereferences on failure

CID: 1254952
MFC after: 2 weeks
Reported by:

Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell
on the FILE object

This fixes potential null pointer dereferences on failure

CID: 1254952
MFC after: 2 weeks
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division

show more ...


# 95631a07 15-Nov-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove unused variables to fix building world


# 1ee02192 08-Nov-2015 Enji Cooper <ngie@FreeBSD.org>

Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite
as lib/libc/tests/stdio

- Fix some whitespace
- Convert the testcases to ATF
- Convert "/dev/null" to _PATH_DEVNULL

MFC after:

Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite
as lib/libc/tests/stdio

- Fix some whitespace
- Convert the testcases to ATF
- Convert "/dev/null" to _PATH_DEVNULL

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

show more ...


# b95523e8 29-Sep-2015 Xin LI <delphij@FreeBSD.org>

In this context fclose() can never fail, so assert it in the test
case.


# 41a3b124 16-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Convert tools/regression/lib/libc/stdio/test-fmemopen into an ATF testcase and
rename as lib/libc/stdio/fmemopen2_test

Sponsored by: EMC / Isilon Storage Division


# ae5cb1b1 03-Jun-2014 Pietro Cerutti <gahr@FreeBSD.org>

- Use strlen instead of hardcoding a number
- Terminate a sentence with a period

Approved by: cognet


# 4c524a42 02-Jun-2014 Pietro Cerutti <gahr@FreeBSD.org>

- 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
m

- 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

show more ...


# 71796d33 01-Feb-2013 Pietro Cerutti <gahr@FreeBSD.org>

- Fix more style(9)-related issues (copyright header, spaces after function
names, unnecessary casts)
- Change type of boolean variable from char to bool

Suggested by: jhb, zont, jmallett
Reviewed

- Fix more style(9)-related issues (copyright header, spaces after function
names, unnecessary casts)
- Change type of boolean variable from char to bool

Suggested by: jhb, zont, jmallett
Reviewed by: cognet
Approved by: cognet

show more ...


# 646b68f0 31-Jan-2013 Pietro Cerutti <gahr@FreeBSD.org>

- Remove underscores from the internal structure name, as it doesn't collide
with the user's namespace.

- Correct size and position variables type from long to size_t.

- Do not set errno to ENOME

- Remove underscores from the internal structure name, as it doesn't collide
with the user's namespace.

- Correct size and position variables type from long to size_t.

- Do not set errno to ENOMEM on malloc failure, as malloc already does so.

- Implement the concept of "buffer data length", which mandates what SEEK_END
refers to and the allowed extent for a read.

- Use NULL as read-callback if the buffer is opened in write-only mode.
Conversely, use NULL as write-callback when opened in read-only mode.

- Implement the handling of the ``b'' character in the mode argument. A binary
buffer differs from a text buffer (default mode if ``b'' is omitted) in that
NULL bytes are never appended to writes and that the "buffer data length"
equals to the size of the buffer.

- Remove shall from the man page. Use indicative instead. Also, specify that
the ``b'' flag does not conform with POSIX but is supported by glibc.

- Update the regression test so that the ``b'' functionality and the "buffer
data length" concepts are tested.

- Minor style(9) corrections.

Suggested by: jilles
Reviewed by: cognet
Approved by: cognet

show more ...


# 96c95412 30-Jan-2013 Pietro Cerutti <gahr@FreeBSD.org>

Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along
with the respective regression test.
See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html

Reviewed

Add fmemopen(3), an interface to get a FILE * from a buffer in memory, along
with the respective regression test.
See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html

Reviewed by: cognet
Approved by: cognet

show more ...