Age | Commit message (Collapse) | Author |
|
* detect sys/errno.h
* Fix errenous LIBS in haiku
* use HAVE_MINCORE
|
|
These return no-ops, but its enough to make it happy
|
|
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.
|
|
* [zlib] Fix CppCheck error "Shifting a negative value is undefined behaviour"
This matches what upstream now does:
https://github.com/madler/zlib/blob/2edb94a3025d288dc251bc6cbb2c02e60fbd7438/inflate.c#L1529
* [scripts] Fix CppCheck error "Memory leak: nargv"
* [tests] Fix CppCheck error: "Memory leak: reference"
* [aot-compiler] Fix CppCheck error: "Resource leak: infile"
* [metadata] Fix CppCheck error: "Uninitialized variable: ret"
|
|
* [file] Remove dead field
* [process] Remove wapi_getpid
* [process] Remove CloseHandle
* [io-layer] Remove dead MONO_TRACE
* [io-layer] Extract error
* [io-layer] Extract wapi.h
* [io-layer] Remove the io-layer
|
|
Fix Mono.Posix tests on Windows
|
|
|
|
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.
|
|
bytes of input stream.
This didn't manifest as a bug, to to be on the safe side, replicate the behavior
introduced in https://github.com/mono/mono/commit/b4d5016b5e42fec226d93fd13260b6cac80eb384
and use the same approach when calculating the total of the read bytes of the input stream.
|
|
What was happening is that we set the stream EOF flag to true when we
could not read any more input data, and that made us early out before
fully finishing the processing of the compressed data.
Now the only EOF flag is set to true is if zlib's inflate() has actually
finished processing the data.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
|
|
This reworks the fix from https://github.com/mono/mono/commit/7c4d41a518aaf0370b882f9430752ebcd5544c10.
That fix introduced a regression when handling some inputs, which lead us to ignore
some left-over data from zlib's inflate output buffer.
Now we only break from the loop if inflate() returns Z_BUF_ERROR.
This makes sure all data is fully processed before returning to managed code.
Fixes one of the bugs in https://bugzilla.xamarin.com/show_bug.cgi?id=44994#c2.
|
|
|
|
The NetBSD version of mremap takes additional argument "newp" to hint
new position of a mapped range.
void *
mremap(void *oldp, size_t oldsize, void *newp, size_t newsize,
int flags);
-- NetBSD's mremap(2)
While Linux by default sets old_address and fails if the resize
operation cannot be finished for the original address.
void *mremap(void *old_address, size_t old_size,
size_t new_size, int flags, ... /* void *new_address */);
-- Linux's mremap(2)
NetBSD offers inversed logic with the MAP_FIXED flag to Linux's MREMAP_MAYMOVE:
MAP_FIXED newp is tried and mremap() fails if that address can't
be used as new base address for the range. Otherwise,
oldp and newp are used as hints for the position,
factoring in the given alignment.
-- NetBSD's mremap(2)
MREMAP_MAYMOVE
By default, if there is not sufficient space to expand a mapping
at its current location, then mremap() fails. If this flag is
specified, then the kernel is permitted to relocate the
mapping to a new virtual address, if necessary. If the mapping
is relocated, then absolute pointers into the old mapping
location become invalid (offsets relative to the starting address
of the mapping should be employed).
-- Linux's mremap(2)
The thing that bothers is calling mremap(2) syntax from Linux "posix", but we
cannot do anything with it, for now just simulate the Linux behavior on NetBSD.
|
|
|
|
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
|
|
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
|
|
Keep track of total bytes read from input stream and break from the loop if it matches the number of bytes inflated by zlib.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34916.
|
|
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
|
|
Add wrappers for struct cmsghdr, the macros for manipulating control
messages (CMSG_*) and recvmsg() and sendmsg().
|
|
It's a Linux-specific extension and not available on OSX or Linux <2.6.28
|
|
[Mono.Posix] Add wrappers for struct sockaddr_*
|
|
Add wrappers for the sockaddr_* structures and add the syscalls using these
structures (bind(), accept(), ...).
|
|
Cleanup and crash fix around UnixSignal.WaitAny (bug #36214)
|
|
Add comments, add assert for edge case around signal registration, and
make consistent *always* using atomic get/set for memory shared
between the signal handler and the threads.
|
|
Add version keys to the C and C# versions of Mono.Posix and add static
constructors which fail early if the version keys differ.
|
|
There is a race condition in signal.c where a signal-waiting thread
can close the pipe and then the signal handler can try to write to it.
Introduce a locking mechanism to prevent this. Separate mph_int_set
and mph_int_test_and_set to support the lock code.
|
|
Minimal fix for sporadic Mono.Unix.UnixSignalTest.TestWaitAny crashes (bug #35936)
|
|
fsync() on a file descriptor from a pipe() is invalid, and
occasionally crashes on current OS X.
|
|
unsafely converted to an int32 pointer
|
|
Value returned from the reader function can be negative and ZStream's
avail_in should not be less than 0 as that value makes no sense and
other parts of code assume it to be equal or higher than 0.
|
|
|
|
|
|
The Android NDK decalres the `struct timeval` struct in <sys/time.h>.
Update sys-socket.c to #include <sys/time.h> to fix compilation
with the Android NDK.
|
|
Add socket-related functions and data structures to Mono.Posix
|
|
This commit adds those socket-related functions which do not require the
sockaddr_* structures or the msghdr structure.
|
|
Android's libc (bionic) defines the _GNU_SOURCE macro but fails to adhere
to the GNU sematics in (at least) one case - the strerror_r function.
The function follows XSI semantics instead of the GNU one which caused our
code to segfault on Android. This patch special-cases Android to use the XSI
semantics for strerror_r. This un-breaks some POSX real-time singals tests.
It also makes provisions for detecting whether the real-time signals are safe
to use on the current platform. They are safe for all platforms desktop Mono
runs on, but they're not safe on most Android platforms.
|
|
|
|
|
|
This is adapted from FreeBSD's code.
|
|
Android does not provide complex.h in the API levels that we compile against so bundle our own header (based on the one from FreeBSD).
Turns out GCC already provides built-in handling for the complex functions used by the code so there's no need to provide our own implementations.
|
|
IOKit is a private framework in iOS, so it can't be used (and
no headers are provided, so it doesn't even compile).
|
|
/Users/builder/data/lanes/monodroid-mavericks-master/7de6731a/source/mono/support/serial.c:25:26: fatal error: linux/serial.h: No such file or directory
#include <linux/serial.h>
The header is only available on Android NDK API level >= 21.
|
|
|
|
legacy poll support
This patch brings support for arbitrary baud rates in Linux, from patch:
https://bugzilla.xamarin.com/show_bug.cgi?id=8207
Which has been MIT licensed (see mono-devel-list).
In addition, while testing the patch, discovered that we are using
fakepoll.h on MacOS which was there to support Tiger-era broken poll
implementations.
The details about the lack of poll support come from this document
that is now only available on web.archive.org:
http://web.archive.org/web/20030604064847/http://developer.apple.com/technotes/tn2002/tn2071.html
And the original Mono bug that reported the problem in 2008, followed
by the fixes is reported and discussed here:
https://bugzilla.novell.com/show_bug.cgi?id=384227
The source of the problem, confirmed by an Apple employee at the time
(form the bug) is that poll sometimes results in returning POLLHUP
when a POLLIN was expected:
http://curl.haxx.se/mail/lib-2005-05/0122.html
This web site tracks the behavior of poll (POLLHUP and POLLIN) across
Posix implementations when you reach an end of file:
http://www.greenend.org.uk/rjk/tech/poll.html
|
|
|
|
|
|
|
|
input.
Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=22346
|
|
Welcome to the world of tomorrow! It's been almost a decade since this was
made obsolete in 2005. Nothing uses this function any longer. Additionally
it is completely broken as utimes takes a pointer to an array with two
timevals, but the code passes only a pointer to a single timeval.
This change is released under the MIT/X11 license.
|