Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-10Include <config.h> in C files that include mono headersAleksey Kliger
Any translation unit that includes a Mono header should include <config.h> first to ensure that all of our configuration defines are available. In particular, config.h defines MONO_INSIDE_RUNTIME which, in mono-publib.h causes MONO_RT_EXTERNAL_ONLY to be defined to an attribute that causes a compilation error if you use a function that is internally deprecated for the runtime. Also change a couple of places that used non-_checked functions.
2017-10-31[android] Fix compilation with recent ndk and sdk target < 16.Rodrigo Kumpera
2017-10-27Bugfix: 1.5 stop bits for serial port should set the posix stop bit flag (#5873)robotrovsky
1.5 stop bits have not been handled at all. According to this documentation of the 8250 UART: http://stanislavs.org/helppc/8250.html a set bit 2 in the LCR register means stop bits = 1.5 for 5 bit words or 2 for 6, 7 or 8 bit words. That is the reason why pyserial also sets the bit: https://github.com/pyserial/pyserial/blob/92d101613be41ecb2f2054c3f43a006fbe6f9966/serial/serialposix.py#L377
2017-10-19[runtime] Rename atomic functions from the win32 style naming to ↵Johan Lorensson
mono_atomic_<op>_<type>, with a consistent signature on all platforms, including Windows implementation. (#5767) * [runtime] Rename atomic functions from the win32 style naming to mono_atomic_<op>_<type>, with a consistent signature on all platforms. This fixes a large number of warnings on windows. * Add Windows implementaiton of mono_atomic_*. * Windows implementation of mono_atomic_* inline functions. * Changed naming typo in mono_atomic_xchg_i32Add and mono_atomic_xchg_i32Add64. * Fixed some additional signed/unsigned/volatile warnings when using mono_atomic_* * Fixed some smaller additionl warnings. * Fix Interlocked* to mono_atomic_* name change in signal.c * Additional name adjustment of atomics. Aligning more towards C11/C++11 standard namings: mono_atomic_xchg_add_i32|i64 -> mono_atomic_fetch_add_i32|i64 Changed from mono_atomic_add to mono_atomic_fetch_add in cases when return type is not used. Also includes small mingw build fix on Windows. * Aligned loads with C++11 implementation using explicit compiler barrier. On x86/x64 Windows, reading a properly aligned 8,16,32 bit volatile variable (using /volatile:ms extension) should have acquire semantics. On x64 this also includes 64-bit properly aligned volatile variables. The C++11 implementation does however include an explicit _ReadWriteBarrier in its sequentially consistent implementation to instruct compiler to not reorder load/stores. Since compiler supports two modes of volatile behavior (ms/iso) this additional barrier is probably there for consistency, independent of the behavior of volatile keyword. NOTE, the x86/x64 CPU architecture has strong guarantees regarding load/store of memory operations, so issuing a CPU memory barrier for loads should not be needed (and is not done in C++11 atomics implementation). This commit also adds a couple of optimizations for 32-bit loads and for x64, 64-bits loads. The C++11 implementation uses the same pattern loading them as 8 and 16 bits variables, so no need for Interlocked* calls to load 32-bit and for x64 64-bit variables.
2017-10-03Prepare Mono for Android NDK with unified headers (#5680)Marek Habersack
Up until NDK release 14 Android SDK included a separate set of C header files for each supported platform. NDK 14 introduced a new set of those headers (they are NOT the same as the old ones) which unifies support for all of the platforms so that bug fixes are available for all the API levels without having to backport etc. With NDK 15 the unified headers become the default ones (including when creating standalone toolchains) and with NDK 16 (in beta currently) the old per-platform headers are removed. Unfortunately, the new headers introduce breaking changes which made it impossible to build Mono with NDK configured to use them. This commit makes a handful of changes to Mono which make it build with unified headers.
2017-08-28remove redundant duplicate word 'not'HinTak
Found a consecutive 'not' pair while searching the code for somethng else.
2017-08-15[runtime] Use HOST_ defines instead of PLATFORM_ defines. (#5362)Zoltan Varga
2017-06-27Fix various compiler warnings (#5064)cherusker
* Fix compiler warnings (w32) - add explicit (long long (unsigned)) type casts - change %ld to %lld once, to match the general style of these logging messages * Fix compiler warnings (threadpool) - add explicit (void *) type casts * Fix compiler warnings (boehm) - add an explicit (long) type cast; the values are defined as gint64, an upgrade to at least "%ld" seems like a good idea - about dropping const: const does not seem to be necessary as g_getenv() returns pointers to freshly allocated buffers whenever called. const might have been used to protect the return value of g_getenv() on unix systems with earlier versions of Mono (as a comment in gmisc-unix.c suggests). keeping const here causes a compiler warning, as the const qualifier gets dropped when *env is being used with g_free(). that led to the decision to drop the qualifier altogether. * Fix compiler warnings (sgen) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * Fix compiler warnings (misc - metadata) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * Fix compiler warnings (misc) - specify the arguments (void) to avoid -Wstrict-prototypes warnings - add an explicit (void *) type cast; changing the return type to char* might be more usable and could be discussed - ret is not being used and can be removed; fixes a -Wunused-but-set-variable warning * Fix compiler warnings (mini) - specify the arguments (void) to avoid -Wstrict-prototypes warnings * [fixup!] Correct indentation * [fixup!] Correct (void *) - use GUINT_TO_POINTER and MONO_NATIVE_THREAD_ID_TO_UINT instead of (void *) to cast mono_native_thread_id_get () to %p * [fixup!] Correct indentation of boehm-gc.c and add FIXME * include <inttypes.h> and test the G_GINT64_FORMAT macro * [fixup!] Use G_G*_FORMAT and PRIx32 macros instead of type casts wherever possible
2017-04-26Define HAVE_STRUCT_SOCKADDR_IN6 on Windows (#4755)Joshua Peterson
This enables IPv6 support on Windows.
2017-02-27Improve build and configureCalvin
* detect sys/errno.h * Fix errenous LIBS in haiku * use HAVE_MINCORE
2017-02-27Get support libraries compilingCalvin
These return no-ops, but its enough to make it happy
2017-02-01Fixes the Mono.Posix API breakage introduced in #3985Niklas Therning
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.
2017-01-23Fix a few cppcheck errors (#4281)Alexander Köplinger
* [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"
2017-01-21[io-layer] Extract error (#4279)Ludovic Henry
* [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
2016-11-18Merge pull request #3985 from ntherning/fix-Mono.Posix-on-windowsNiklas Therning
Fix Mono.Posix tests on Windows
2016-11-18Fixes compile error in support/stdio.c on XANiklas Therning
2016-11-17Fix Mono.Posix tests on WindowsNiklas Therning
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.
2016-11-16Prevent Mono.Posix from using multiple C runtimes on WindowsNiklas Therning
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.
2016-10-28[System.IO.Compression] Fixed potential bug when keeping track of total read ↵Joao Matos
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.
2016-10-28[System.IO.Compression] Fixed DeflateStream input stream EOF condition.Joao Matos
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.
2016-10-27[System.IO.Compression] Fixed DeflateStream inflate() decompression loop.Joao Matos
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.
2016-08-09Define _NETBSD_SOURCE for mincore(2) (#3380)Kamil Rytarowski
2016-04-17Implement mremap(2) usage on NetBSDKamil Rytarowski
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.
2016-02-25Fixed the build.João Matos
2016-02-25[support/zlib] Added API exports to exported calls from zlib-helper.c.João Matos
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-25[support/zlib] Remove eglib link dependencies from zlib-helper.c.João Matos
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-23[System.IO.Compression.DeflateStream] Fixed end condition in decompression loop.João Matos
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.
2016-01-29Remove ChangeLog files from the repoAlexander Köplinger
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-19[Mono.Posix] Add support for sending and receiving socket control messagesSteffen Kieß
Add wrappers for struct cmsghdr, the macros for manipulating control messages (CMSG_*) and recvmsg() and sendmsg().
2016-01-19[Mono.Posix] Fix OSX build break by checking if accept4() is availableAlexander Köplinger
It's a Linux-specific extension and not available on OSX or Linux <2.6.28
2016-01-19Merge pull request #2006 from steffen-kiess/posix-sockets-2Jonathan Pryor
[Mono.Posix] Add wrappers for struct sockaddr_*
2016-01-18[Mono.Posix] Add wrappers for struct sockaddr_*Steffen Kieß
Add wrappers for the sockaddr_* structures and add the syscalls using these structures (bind(), accept(), ...).
2015-12-03Merge pull request #2260 from xmcclure/fix-testwaitanyRodrigo Kumpera
Cleanup and crash fix around UnixSignal.WaitAny (bug #36214)
2015-12-02Cleanup in signal.c and related testsAndi McClure
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.
2015-12-02Fail cleanly when MonoPosixHelper.dll version is wrong (bug #35655)Andi McClure
Add version keys to the C and C# versions of Mono.Posix and add static constructors which fail early if the version keys differ.
2015-11-24Spinlock to prevent SIGPIPE in signal.c (bug #36214)Andi McClure
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.
2015-11-24Merge pull request #2264 from xmcclure/fix-testwaitany-miniJonathan Pryor
Minimal fix for sporadic Mono.Unix.UnixSignalTest.TestWaitAny crashes (bug #35936)
2015-11-24Don't fsync() on a pipe (causes bug #35936)Andi McClure
fsync() on a file descriptor from a pipe() is invalid, and occasionally crashes on current OS X.
2015-11-23Fix sys-stat.c where a pointer to a mode_t (potentially an int16) was being ↵Andi McClure
unsafely converted to an int32 pointer
2015-09-25[support] Limit possible valuesMarek Habersack
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.
2015-09-11There's no IOKit on the Apple TV.Rolf Bjarne Kvinge
2015-08-28Remove stray ifdefMarek Habersack
2015-08-27[MonoPosixHelper] Fix compilation for Android.Jonathan Pryor
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.
2015-08-27Merge pull request #1993 from steffen-kiess/posix-sockets-1Jonathan Pryor
Add socket-related functions and data structures to Mono.Posix
2015-08-24Add socket-related functions and data structures to Mono.PosixSteffen Kieß
This commit adds those socket-related functions which do not require the sockaddr_* structures or the msghdr structure.
2015-08-13Posix RTS test fixes and Android compatibilityMarek Habersack
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.
2015-07-24[runtime] Workaround lack of signal().João Matos
2015-04-07[System] Fix DeflateStream throw on empty flush, double flush. Fixes #28777Gabriel Garcia
2015-03-30[runtime] Add some complex math support code.João Matos
This is adapted from FreeBSD's code.
2015-03-25[runtime] Fixed complex.h usage in MS's thread pool to work in Android.João Matos
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.