History log of /openbsd-src/sys/kern/sys_pipe.c (Results 1 – 25 of 148)
Revision Date Author Comments
# b9ae17a0 30-Dec-2024 guenther <guenther@openbsd.org>

All the device and file type ioctl routines just ignore FIONBIO,
so stop calling down into those layer from fcntl(F_SETFL) or
ioctl(FIONBIO) and delete the "do nothing for this" stubs in all
the *ioc

All the device and file type ioctl routines just ignore FIONBIO,
so stop calling down into those layer from fcntl(F_SETFL) or
ioctl(FIONBIO) and delete the "do nothing for this" stubs in all
the *ioctl routines.

ok dlg@

show more ...


# 2fbfb15d 27-Oct-2024 mpi <mpi@openbsd.org>

Remove KERNEL_LOCK() dance around km_alloc(9) & km_free(9).

Allocating VAs is done via uvm_map(9) which is safe to call without
KERNEL_LOCK() since mmap(2) & friends have been marked NOLOCK.

ok mvs@


# d1d5acb9 09-May-2023 visa <visa@openbsd.org>

Don't return EPIPE from pipe kqfilter

Proceed with the registration of an EVFILT_WRITE filter even if the
pipe's other end has been closed, instead of failing with error EPIPE.
The filter will trigg

Don't return EPIPE from pipe kqfilter

Proceed with the registration of an EVFILT_WRITE filter even if the
pipe's other end has been closed, instead of failing with error EPIPE.
The filter will trigger immediately. This reduces the possible outcomes
when a kevent(2) call and a close(2) call race on the different ends
of a pipe.

This fixes a failure of lang/ghc unit test as reported by gnezdo@.

OK gnezdo@ mpi@

show more ...


# ebede8ab 12-Feb-2023 mvs <mvs@openbsd.org>

Rename pipeselwakeup() to pipe_wakeup(). It doesn't call selwakeup()
anymore, so do it to be consistent with similar *wakeup() functions.

No functional changes.

ok visa@


# c78098b6 10-Feb-2023 visa <visa@openbsd.org>

Adjust knote(9) API

Make knote(9) lock the knote list internally, and add knote_locked(9)
for the typical situation where the list is already locked.

Remove the KNOTE(9) macro to simplify the API.

Adjust knote(9) API

Make knote(9) lock the knote list internally, and add knote_locked(9)
for the typical situation where the list is already locked.

Remove the KNOTE(9) macro to simplify the API.

Manual page OK jmc@
OK mpi@ mvs@

show more ...


# 2b46a8cb 05-Dec-2022 deraadt <deraadt@openbsd.org>

zap a pile of dangling tabs


# 0d280c5f 14-Aug-2022 jsg <jsg@openbsd.org>

remove unneeded includes in sys/kern
ok mpi@ miod@


# a820167a 09-Jul-2022 visa <visa@openbsd.org>

Unwrap klist from struct selinfo as this code no longer uses selwakeup().

OK jsg@


# d3f5ce76 20-Jun-2022 visa <visa@openbsd.org>

Remove unused struct fileops field fo_poll and callbacks.

OK mpi@


# 538638a5 30-May-2022 visa <visa@openbsd.org>

Replace selwakeup() with KNOTE() in pipe event activation.

Recommit the reverted change selectively so that only pipes are
affected. Leave sockets untouched for now.


# 0d7a239e 09-May-2022 visa <visa@openbsd.org>

Revert "Replace selwakeup() with KNOTE() in pipe and socket event activation."

The commit caused hangs with NFS.

Reported by ajacoutot@ and naddy@


# 06c3e122 06-May-2022 visa <visa@openbsd.org>

Replace selwakeup() with KNOTE() in pipe and socket event activation.

OK mpi@


# f093adcc 13-Feb-2022 visa <visa@openbsd.org>

Use knote_modify() and knote_process() in obvious places.


# a3a2b40e 13-Feb-2022 visa <visa@openbsd.org>

Rename knote_modify() to knote_assign()

This avoids verb overlap with f_modify.


# 3437c2ff 12-Feb-2022 visa <visa@openbsd.org>

Reduce code duplication in pipe event filters

Use the f_event callback for checking event state within the pipe
event filters. This enables the same f_modify and f_process functions
to handle the di

Reduce code duplication in pipe event filters

Use the f_event callback for checking event state within the pipe
event filters. This enables the same f_modify and f_process functions
to handle the different filter types.

OK anton@

show more ...


# 87c93f01 13-Dec-2021 visa <visa@openbsd.org>

Revise EVFILT_EXCEPT filters

Restrict the circumstances where EVFILT_EXCEPT filters trigger:
* when out-of-band data is present and NOTE_OOB is requested.
* when the channel is fully closed and cons

Revise EVFILT_EXCEPT filters

Restrict the circumstances where EVFILT_EXCEPT filters trigger:
* when out-of-band data is present and NOTE_OOB is requested.
* when the channel is fully closed and consumer is poll(2).

This should clarify the logic and suppress events that kqueue-based
poll(2) does not except.

OK mpi@

show more ...


# 468dccc2 13-Dec-2021 visa <visa@openbsd.org>

Prevent kevent(2) use of EVFILT_EXCEPT with FIFOs and pipes

Currently, the only intended direct usage of the EVFILT_EXCEPT filter
is with NOTE_OOB to detect out-of-band data in ptys and sockets.
NOT

Prevent kevent(2) use of EVFILT_EXCEPT with FIFOs and pipes

Currently, the only intended direct usage of the EVFILT_EXCEPT filter
is with NOTE_OOB to detect out-of-band data in ptys and sockets.
NOTE_OOB does not apply to FIFOs or pipes. Prevent the user from
registering the filter with these file types. The filter code is for
the kernel's internal use.

OK mpi@

show more ...


# 8013d39c 08-Dec-2021 visa <visa@openbsd.org>

Fix select(2) exceptfds handling of FIFOs and pipes

Prevent select(2) from indicating an exceptional condition when the
other end of a FIFO or pipe is closed.

Originally, select(2) returned an exce

Fix select(2) exceptfds handling of FIFOs and pipes

Prevent select(2) from indicating an exceptional condition when the
other end of a FIFO or pipe is closed.

Originally, select(2) returned an exceptfds event only with a pty or
socket that has out-of-band data pending. millert@ says that OpenBSD
diverged from this by accident when poll(2) and select(2) were changed
to use the same backend code in year 2003.

OK millert@

show more ...


# 029b91ee 07-Dec-2021 visa <visa@openbsd.org>

Add EVFILT_EXCEPT filter for pipes

The kqueue-based select(2) needs the filter to replicate the old
exceptfds behaviour. The upcoming new poll(2) code will use the filter
for POLLHUP condition check

Add EVFILT_EXCEPT filter for pipes

The kqueue-based select(2) needs the filter to replicate the old
exceptfds behaviour. The upcoming new poll(2) code will use the filter
for POLLHUP condition checking when the events bitmap is clear of
read/write events.

OK anton@

show more ...


# 679e679b 24-Oct-2021 visa <visa@openbsd.org>

Make pipe event filters MP-safe

Add the missing f_modify and f_process callbacks so that pipe_lock
serializes pipe knote handling. As pipe klist locking is already in
place, pipe event filters shoul

Make pipe event filters MP-safe

Add the missing f_modify and f_process callbacks so that pipe_lock
serializes pipe knote handling. As pipe klist locking is already in
place, pipe event filters should now be MP-safe.

This uses write locking everywhere in the callbacks for simplicity.
There is not much multiple-readers parallelism to utilize.

OK mpi@ anton@

show more ...


# 24e21954 22-Oct-2021 mpi <mpi@openbsd.org>

Revert "Preserve select(2) semantics when the other end of the pipe is gone".

The logic to emulate the current poll/select behavior is better implemented
at the syscall layer and not in the kqueue b

Revert "Preserve select(2) semantics when the other end of the pipe is gone".

The logic to emulate the current poll/select behavior is better implemented
at the syscall layer and not in the kqueue backend.

Discussed with deraadt@, ok anton@

show more ...


# 7c9ec633 22-Oct-2021 anton <anton@openbsd.org>

Preserve pipe select(2) semantics when the other end of the pipe is gone.
In preparation for implementing select(2) on top of kqueue.

ok mpi@


# 8b4cfeca 30-Dec-2020 visa <visa@openbsd.org>

Set klist lock for pipes.

OK anton@, mpi@


# 9b0cf67b 25-Dec-2020 visa <visa@openbsd.org>

Refactor klist insertion and removal

Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remai

Refactor klist insertion and removal

Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.

Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.

OK mpi@

show more ...


# c47d41f6 11-Dec-2020 visa <visa@openbsd.org>

Simplify filt_pipedetach()

By storing pipe pointer in kn_hook, filt_pipedetach() does not need
extra logic to find the correct pipe instance. This also lets the kernel
clear the knote lists fully.

Simplify filt_pipedetach()

By storing pipe pointer in kn_hook, filt_pipedetach() does not need
extra logic to find the correct pipe instance. This also lets the kernel
clear the knote lists fully.

OK anton@, mpi@

show more ...


123456