-
Notifications
You must be signed in to change notification settings - Fork 5.3k
File system type fix #69484
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
File system type fix #69484
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-io Issue Detailsfixes #61175 context: #61175 (comment)
|
Would it be better to change the |
In a long term yes. Here I wanted to make the change as small as possible to make it easier to review when backporting to 6.0. |
danmoseley
left a comment
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.
Seems reasonable.
|
Should the type of UnixFileSystemTypes be uint? Would catch if we try to add larger values. |
92d05e5 to
d5d9cb9
Compare
d5d9cb9 to
cb3017e
Compare
…y the new asserts)
| // which got deprecated in macOS 10.6, in favor of statfs | ||
| while ((statfsRes = fstatfs(ToFileDescriptor(fd), &statfsArgs)) == -1 && errno == EINTR) ; | ||
| return statfsRes == -1 ? (int64_t)-1 : (int64_t)statfsArgs.f_type; | ||
| return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes #61175 |
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.
| return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes #61175 | |
| return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes https://github.com/dotnet/runtime/issues/61175 |
src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
fixes #61175
context: #61175 (comment)
the fix is relatively safe as the maximum know value that we support:
runtime/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs
Line 38 in 4822e3c
can be represented using 32 bit value