History log of /haiku/src/system/kernel/fs/fifo.cpp (Results 1 – 25 of 44)
Revision Date Author Comments
# e4a557f3 18-Oct-2024 Jérôme Duval <jerome.duval@gmail.com>

kernel/fifo: honor O_NONBLOCK on open() for FIFOs

according to POSIX:
- O_NONBLOCK set:
* read-only open() shall return asap
* write-only open() shall return an error if no reader.
- O_NONBLOCK cl

kernel/fifo: honor O_NONBLOCK on open() for FIFOs

according to POSIX:
- O_NONBLOCK set:
* read-only open() shall return asap
* write-only open() shall return an error if no reader.
- O_NONBLOCK clear:
* read-only open() shall block until a writer opens.
* write-only open() shall block until a reader opens.

for FIFOs used for pipes, open with O_NONBLOCK then reset O_NONBLOCK.

can be tested with:
bash -norc -c '/bin/printf "test" > >(/bin/tee -a trace.log) 2>&1'

Change-Id: I3cb70810fec50f643b5e6e84dbdeb0a16961936a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8469
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 45383846 28-May-2024 Augustin Cavalier <waddlesplash@gmail.com>

kernel/fs: Translate ioctl(FIONBIO) into fcntl(F_SETFL).

This way, FIONBIO and O_NONBLOCK will no longer get out of sync,
and additionally, FIONBIO can be used to change non-blocking
status of regul

kernel/fs: Translate ioctl(FIONBIO) into fcntl(F_SETFL).

This way, FIONBIO and O_NONBLOCK will no longer get out of sync,
and additionally, FIONBIO can be used to change non-blocking
status of regular (non-socket) FDs, too (which some applications
seem to take advantage of, to avoid needing to fetch the open_mode
before calling fcntl.)

Change-Id: Id894fe76c79ac373c0121a003d68180a3d9b6560
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7697
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 30d2a5e1 05-May-2023 Jérôme Duval <jerome.duval@gmail.com>

kernel/fifo: just send a disconnect for readers without writers.

just send an error for writers without readers

Change-Id: I4808e5dec29c840b72423a1bb10cb8f0ebc23bb5
Reviewed-on: https://review.haik

kernel/fifo: just send a disconnect for readers without writers.

just send an error for writers without readers

Change-Id: I4808e5dec29c840b72423a1bb10cb8f0ebc23bb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6419
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 702e7b01 06-May-2023 Jérôme Duval <jerome.duval@gmail.com>

kernel/fifo: fix commands like "tail -f file | grep"

'tail' selects read events on its write-only file descriptors,
so let's use B_SELECT_READ only for read-write file descriptors.

Change-Id: I5bb3

kernel/fifo: fix commands like "tail -f file | grep"

'tail' selects read events on its write-only file descriptors,
so let's use B_SELECT_READ only for read-write file descriptors.

Change-Id: I5bb3837f82a7b06ec367fe871c15d67beb2d412c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6417
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 97f11716 04-Sep-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Merge remote-tracking branch 'origin/master' into dev/netservices

Change-Id: I588c4a840523995f820161d63741c137bc5c719c


# 06b68f46 06-Jul-2022 Augustin Cavalier <waddlesplash@gmail.com>

kernel/fifo: Add missing check for B_SELECT_READ in Deselect().

This should have been part of 27fda3e46f1422503a08a3d34e4618778b2dc146.
Fixes #17826.


# 27fda3e4 30-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

kernel/fifo: Properly support opening FIFOs in O_RDWR mode.

While pipe() only supports a read end and a write end, named FIFOs
are supposed to allow opening in read/write mode (which, indeed,
is som

kernel/fifo: Properly support opening FIFOs in O_RDWR mode.

While pipe() only supports a read end and a write end, named FIFOs
are supposed to allow opening in read/write mode (which, indeed,
is something the Fish shell seems to require.)

The code that checks open_mode in the read/write routines was introduced
all the way back in 2003 (2469f26dfc618dac7853c0de146df7872e60623f).
At that time, the VFS did not do open_mode checks on FDs in the
I/O syscalls, so these doubled as permissions checks. Now, however,
the VFS does check that in common_user_io, so we can remove these
entirely and let things behave as they should.

Additionally, there is now also no reason to prevent select()ing
on both events for the same FD independent of open_mode, so
allow that too.

Change-Id: Ib3cba76d18e91b7c00d1695e8d29dd47cae06b79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5427
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 177a8012 20-Jun-2022 Jérôme Duval <jerome.duval@gmail.com>

kernel: fix trace build for fd.cpp and fifo.cpp

Change-Id: I12b2e85926ae63eaba5c077343cdaa2362cf8af1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5391
Reviewed-by: waddlesplash <waddlesplash@g

kernel: fix trace build for fd.cpp and fifo.cpp

Change-Id: I12b2e85926ae63eaba5c077343cdaa2362cf8af1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5391
Reviewed-by: waddlesplash <waddlesplash@gmail.com>

show more ...


# 2a849a64 04-Nov-2020 Jérôme Duval <jerome.duval@gmail.com>

fifo: fsync() returns EINVAL

fix #15288

Change-Id: Ic86bcec662c81cb04b743ec077cc8a2f3941f96e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3379
Reviewed-by: Adrien Destugues <pulkomandy@gmail.

fifo: fsync() returns EINVAL

fix #15288

Change-Id: Ic86bcec662c81cb04b743ec077cc8a2f3941f96e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3379
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

show more ...


# 2a081b42 03-Aug-2017 Philippe Houdoin <philippe.houdoin@gmail.com>

fifo: revert broken fix


# 65abebfa 03-Aug-2017 Philippe Houdoin <philippe.houdoin@gmail.com>

fifo: wakeup readers not checking POLLHUP/B_SELECT_DISCONNECTED
For readers waiting in select() or simply in read(),
B_SELECT_DISCONNECTED notification didn't wake them anymore.
Now, cascade notifica

fifo: wakeup readers not checking POLLHUP/B_SELECT_DISCONNECTED
For readers waiting in select() or simply in read(),
B_SELECT_DISCONNECTED notification didn't wake them anymore.
Now, cascade notifications to be sure to wake them, either
on POLLHUP, POOLERR/B_SELECT_ERROR or, at worst, from read().

See #7859 for details.

show more ...


# 216574f3 26-Jul-2017 Philippe Houdoin <philippe.houdoin@gmail.com>

fifo: fix #7859


# 6235b496 12-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

More useless inclusions of khash.h


# d0f2d828 17-Jan-2014 Pawel Dziepak <pdziepak@quarnos.org>

Merge branch 'scheduler'

Conflicts:
build/jam/packages/Haiku
headers/os/kernel/OS.h
headers/os/opengl/GLRenderer.h
headers/private/shared/cpu_type.h
src/add-ons/kernel/drivers/power/acpi_batter

Merge branch 'scheduler'

Conflicts:
build/jam/packages/Haiku
headers/os/kernel/OS.h
headers/os/opengl/GLRenderer.h
headers/private/shared/cpu_type.h
src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h
src/bin/sysinfo.cpp
src/bin/top.c
src/system/kernel/arch/x86/arch_system_info.cpp
src/system/kernel/port.cpp

show more ...


# f170a888 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

FIFO: Handle user reads/writes more correctly

* Determine whether called from userland or kernel.
* Check the buffer address via IS_USER_ADDRESS(), if from userland.
* Simplify things by merging Use

FIFO: Handle user reads/writes more correctly

* Determine whether called from userland or kernel.
* Check the buffer address via IS_USER_ADDRESS(), if from userland.
* Simplify things by merging UserRead() with Read() and
UserWrite() with Write().

show more ...


# 8019fdba 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

FIFO: Implement FION{BIO,READ}, B_SET_[NON]BLOCKING_IO ioctls


# fd0bfd55 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

FIFO: More correct locking when accessing file_cookie::open_mode


# 38b150a9 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

VFS FIFO: Add "fifo" KDL command

Prints information about a FIFO node and, optionally, its data buffer
content.


# fb52b1f8 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

VFS FIFO: Enlarge FIFO buffer sizes

* Increase FIFO buffer capacity from 32 to 64 KiB and the FIFO atomic
write size ({BUF_SIZE}) from 512 bytes to 4 KiB (both like Linux).
* Fix *pathconf(..., _P

VFS FIFO: Enlarge FIFO buffer sizes

* Increase FIFO buffer capacity from 32 to 64 KiB and the FIFO atomic
write size ({BUF_SIZE}) from 512 bytes to 4 KiB (both like Linux).
* Fix *pathconf(..., _PC_PIPE_BUF). It was returning 4 KiB although the
implemented atomic write size was 512 bytes only. Now both *pathconf()
and the FIFO implementation refer to the same constant.

show more ...


# 334ae3c7 25-Nov-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

VFS FIFO: Fix RingBuffer::Read()/Write() return types

size_t -> ssize_t, since they may actually return an error code.


# c8dd9f77 30-Oct-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Add thread_unblock() and use it where possible


# 24df6592 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. S

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Sever

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


# ad47c011 18-Oct-2010 Rene Gollent <anevilyak@gmail.com>

More fixes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39009 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dac5d7fe 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Made sure that at least the common case with a single writer exits write()
once the file descriptor is closed.
* Reinstantiated the FIFO functionality as long there are no writers yet as
explai

* Made sure that at least the common case with a single writer exits write()
once the file descriptor is closed.
* Reinstantiated the FIFO functionality as long there are no writers yet as
explained by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37883 a95241bf-73f2-0310-859d-f6bbb57e9c96

show more ...


12