Age | Commit message (Collapse) | Author |
|
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.
|
|
The SIGPROF signal is an XSI option and obsolescent in XSI. POSIX systems
are not required to have it.
This change is released under the MIT/X11 license.
|
|
The <sys/param.h> header is non-standard and usually not required if it isn't
available.
This change is released under the MIT/X11 license.
|
|
POSIX specifies <poll.h> as the standard header that declares the poll
function. Many systems provide <sys/poll.h> to be compatible with historical
practice. Prefer the <poll.h> header over <sys/poll.h> if it is available.
This change is released under the MIT/X11 license.
|
|
|
|
This should be applied to prototypes, and it already is for
this function (in mph.h).
|
|
|
|
|
|
Yes, really. zlib really uses a 32-bit int here...
|
|
|
|
This change released under the MIT license with permission from the original
author Christian Weisgerber.
|
|
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=19991
The original Mono.Unix.Native.Errno design used the Linux <errno.h>
constants and values...largely because it was easy.
As it turns out, this is also incomplete. The getxattr(2) defines
ENOATTR as a possible error code. On Linux, ENOATTR is an alias for
ENODATA [0]. On OS X, ENOATTR is _not_ an alias. Furthermore, since
ENOATTR is not a Linux errno value (it's an alias!),
Mono_Posix_ToErrno() couldn't check for the native ENOATTR value, so a
Syscall.GetLastError() call after a failing Syscall.getxattr() would
fail with a System.ArgumentOutOfRangeException:
$ csharp -r:Mono.Posix.dll
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using Mono.Unix.Native;
csharp> byte[] value;
csharp> Syscall.getxattr(".", "test", out value);
-1
csharp> Syscall.GetLastError();
System.ArgumentOutOfRangeException: Current platform doesn't support this value.
Parameter name: value
93
at Mono.Unix.Native.NativeConvert.ThrowArgumentException (System.Object value) [0x00000] in <filename unknown>:0
at Mono.Unix.Native.NativeConvert.ToErrno (Int32 value) [0x00000] in <filename unknown>:0
at Mono.Unix.Native.Stdlib.GetLastError () [0x00000] in <filename unknown>:0
The fix is to add an Errno.ENOATTR field [1].
The complication is one of what enum value to use: at present, the
Errno values are based on the Linux values. In the case of ENOATTR
(and others), there is no Linux value. Meanwhile, there is the
possibility of additional Linux error values; how do we future proof
ourselves?
This isn't a perfect solution, but it should punt the problem down the
road a bit: Errno is an `int` enum, and thus has large range. To
support the OS X values, we add 1000 to the OS X error value.
/* OS X: <errno.h> */
#define ENOATTR 93 /* Attribute not found */
// C# Errno enum:
public enum Errno : int {
// ...
ENOATTR = 1093,
}
This gives us 0..1000 for POSIX+Linux error codes, 1000..2000 for OS X
specific error codes, and as new platforms require additional support
they can all start at multiples of 1000.
Hopefully no single *nix platform will add more than 1000 error codes...
[0]: http://linux.die.net/man/2/getxattr
[1]: Related part of the fix: add all the OTHER <errno.h> values that
OS X includes but weren't included in the Errno enum.
|
|
is not visible.
This change is licensed under the MIT license.
|
|
Call zlib's inflate() even if no data was read from the stream, there might still be some data left to process.
Originally reported by Eric Roller, as Xamarin bugzilla #17183.
https://bugzilla.xamarin.com/show_bug.cgi?id=17183
Reviewed by Rodrigo Kumpera.
|
|
|
|
The previous version used SCNetworkReachability
in C inside libMonoPosixHelper. This was less
than ideal and made it more problematic for
supporting iOS as it doesn't actually link
MPH in.
Rewrite using P/Invokes directly into the
SCNetworkReachability APIs for Mac OS X and
iOS.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=13642
for iOS and Mac OS X.
|
|
Syscall.readlink() currently returns an integer indicating the number of
bytes in the link. As buf contains chars, this value is useless if the
target contains non-ascii characters.
This commit creates a new overload which uses a byte array instead of a
StringBuilder and rewrites the old overload to return the number of chars
instead.
Fixes #11778 and #9611
|
|
This code can't depend on mono/utils and doesn't need the 'fixed'
implementation of bsearch () anyway since keys are never null.
|
|
This is a replacement for bsearch () because some platforms
have bogus asserts in their implementations.
|
|
|
|
libgc defines to libgc only."
This reverts commit cff0ecb816fdd10419550b549137f48b5a14ff88.
Revert this as boehm-gc.c depends on the libgc defines.
|
|
defines to libgc only.
|
|
In response to Rodrigo's comments on PR 629.
|
|
|