-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0] Fallback to read/write if pread/pwrite fails #60280
Conversation
…/pwrite for unseekable files * Fallback to read/write only for known error ENXIO
…esAndSockets.cs Use Lazy for thread-safety Co-authored-by: Adam Sitnik <[email protected]>
Tagging subscribers to this area: @dotnet/area-system-io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sending to tactics for consideration.
Tactics approved for 6.0 GA |
Backport of #59846 to release/6.0.
Fixes #59754
Customer Impact
On Unix, Read/Write to certain special devices e.g:
/dev/tty
using FIleStream stopped working on 6.0 given that we now use a different syscall for unseekable files.Our assumption was that such files always reported
CanSeek
as false, but that turned out to not be true for/dev/tty
on macOS.This change catches the aforementioned error and fallbacks to the syscall that we previously used for seekable and non-seekable files.
Testing
Tested with many other devices that share similarities with
/dev/tty
:e.g:
/dev/null
,/dev/zero
,/dev/console
, named pipes and socket pairs.Risk
Low, we are affecting one edge case only which currently is in a regression state.