On Unix, we implement FileShare in FileStream with flock. On some file systems, flock returns EACCES, which causes us to fail to allow usage of FileStream at all. This commit changes the code to only handle the one error we actually care about, EWOULDBLOCK, which indicates that the operation would block and hence that sharing failed. All other errors can be ignored, as this is only advisory / best-effort.
Commit migrated from https://github.com/dotnet/corefx/commit/9d6289e370a21f1add2072a7652973246f59b812
And remove imports.
Now that we have netstandard packages that support all targets we should
use them. This means we don't need imports.
I opted to use the stable packages rather than the LKG ones since this
will reduce churn in the product assemblies.
This has the added benefit of reducing download time for the repo.
Commit migrated from https://github.com/dotnet/corefx/commit/a330f3651c999b241d55ca25d9baa7fb0f247c5c
* Added a private method on FileStream class that would call Interlocked.CompareExchange instead of being called from FileStreamCompletionSource because a MarshallByRefObj is being passed as a ref parameter
* Added comments to CompareExchangeCurrentOverlappedOwner method
Commit migrated from https://github.com/dotnet/corefx/commit/d2a205f74f331abf4706798f56dc3fff97a3d66b
This breaks out the nested FileStream in preparation for
moving the code down to corlib.
Will follow up with:
1. Rename of files (from Unix/Win32FS to FS.os.cs)
2. Moving of common code to FileStream.cs
3. Copy to corlib
4. Move ref to System.Runtime and type forward to corlib
5. Further prep work for bringing up UAP 10.1
Commit migrated from https://github.com/dotnet/corefx/commit/e3fc18c58396737ee5e6bc80acf508031d63cc8e
Following our new guidelines for ref assembly implementations and what GenApi now creates, this updates all of our ref .cs files to use "throw null;" for member bodies that can't just be empty (i.e. members that need to return a value either via the return type or via an out parameter). I made the change programatically using a simple Roslyn-based tool.
Commit migrated from https://github.com/dotnet/corefx/commit/a9fdc79ff8feb5ad46e9fcbe18fdffcd0bd74679
- Expose: Timer members, some exception types and members, ThreadExceptionEventArgs/Handler, Monitor.Wait with exitContext parameter
- Move CriticalHandle and remaining types from System.Runtime.Handles to System.Runtime, expose CriticalHandle[ZeroOr]MinusOneIsInvalid
- Revert base class of safe handle types that used to derive from SafeHandle[ZeroOr]MinusOneIsInvalid, and upgrade those projects to ns1.7
Commit migrated from https://github.com/dotnet/corefx/commit/de8eee4b26f5154698fddcd150a4c7487a69da64
* Add new ValueList<T> type, delete LowLevelList
* Rename Extract* -> As
* Rename to ArrayBuilder
* Clarify assert
* Fix comments
* Some refinement
* Tiny refinement for ZeroExtend
* Bugfix for ToArray
* Add XML docs to ArrayBuilder
* Perf bug: Check _count == 0, not _array == null, in ToArray
* Add comprehensive tests for ArrayBuilder
* Refactor System.Linq.Expressions to use the new ArrayBuilder
* Respond to PR feedbck no. 1
* Include the file in some assemblies that are using it indirectly thru EnumerableHelpers
* Remove AddRange and ZeroExtend for now
* Remove GetEnumerator
* Remove *InDebug methods
* Change resizing pattern back to that of List's
* Some nits in the tests
* Remove _count == 0 optimization from EnsureCapacity
* Handle arrays that go past 1B elements
* Fix compile and test errors
* Better seed generation
* Remove comment on Array.Resize
Commit migrated from https://github.com/dotnet/corefx/commit/9eaf364b8ca8180bace20aab188b1efe6a55835f
The previous commit added usage of StreamHelpers.cs. The dependency is only on some validation routines, but the same file also includes usage of ArrayPool, and thus the build breaks without a dependency on System.Buffers. Since we don't currently have another need for System.Buffers in System.IO (this could change in the future), for now I'm splitting the StreamHelpers.cs file into two files, one that needs ArrayPool, and one that doesn't, so that System.IO can include only the latter.
Commit migrated from https://github.com/dotnet/corefx/commit/eb211927ca0fe0196f992caeedb5260bcb1e15d6