Opened 2 months ago

Last modified 6 weeks ago

#18836 new bug

pwrite and friends on Haiku are not POSIX-compliant

Reported by: trungnt2910 Owned by: nobody
Priority: low Milestone: Unscheduled
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

pwrite calls the raw _kern_write syscall on Haiku.

For non-seekable files like consoles (stdout/stderr), this syscall ignores the pos argument and writes as normal.

However, according to POSIX:

The pread() function shall fail if:

[EINVAL] The file is a regular file or block special file, and the offset argument is negative. The file offset shall remain unchanged.

[ESPIPE] The file is incapable of seeking.

Change History (1)

comment:1 by waddlesplash, 6 weeks ago

Fixed for sockets and actual FIFOs in hrev57661. However this doesn't fix the problem for TTYs (including stdout/stderr), /dev/random, etc. because devfs publishes everything as S_IFCHR, and fixing this won't be easy, as it will require reporting more information from drivers that there is currently no way to report.

Note: See TracTickets for help on using tickets.