-
Notifications
You must be signed in to change notification settings - Fork 5.3k
use fstatfs to detect whether current file system supports shared locks for files opened for writing #55256
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
Merged
Merged
use fstatfs to detect whether current file system supports shared locks for files opened for writing #55256
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
71d131a
use fstatfs to detect whether current file system supports shared loc…
adamsitnik 7980cc8
improve comments
adamsitnik 97c1544
cast in explicit way
adamsitnik 5d95af8
hopefully fix the BSD build(s)
adamsitnik d64374f
fix OSX build
adamsitnik c687e6a
assume we should not acquire the lock if we don't know the File System
adamsitnik 9c481ed
try to fix the maccatalyst build
adamsitnik 1c890ec
always use fstatfs as it's available on every platform and can get us…
adamsitnik 04eced6
handle SMB2_SUPER_MAGIC as well (#53182)
adamsitnik 79b6def
introduce a flag that allows to disable file locking on Unix
adamsitnik ba6d027
Emscripten does not support file locking, so there is no need to chec…
adamsitnik 731e65c
some polishing
adamsitnik d31f6e1
Merge remote-tracking branch 'upstream/main' into superMagic
adamsitnik c752b93
reuse the UnixFileSystemTypes enum, move it to a separate file so Cor…
adamsitnik 7443a5e
add SMB2_SUPER_MAGIC to the enum
adamsitnik 1e3878c
don't try to unlock the file if it has not been locked
adamsitnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fstatfs.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Runtime.InteropServices; | ||
| using Microsoft.Win32.SafeHandles; | ||
|
|
||
| internal static partial class Interop | ||
| { | ||
| internal static partial class Sys | ||
| { | ||
| [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")] | ||
| internal static extern long GetFileSystemType(SafeFileHandle fd); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.