History log of /src/tests/sys/file/closefrom_test.c (Results 1 – 25 of 42)
Revision Date Author Comments
# 2fbb6e21 27-Oct-2025 John Baldwin <jhb@FreeBSD.org>

closefrom_test: Convert to atf-c(3)

Reviewed by: ngie, markj
Differential Revision: https://reviews.freebsd.org/D52800


# b307799b 23-Oct-2025 John Baldwin <jhb@FreeBSD.org>

closefrom_test: Fix the first test

The first test is supposed to close the new fd, but was instead not
closing anything.

Reviewed by: ngie, markj
Fixes: 3cedbec3ee08 ("Integrate tools/regression/f

closefrom_test: Fix the first test

The first test is supposed to close the new fd, but was instead not
closing anything.

Reviewed by: ngie, markj
Fixes: 3cedbec3ee08 ("Integrate tools/regression/fifo into ...")
Differential Revision: https://reviews.freebsd.org/D52799

show more ...


# 63503cbe 03-Jun-2025 Ricardo Branco <rbranco@suse.de>

tests: Adapt existing tests for O_CLOEXEC to O_CLOFORK

MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1698


# 664812f7 01-Jan-2024 Yen-Cheng Chang <jonason2004@gmail.com>

Fix grammar error in test/sys/file/closefrom_test.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/973


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

Remove $FreeBSD$: one-line .c pattern

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


# 3a01dcc9 06-Mar-2022 Mark Johnston <markj@FreeBSD.org>

tests: Fix the test plan for closefrom_test

Fixes: f3f3e3c44d3b ("fd: add close_range(..., CLOSE_RANGE_CLOEXEC)")
Reported by: Jenkins


# f3f3e3c4 03-Mar-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: add close_range(..., CLOSE_RANGE_CLOEXEC)

For compatibility with Linux.

MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34424


# 605c4cda 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

close_range/closefrom: fix regression from close_range introduction

close_range will clamp the range between [0, fdp->fd_lastfile], but failed
to take into account that fdp->fd_lastfile can become -

close_range/closefrom: fix regression from close_range introduction

close_range will clamp the range between [0, fdp->fd_lastfile], but failed
to take into account that fdp->fd_lastfile can become -1 if all fds are
closed. =-( In this scenario, just return because there's nothing further we
can do at the moment.

Add a test case for this, fork() and simply closefrom(0) twice in the child;
on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic
before this change.

X-MFC-With: r359836

show more ...


# 472ced39 12-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Implement a close_range(2) syscall

close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom

Implement a close_range(2) syscall

close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom(2), as the case may be that they/someone have special
fds dup'd to higher in the range and they can't necessarily closefrom(min)
because they don't want to hit the upper range, but relocating them to lower
isn't necessarily feasible.

sys_closefrom has been rewritten to use kern_close_range() using ~0U to
indicate closing to the end of the range. This was chosen rather than
requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
call to kern_close_range for simplicity.

The flags argument of close_range(2) is currently unused, so any flags set
is currently EINVAL. It was added to the interface in Linux so that future
flags could be added for, e.g., "halt on first error" and things of this
nature.

This patch is based on a syscall of the same design that is expected to be
merged into Linux.

Reviewed by: kib, markj, vangyzen (all slightly earlier revisions)
Differential Revision: https://reviews.freebsd.org/D21627

show more ...


# 2fbb6e21 27-Oct-2025 John Baldwin <jhb@FreeBSD.org>

closefrom_test: Convert to atf-c(3)

Reviewed by: ngie, markj
Differential Revision: https://reviews.freebsd.org/D52800


# b307799b 23-Oct-2025 John Baldwin <jhb@FreeBSD.org>

closefrom_test: Fix the first test

The first test is supposed to close the new fd, but was instead not
closing anything.

Reviewed by: ngie, markj
Fixes: 3cedbec3ee08 ("Integrate tools/regression/f

closefrom_test: Fix the first test

The first test is supposed to close the new fd, but was instead not
closing anything.

Reviewed by: ngie, markj
Fixes: 3cedbec3ee08 ("Integrate tools/regression/fifo into ...")
Differential Revision: https://reviews.freebsd.org/D52799

show more ...


# 63503cbe 03-Jun-2025 Ricardo Branco <rbranco@suse.de>

tests: Adapt existing tests for O_CLOEXEC to O_CLOFORK

MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1698


# 664812f7 01-Jan-2024 Yen-Cheng Chang <jonason2004@gmail.com>

Fix grammar error in test/sys/file/closefrom_test.c

Event: Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request: https://github.com/freebsd/freebsd-src/pull/973


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

Remove $FreeBSD$: one-line .c pattern

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


# 3a01dcc9 06-Mar-2022 Mark Johnston <markj@FreeBSD.org>

tests: Fix the test plan for closefrom_test

Fixes: f3f3e3c44d3b ("fd: add close_range(..., CLOSE_RANGE_CLOEXEC)")
Reported by: Jenkins


# f3f3e3c4 03-Mar-2022 Mateusz Guzik <mjg@FreeBSD.org>

fd: add close_range(..., CLOSE_RANGE_CLOEXEC)

For compatibility with Linux.

MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34424


# 605c4cda 13-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

close_range/closefrom: fix regression from close_range introduction

close_range will clamp the range between [0, fdp->fd_lastfile], but failed
to take into account that fdp->fd_lastfile can become -

close_range/closefrom: fix regression from close_range introduction

close_range will clamp the range between [0, fdp->fd_lastfile], but failed
to take into account that fdp->fd_lastfile can become -1 if all fds are
closed. =-( In this scenario, just return because there's nothing further we
can do at the moment.

Add a test case for this, fork() and simply closefrom(0) twice in the child;
on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic
before this change.

X-MFC-With: r359836

show more ...


# 472ced39 12-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Implement a close_range(2) syscall

close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom

Implement a close_range(2) syscall

close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom(2), as the case may be that they/someone have special
fds dup'd to higher in the range and they can't necessarily closefrom(min)
because they don't want to hit the upper range, but relocating them to lower
isn't necessarily feasible.

sys_closefrom has been rewritten to use kern_close_range() using ~0U to
indicate closing to the end of the range. This was chosen rather than
requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
call to kern_close_range for simplicity.

The flags argument of close_range(2) is currently unused, so any flags set
is currently EINVAL. It was added to the interface in Linux so that future
flags could be added for, e.g., "halt on first error" and things of this
nature.

This patch is based on a syscall of the same design that is expected to be
merged into Linux.

Reviewed by: kib, markj, vangyzen (all slightly earlier revisions)
Differential Revision: https://reviews.freebsd.org/D21627

show more ...


# 416ba5c7 22-Jun-2015 Navdeep Parhar <np@FreeBSD.org>

Catch up with HEAD (r280229-r284686).


# 98e0ffae 27-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Merge sync of head


# 7757a1b4 03-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# de7df74b 01-May-2015 Glen Barber <gjb@FreeBSD.org>

MFH: r281855-r282312

Sponsored by: The FreeBSD Foundation


# 3cedbec3 27-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifo
and tools/regression/file into the FreeBSD test suite as tests/sys/file

MFC after: 1 week


# 416ba5c7 22-Jun-2015 Navdeep Parhar <np@FreeBSD.org>

Catch up with HEAD (r280229-r284686).


# 98e0ffae 27-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Merge sync of head


12