mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-12-04 16:40:32 +00:00
macOS pwrite and pwritev write at the given offset even under O_APPEND, so an append-mode positioned write appends with writev and seeks back. Nothing covered that sequence, so a concurrent seek, read or write on the same description could see the end-of-file offset or have its own change undone. The write and seek back now hold the descriptor's positioned-transfer lock, shared with its duplicates as on Windows, and read, write, readv, writev and lseek take it while the descriptor is in append mode.
971 B
971 B
libkernel
change [sceKernelPwrite, pwrite, sceKernelPwritev, pwritev]
- sceKernelPwrite, pwrite, sceKernelPwritev, pwritev and the AIO write commands (libkernel) on an
O_APPENDregular file on macOS append withwritevand seek back to the previous offset, because macOSpwriteandpwritevwrite at the given offset even underO_APPEND(measured on macOS 27.2.1), where FreeBSD appends and leaves the offset unchanged. The write and the seek back hold the descriptor's positioned-transfer lock, shared with its duplicates, which libkernel'sread,write,readv,writevandlseekalso take while the descriptor is in append mode. Offset changes made without that lock can still interleave: a libc stream that macOS hands to its BSD stdio, another process sharing the description, and a call already running whenfcntlturnsO_APPENDon