Re: Unclear documentation about IORING_OP_READ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/29/20 9:32 PM, Shuveb Hussain wrote:
> Jens,
> 
> I'm coming up the the man page for io_uring(7) and I noticed that the
> existing man page or other available documentation does not make it
> clear about offset (off in the SQE) being a mandatory parameter for
> the following operations:
> IORING_OP_READ
> IORING_OP_WRITE
> IORING_OP_READV
> IORING_OP_WRITEV
> 
> Regular UNIX developers will expect subsequent read/write operations
> on the same file descriptor to remember the file offset for files that
> continue to be open. Is this the intended behavior or is it just that
> it is not documented? If it is the latter, I'll clearly call it out in
> the documentation.

This is intended behavior, you should consider the READV to be just
like preadv2() in that it takes the offset/iov/flags, and ditto on
the write side. READ is basically what a pread2 would be, if it
existed.

That said, you can use off == -1 if IORING_FEAT_RW_CUR_POS is set
in the feature flags upon ring creation, and that'll use (and updated)
the current file offset. This works for any non-stream/pipe file
type.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux