-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.help wanted
Milestone
Description
I'd like to propose exposing readv
/writev
(and maybe preadv
/pwritev
and maybeer preadv2
/pwritev2
) in x/sys/unix, as {Read,Write}v(fd int, iov [][]byte) (int, error)
.
My usecase is writing to a file in O_APPEND
mode, which offers atomicity-guarantees per write. Issuing multiple writes loses those guarantees, so I have to resort to a) allocating a temporary buffer and concatenating the individual []byte
s, or b) use unix.Syscall
. The latter is fine, but a wrapper would allow to avoid unsafe
.
I don't personally care about the p…
and …v2
variants, but they could be added at the same time. I'm not sure how portable they are, though, beyond Linux.
I can send a CL if this is accepted.
komuw
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.help wanted