Commit Graph
357 Commits
Author SHA1 Message Date
Stephen Toub d45ff6b386 Fix FileSystem, Pipes, and MemoryMappedFiles bugs on OSX
Most of our testing until now has been on Linux.  This PR represents a pass through the tests on OSX and provides fixes to get the System.IO.FileSystem, System.IO.Pipes, and System.IO.MemoryMappedFiles tests passing at 100%.  Most of these fixes are product fixes, with just a few test fixes.

Primary src fixes:
- Lots of named values (errors, open flags, sysconf names, etc.) have different values across Linux and OSX: I've fixed those to be specific to the platform being compiled for. (In the future, we should consider introducing a native shim layer through which we make _all_ calls to Unix and have it surface a consistent view, so that we don't have to worry about this kind of issue.)
- Some functions or options to functions being used on Linux don't exist on OSX, e.g. madvise's DONTFORK, posix_fadvise, etc.; these have either been removed if not truly needed or moved behind the PAL layer to only be used on Linux.
- Some functions (e.g.  shm_open) have different behavior from Linux.  For example, shm_open doesn't appear to work well with shared memory objects, such as not allowing MAP_PRIVATE and not supporting PROT_EXEC (though the OSX man pages don't mention this).  In such cases, I've implemented a fallback, e.g. on OSX we use a temporary file rather than a shared memory object.
- Some functions have subtle differences around edge cases, e.g. mmap on Linux appears to allow the creation of a map with length that goes beyond that of the underlying medium, but then fails when trying to use it, whereas OSX moves the failure to the mmap call itself.  I've implemented workarounds to smooth over these differences.
- Various error conditions were resulting in the wrong exception type based on different exception codes being returned on OSX than on Linux, e.g. additional error codes needed to be mapped to IOException when rmdir fails.
- Replaced direct usage of getenv through P/Invoke with calls to Environment.GetEnvironmentVariable. (These are a holdover from when we didn't yet have GetEnvironmentVariable available.)
- Fixed up a few places we could be using CheckIo but instead had effectively written out its implementation manually.

Primary test fixes:
- Some of the file system tests are just plain buggy, regardless of platform, with timing issues that are more likely to show up on a debug runtime.  I've fixed the ones that manifested while I was doing this testing, but the file system tests really deserved to be overhauled in general.
- Windows' implementation of File/DirectoryInfo returns default values for CreationTime when created for a file that doesn't exist; this appears to be purely for back compat with previously buggy behavior, so I changed the test to only verify this on Windows, rather than implement similar buggy behavior on Linux/OSX.
- A few test cases that were previously exempted for Linux also needed to be exempted for OSX.
- Re-enabled the System.Dynamic.Runtime.Tests now that the associated runtime error that was causing them to fail has been fixed.


Commit migrated from https://github.com/dotnet/corefx/commit/5a912670b442f7f7984b6d7f0be190213f726fd4
2015-04-21 12:02:02 -04:00
Eric StJohn c0e430ddf5 Update to latest CoreFx packages, convert to project.json
This change updates all projects to the latest CoreFx packages which make use of nuget v3 features and thus require project.json.  Packages.config remains for the packages which are not yet compatible with the new build task (mainly because we need to resolve to PCL folders).
The entire change was done by a tool in order to not miss any dependencies, and ensure we have project items for the packages.config/project.json.  One side effect of using the tool is some reformatting of whitespace in the projects.


Commit migrated from https://github.com/dotnet/corefx/commit/e729c5353070b71aedff8f1300ae838573813faf
2015-04-15 12:47:43 -07:00
Stephen Toub d153afc3fa Implement SecureString on Unix (w/o encryption)
This commit provides a basic implementation of SecureString that will run on Unix and that will provide the expected inputs/outputs for consumers, but that doesn't do any encryption.  If/when we figure out the right way to do that, we can add it later.   For now, the implementation still stores the data in a native heap (so that the GC doesn't move it around leaving copies behind), zeroes out the data when done with it, uses mlock to attempt to keep the pages from getting swapped out, and uses mprotect to cause seg faults when attempting to access the data while at rest.


Commit migrated from https://github.com/dotnet/corefx/commit/2ba8de9b215b835463a8c402996e54044be6f650
2015-04-13 16:14:03 -04:00
Matt Mitchell 0c12677de8 Merge pull request dotnet/corefx#1371 from Maxwe11/fix-unsupported-platform-tests
Fix test projects that should be ignored on linux

Commit migrated from https://github.com/dotnet/corefx/commit/74fecd6ae1fa3309a51d61d93d00a5018ba76046
2015-04-10 09:46:50 -07:00
Maxwe11 8712387f37 Fix test projects that should be ignored on linux
PR dotnet/corefx#1312 changes msbuild property UnsupportedOperatingSystems -> UnsupportedPlatforms so project files also should be updated.


Commit migrated from https://github.com/dotnet/corefx/commit/efa0ec0c8dfa3f9d017d0cd75745848f276b2e29
2015-04-10 15:38:41 +03:00
Alexander Köplinger 91e0b7014b Fix filename casing in System.Security.SecureString csproj
The path on disk has a different casing, updated csproj to match.


Commit migrated from https://github.com/dotnet/corefx/commit/b1dc1477d9e59ea6bdd85b104914194bf9adc83e
2015-04-10 14:09:19 +02:00
dotnet-bot 45f4ce08b1 Add System.Security.SecureString library
Initial commit for System.Security.SecureString src and tests.
SecureString provides a mechanism to represent a text that should be kept confidential.
The text is encrypted for privacy when used, and is deleted from the computer memory
when no longer needed.


Commit migrated from https://github.com/dotnet/corefx/commit/aaaa4da5a51eaacdfd8897c490f3f843149010e5
2015-04-09 12:31:52 -07:00