Age | Commit message (Collapse) | Author |
|
* [Mono.Posix] Add support for memfd_create() and file sealing
Add the linux syscall memfd_create() and add support for file sealing with
fcntl().
* Bump API snapshot submodule
|
|
* [Mono.Posix] Move Mono_Posix_{From,To}MremapFlags() to support/sys-mman.c
Since b522eab5ff5466debaacf9e971e26cfc464ebba5 Mono_Posix_FromMremapFlags()
and Mono_Posix_ToMremapFlags() contain manual changes for NetBSD. Move the
functions from support/map.c to support/sys-mman.c so that they won't be
overwritten when create-native-map is rerun.
* [Mono.Posix] Fix prototypes in support/stdio.c
In ed892ccf27849c082ce6ca46fa8b96d86ca7c329 wrapper functions for several
stdio functions were added, but the prototypes in map.h were manually
written, not using create-native-map. This commit changes the prototypes so
that they match the output of create-native-map.
* [Mono.Posix] Undefine HAVE_STRUCT_SOCKADDR_IN6 in support/map.c on MSVC
In 22b6b9581418260397b701c17b16c3eb55136de7 a manual change to support/map.c
was added to prevent Mono_Posix_FromSockaddrIn6() and
Mono_Posix_ToSockaddrIn6() from being built for windows even if
HAVE_STRUCT_SOCKADDR_IN6 is defined. Instead undefine it in a header file
to avoid manual changes to map.c.
With this commit map.c, map.h and NativeConvert.generated.cs contain no
manual changes anymore.
|
|
Add F_OFD_GETLK, F_OFD_SETLK and F_OFD_SETLKW to FcntlCommand. These
commmands are similar to F_GETLK, F_SETLK and F_SETLKW but operate on a
per-open-file-description lock instead of a per-process lock and avoid the
problem that the locks are released when close(dup(fd)) is called. See
https://lwn.net/Articles/586904/ for more information.
This commit also reruns create-native-map but keeps manual changes from
ed892ccf27849c082ce6ca46fa8b96d86ca7c329,
b522eab5ff5466debaacf9e971e26cfc464ebba5 and
22b6b9581418260397b701c17b16c3eb55136de7.
In [create-native-map.diff.txt](https://github.com/mono/mono/files/3557077/create-native-map.diff.txt) you can see the difference between the commited `map.[ch]` and the one `create-native-map.exe` wants to create:
- Manually inserted changes for NetBSD (`MAYMOVE` is turned into a negated `FIXED`)
- `Mono_Posix_ToSockaddrIn6()` and friends get skipped for `HOST_WIN32` (not sure why, when `sockaddr_in6` exists then `Mono_Posix_ToSockaddrIn6()` should work)
- At the bottom of `map.h` some functions are reordered and the parameters change (`const char*` vs. `char*`)
Running create-native-map.exe also moved some O_NOATIME-related stuff (from 8b9033e4d24115190c06f775d18ef3a40cbca876) to the correct position and added it to Mono_Posix_ToOpenFlags(), which I kept in the commit.
|
|
O_NOATIME (Linux > 2.6.8): Do not update the file last access time (st_atime in the inode) when the file is read(2). Programs that merely index the existence of a file (backup programs e.g.) can reduce disk load using this flag.
|
|
(#15828)
Fixes https://github.com/mono/mono/issues/10748
The calls for chown, lchown, fchown, and fchownat (from `Mono.Unix.Native.Syscall`) are all declared with unsigned integers for the `owner` and `group` parameters. This is incorrect.
Directly from the manpage
`man 2 chown`
<pre><code>
...
int chown(const char *pathname, uid_t owner, gid_t group);
int fchown(int fd, uid_t owner, gid_t group);
int lchown(const char *pathname, uid_t owner, gid_t group);
...
int fchownat(int dirfd, const char *pathname,
uid_t owner, gid_t group, int flags);
...
...
<b>If the owner or group is specified as -1</b>, then that ID is not changed.
...
</pre></code>
Emphasis added on the documentation explaining how the parameters can take the value -1, clearly not an unsigned integer. The `uid_t` struct is not an unsigned integer. I am assuming this was just an oversite on whoever re-wrote `Mono.Unix.Native.Syscall`.
The original calls from `Mono.Posix.Syscall` (now marked as Obsolete) all correctly use signed integers.
```
[DllImport ("libc", SetLastError=true)]
public static extern int chown (string path, int owner, int group);
[DllImport ("libc", SetLastError=true)]
public static extern int lchown (string path, int owner, int group);
```
Even the documentation directly from `mcs/class/Mono.Posix/Documentation/en/Mono.Unix.Native/Syscall.xml`
```
<para>
One of the owner or group id's
may be left unchanged by specifying it as -1.
</para>
```
|
|
They can be used with native line endings.
We now have a shared folder with the dotnet repos and they have CRLF normalization enabled.
This difference leads to conflicts while applying changes from the dotnet repos to mono.
|
|
|
|
override it (#10429)
* Move the PreBuild dependency property later in the file so targets can't override it
* [csproj] Update project files
|
|
* Remove use of sln dependencies and use csproj project references instead
* Rewrite jay.vcxproj so it builds correctly even without help from the sln file
* Force pre-build event to run after references are resolved. Change how culevel.exe path is computed to be more resilient.
* [csproj] Update project files
|
|
|
|
for sources in projects so that we don't get erroneous duplicate files in cases where there are both profile and host platform criteria (#9952)
A recent commit revealed that in cases where we select based on a mix of host platform and profile, genproj csproj files can end up with duplicate sources because the existing <ItemGroup Condition= approach could make multiple groups match for a given compile when we really just want one.
This PR changes to generating a cascade of msbuild <Choose> elements, which give if-else selection to ensure that we only ever build a single set of files.
|
|
of solution dependencies (#9670)
Using solution dependencies in ```bcl.sln``` seems flaky and seems like it might not establish the full ordering we need to ensure that ```Consts.cs``` exists before we build things that require it. Let's try using project references (where ```corlib.dll``` 'depends' on ```genconsts.exe```) instead. This should also insert the dependency for any project that includes Consts.cs instead of just corlib.
This PR also makes update-solution-files actually fail if ```genconsts.exe``` fails to build because it was driving me mad.
Part of #6886
|
|
host platform (#8985)
* Update genproj makefile to include gensources
Update genproj argument parser to be more generous about displaying help
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint
* Fix rebase issue
* Checkpoint
* Checkpoint
* Fix built sources only being added to one profile
* Fix typo
* Checkpoint
* Fix indentation
* Use csc instead of mcs
* Checkpoint
* Fix BUILT_SOURCES only being handled for the first profile processed
* Checkpoint
* Checkpoint
* Strip double slashes from paths to fix spurious csproj change
* Checkpoint
* Checkpoint
* Checkpoint
* Checkpoint: Fix genproj compilation
* Checkpoint
* Checkpoint
* Checkpoint
* Fix crash when no targets were loaded (due to an error)
* Checkpoint
* Checkpoint
* Checkpoint
* Fix TryParseTargetInto bug
* Checkpoint
* Shuffle exclude logic around so that it works correctly during genproj diffing
* Remove gensources tracing
* Checkpoint
* Fix handling of oddball sources paths from executable.make
* Fix jay not being set to build
* Fix wrong slashes being used for embedded resource paths
* [csproj] Update project files
|
|
* [mcs] Rename darwin paltform to macos
Darwin is common to both macOS and iOS/tvOS/watchOS, while we use the darwin platform only for macOS.
* [mcs] Add Unix platform for other Unixes than Linux
* [mcs] Remove PLATFORMS from xammac_net_4_5 since it only make sense on macos
* [bcl] Bump corlib version
* [csproj] Update project files
|
|
|
|
This PR introduces a new tool, gensources.cs, which replaces gensources.sh. It is able to parse the whole set of .sources files for a library in one go so that genproj can use that information to encode all our platform and profile specific files into one csproj file.
For now this PR just introduces it and switches libraries to using it instead of gensources.sh.
|
|
without setting a platform (#8223)
* Default platform to net_4_x if none is specified, to fix tools that build without setting a platform
* [csproj] Update project files
|
|
* [msvc] Update csproj files
* [msvc] Delete old net_4_x.csproj and xbuild_12.csproj files
|
|
|
|
|
|
While Mono does copy the values of arrays back when they are marshaled
to unmanaged code, .NET does not seem to be doing this, and manifests
as the Syscall.poll invocation in Mono.Posix with .NET Core does not update
the values in the provided array.
The following example should print "Got 1 and 1" with the following command:
```
echo foo | dotnet run
```
But instead prints 0 and 1 on .NET Core, but the correct result with Mono.
This patch is going here for the sake of the Mono.Posix.NetCore package that
we publish.
Sample:
```
using System;
using System.Runtime.InteropServices;
class X {
private struct _pollfd {
public int fd;
public short events;
public short revents;
}
[DllImport("libc")]
static extern int poll ([In,Out]_pollfd[] ufds, uint nfds, int timeout);
static void Main ()
{
var p2 = new _pollfd [1] { new _pollfd () { fd = 0, events = 1 } };
var m = poll (p2, 1, -1);
Console.WriteLine ("Got: {0} and {1}", n, pollmap [0].revents);
Console.ReadLine ();
}
}
```
|
|
|
|
d9922895d42685f6c4022d710a1e7208da773f20 removed Mono.Unix.Native/SocketTest.cs
from the exclude list on the monodroid profile.
It turns out that some tests don't work there however,
they fail with an ArgumentOutOfRangeException on some socket options.
|
|
Just over a year ago Xamarin.Android switched to running BCL tests straight
from the Mono sources but at the time we decided we didn't want to enable
a number of "new" tests (in the sense - never previously ran on XA) to avoid
introducing new failures in time which required focusing on more important
goals.
Currently, Xamarin.Android no longer uses Mono **sources** to build its tests
but, rather, it uses test **assemblies** built by Mono. This commit restores
the previously excluded tests in preparation for full BCL test coverage in
the near future.
|
|
We need this because XA is now starting to use the test assemblies
we build in the Mono repo instead of using the .cs source directly
and this would conflict.
|
|
TestHelper was previously excluded because the XA tests weren't built
as part of Mono but rather as part of XA test suite which included
its own version of the helper. Now, however (https://github.com/xamarin/xamarin-android/commit/e9daf5ea35709ce1bc6ba81c7c37d72d385bace2),
XA uses BCL+friends test assemblies built by Mono itself and so
we need to restore TestHelper in the build.
|
|
In case StringToHeap (string, Encoding) was called with a null string, it would unconditionally reference the string when trying to query the string's length.
Bug 10074 - Error while updating status of command: MonoDevelop.Ide.Commands.ViewCommands.LayoutList
|
|
|
|
the AssemblyKeyFile attribute for consistency and to make it easier to do path name manipulation on the file name. (#5316)
|
|
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
|
|
|
|
|
|
|
|
|
|
* Remove the use of ExpectedException in Mono.Posix Tests
ExpectedException is not available in later versions of
NUnit. To test the NetCore 2.0 version of Mono.Posix I
need a newer version of NUnit that does not contain ExpectedException.
Using Assert.Throws should be equivalent.
* Mono.Posix Tests move CanUseRealTimeSignals checks
Moving the CanUseRealTimeSignals check outside of the
Assert.Throws callback function.
This is a change in test behavior requested by @akoeplinger
in the PR review.
* Fixing Mono.Posix.UnixSignalTest.TestSignumPropertyThrows
This test throws InvalidOperationException and we need to check
for that in the Assert.Throws type.
|
|
built from mono.
|
|
|
|
For timeouts of 0 milliseconds, WaitOne may produce incorrect results. In case of timeout, the result of WaitAny denotes the amount of milliseconds that have timed out. WaitOne relies on WaitAny and interprets the result falsely as the index of the completed handle. This change introduces a check on the timeout and returns `IsSet` when the handle is not allowed to block.
This is in accordance to Microsofts [documentation of WaitOne](https://msdn.microsoft.com/de-de/library/cc189983(v=vs.110).aspx) which states "If millisecondsTimeout is zero, the method does not block. It tests the state of the wait handles and returns immediately.".
[Here](https://github.com/StephenCleary/AsyncEx.Interop.WaitHandles/blob/master/src/Nito.AsyncEx.Interop.WaitHandles/WaitHandleInterop.cs#L51) is an example of some code relying on correct output of `WaitOne(0)` that is effectively broken by the current behaviour.
|
|
|
|
Also reverts the changes done to support/map.c. This is a generated file which
shouldn't be changed directly. An alternate fix for the problem in map.c on
Windows was to make sure L_SET et al are defined in mph.h which was already
done for Solaris.
|
|
|
|
|
|
Cleaned up Mono_Posix_FromSeekFlags() in support/map.c. It didn't properly
handle the case when L_INCR, L_SET, L_XTND aren't available, like on Windows.
Added Mono_Posix_Stdlib_GetLastError() to support/errno.c and changed
Stdlib.GetlastError() use it. Without this Stdlib.GetlastError() wouldn't take
errno in the C runtime used by libMonoPosixHelper.dll into account.
On Windows the Syscall class failed to initialize due to missing functions,
e.g. Mono_Posix_Syscall_get_at_fdcwd(), in libMonoPosixHelper.dll. Those
readonly static fields which were initialized at class initialization have now
been converted to static readonly properties so that the Syscall class can be
initialized despite those functions not being defined.
Cleaned up temp file handling in StdioFileStreamTest to avoid failures due to
sharing violations on Windows.
Fixed a bug in the StdioFileStreamTest.Write() test method when reading back
the batch of bytes written in the second part of the test.
Enabled the Mono.Posix test suite to run on PR builds. This test suite should
from now on be green.
|
|
Since libMonoPosixHelper.dll is linked against ucrtbase.dll the C runtime
wrapper functions in it will call into ucrtbase.dll. Some pinvokes in
Mono.Unix.Native.Stdlib, however, bind directly to C runtime functions in
msvcrt. This is problematic if a resource (heap memory, file pointer, etc) is
allocated using one C runtime and then operated upon using funcitons form the
other C runtime. E.g., Stdlib.malloc() calls into a wrapper in
libMonoPosixHelper so it will use the ucrtbase heap while Stdlib.free() calls
directly into msvcrt's free() which will abort the process since it's called
with a pointer in an unknown heap.
This commit adds libMonoPosixHelper wrappers for all memory and file related
functions in Stdlib to ensure that all such functions use the same C runtime.
Some of the Mono.Posix tests still fail but at least the test suite doesn't
crash after this change. The test failures will be addressed in a future PR.
|
|
|
|
They don't make sense there.
Added nunit group to win32.make for excluding, similar to darwin.make
|
|
NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert.
Also adds AssertHelper class with methods that are not part of nunitlite
Assert class.
|
|
Note: DISABLE_CAS_USE was removed in ed989a8e9e5c170b6d19edc60bb80e8a4e6d5cc0
|
|
Xamarin.Android internal test suite takes advantage of the BCL tests
in Mono, so far their inclusion was a manual process and this commit
fixes it. A set of source inclusion and exclusion lists is added
and a handful of code fixes to make them compile on Xamarin.Android
|
|
|