Skip to content

Return ESPIPE for pread/pwrite on non-seekable files#818

Open
CvvT wants to merge 1 commit intomainfrom
weiteng/handle_espipe
Open

Return ESPIPE for pread/pwrite on non-seekable files#818
CvvT wants to merge 1 commit intomainfrom
weiteng/handle_espipe

Conversation

@CvvT
Copy link
Copy Markdown
Contributor

@CvvT CvvT commented Apr 28, 2026

pread64/pwrite64 must fail with -ESPIPE when the file descriptor refers to a pipe, socket, FIFO, or any other non-seekable object.

@github-actions
Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@CvvT CvvT changed the title Return ESPIPE for pread/pwrite for non-seekable files Return ESPIPE for pread/pwrite on non-seekable files Apr 28, 2026
@CvvT CvvT marked this pull request as ready for review April 28, 2026 18:58
Copy link
Copy Markdown
Member

@jaybosamiya-ms jaybosamiya-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Weiteng, just a minor nit on naming

}
}

fn reject_offset_for_non_seekable(offset: Option<usize>) -> Result<(), Errno> {
Copy link
Copy Markdown
Member

@jaybosamiya-ms jaybosamiya-ms Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this name does not imply it'll return with ESPIPE so may end up confusing if some other offset stuff shows up later; maybe consider espipe_for_non_seekable_offset?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants