Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -268,6 +268,7 @@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
CMAKE = @CMAKE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CSC = @CSC@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
@@ -300,7 +301,6 @@ HAVE_MSGFMT = @HAVE_MSGFMT@
HOST_CC = @HOST_CC@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_MOBILE_STATIC = @INSTALL_MOBILE_STATIC@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
@@ -332,6 +332,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MONO_CORLIB_VERSION = @MONO_CORLIB_VERSION@
MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
MONO_NACL_ALIGN_MASK_OFF = @MONO_NACL_ALIGN_MASK_OFF@
MSGFMT = @MSGFMT@

View File

@@ -10,6 +10,12 @@
G_BEGIN_DECLS
int
Mono_Posix_Stdlib_GetLastError (void)
{
return errno;
}
void
Mono_Posix_Stdlib_SetLastError (int error_number)
{

View File

@@ -13,15 +13,21 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <errno.h>
#ifdef HOST_WIN32
#include <corecrt_io.h>
#endif
#include "map.h"
#include "mph.h"
G_BEGIN_DECLS
#ifndef HOST_WIN32
gint32
Mono_Posix_Syscall_fcntl (gint32 fd, gint32 cmd)
{
@@ -95,6 +101,7 @@ Mono_Posix_Syscall_fcntl_lock (gint32 fd, gint32 cmd, struct Mono_Posix_Flock *l
return r;
}
#endif
gint32
Mono_Posix_Syscall_open (const char *pathname, gint32 flags)

View File

@@ -1472,7 +1472,7 @@ z_streamp strm;
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16);
state = (struct inflate_state FAR *)strm->state;
return ((long)(state->back) << 16) +
(state->mode == COPY ? state->length :

View File

@@ -1 +1 @@
ccd221b106a219d161e744e9e6f42828089f7130
cf6213c8c56f9e1b8f31cc5f2ca735390312e88d

View File

@@ -54,11 +54,9 @@
# endif
#endif /* !defined(EOVERFLOW) */
#if !defined (HOST_WIN32)
/*
* Solaris doesn't define these BSD values, and if they're not present then
* map.c:Mono_Posix_FromSeekFlags() breaks badly; see:
* Solaris/Windows don't define these BSD values, and if they're not present
* then map.c:Mono_Posix_FromSeekFlags() breaks badly; see:
* http://bugzilla.gnome.org/show_bug.cgi?id=370081
*/
@@ -74,6 +72,8 @@
#define L_XTND SEEK_END
#endif /* ndef L_XTND */
#if !defined (HOST_WIN32)
/*
* OS X doesn't define MAP_ANONYMOUS, but it does define MAP_ANON.
* Alias them to fix: https://bugzilla.xamarin.com/show_bug.cgi?id=3419

View File

@@ -16,23 +16,25 @@
G_BEGIN_DECLS
#ifndef HOST_WIN32
gint32
Mono_Posix_Syscall_L_ctermid (void)
{
#ifndef HOST_WIN32
return L_ctermid;
#else
return -1;
#endif
}
gint32
Mono_Posix_Syscall_L_cuserid (void)
{
#if defined(__APPLE__) || defined (__OpenBSD__)
#if defined(__APPLE__) || defined (__OpenBSD__) || defined (HOST_WIN32)
return -1;
#else
return L_cuserid;
#endif
}
#endif /* ndef HOST_WIN32 */
mph_size_t
Mono_Posix_Stdlib_fread (unsigned char *ptr, mph_size_t size, mph_size_t nmemb, void *stream)
@@ -49,7 +51,21 @@ Mono_Posix_Stdlib_fwrite (unsigned char *ptr, mph_size_t size, mph_size_t nmemb,
mph_return_if_size_t_overflow (size);
mph_return_if_size_t_overflow (nmemb);
return fwrite (ptr, (size_t) size, (size_t) nmemb, (FILE*) stream);
size_t ret = fwrite (ptr, (size_t) size, (size_t) nmemb, (FILE*) stream);
#ifdef HOST_WIN32
// Workaround for a particular weirdness on Windows triggered by the
// StdioFileStreamTest.Write() test method. The test writes 15 bytes to a
// file, then rewinds the file pointer and reads the same bytes. It then
// writes 15 additional bytes to the file. This second write fails on
// Windows with 0 returned from fwrite(). Calling fseek() followed by a retry
// of fwrite() like we do here fixes the issue.
if (ret != nmemb)
{
fseek (stream, 0, SEEK_CUR);
ret = fwrite (ptr + (ret * nmemb), (size_t) size, (size_t) nmemb - ret, (FILE*) stream);
}
#endif
return ret;
}
#ifdef HAVE_VSNPRINTF
@@ -142,6 +158,12 @@ Mono_Posix_Stdlib_TMP_MAX (void)
return TMP_MAX;
}
void*
Mono_Posix_Stdlib_tmpfile (void)
{
return tmpfile ();
}
gint32
Mono_Posix_Stdlib_setvbuf (void* stream, void *buf, int mode, mph_size_t size)
{
@@ -156,6 +178,60 @@ Mono_Posix_Stdlib_setbuf (void* stream, void* buf)
return 0;
}
void*
Mono_Posix_Stdlib_fopen (char* path, char* mode)
{
return fopen (path, mode);
}
void*
Mono_Posix_Stdlib_freopen (char* path, char* mode, void *stream)
{
return freopen (path, mode, stream);
}
gint32
Mono_Posix_Stdlib_fprintf (void* stream, char* format, char *message)
{
return fprintf (stream, format, message);
}
gint32
Mono_Posix_Stdlib_fgetc (void* stream)
{
return fgetc (stream);
}
char*
Mono_Posix_Stdlib_fgets (char* str, gint32 size, void* stream)
{
return fgets (str, size, stream);
}
gint32
Mono_Posix_Stdlib_fputc (gint32 c, void* stream)
{
return fputc (c, stream);
}
gint32
Mono_Posix_Stdlib_fputs (char* s, void* stream)
{
return fputs (s, stream);
}
gint32
Mono_Posix_Stdlib_fclose (void* stream)
{
return fclose (stream);
}
gint32
Mono_Posix_Stdlib_fflush (void* stream)
{
return fflush (stream);
}
gint32
Mono_Posix_Stdlib_fseek (void* stream, gint64 offset, int origin)
{
@@ -207,6 +283,24 @@ Mono_Posix_Stdlib_clearerr (void* stream)
return 0;
}
gint32
Mono_Posix_Stdlib_ungetc (gint32 c, void* stream)
{
return ungetc (c, stream);
}
gint32
Mono_Posix_Stdlib_feof (void* stream)
{
return feof (((FILE*) stream));
}
gint32
Mono_Posix_Stdlib_ferror (void* stream)
{
return ferror (((FILE*) stream));
}
int
Mono_Posix_Stdlib_perror (const char* s, int err)
{

View File

@@ -72,6 +72,12 @@ Mono_Posix_Stdlib_realloc (void* ptr, mph_size_t size)
return realloc (ptr, (size_t) size);
}
void
Mono_Posix_Stdlib_free (void* p)
{
free (p);
}
G_END_DECLS
/*

View File

@@ -18,7 +18,6 @@
#include "mono/metadata/class.h"
#include "mono/metadata/object.h"
#include "mono/metadata/tabledefs.h"
#include "mono/io-layer/wapi.h"
typedef struct {
const char *fname;

View File

@@ -13,7 +13,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <errno.h>
@@ -42,8 +44,10 @@ Mono_Posix_FromStat (struct Mono_Posix_Stat *from, void *_to)
to->st_gid = from->st_gid;
to->st_rdev = from->st_rdev;
to->st_size = from->st_size;
#ifndef HOST_WIN32
to->st_blksize = from->st_blksize;
to->st_blocks = from->st_blocks;
#endif
to->st_atime = from->st_atime_;
to->st_mtime = from->st_mtime_;
to->st_ctime = from->st_ctime_;
@@ -76,8 +80,10 @@ Mono_Posix_ToStat (void *_from, struct Mono_Posix_Stat *to)
to->st_gid = from->st_gid;
to->st_rdev = from->st_rdev;
to->st_size = from->st_size;
#ifndef HOST_WIN32
to->st_blksize = from->st_blksize;
to->st_blocks = from->st_blocks;
#endif
to->st_atime_ = from->st_atime;
to->st_mtime_ = from->st_mtime;
to->st_ctime_ = from->st_ctime;
@@ -126,6 +132,7 @@ Mono_Posix_Syscall_fstat (int filedes, struct Mono_Posix_Stat *buf)
return r;
}
#ifndef HOST_WIN32
gint32
Mono_Posix_Syscall_lstat (const char *file_name, struct Mono_Posix_Stat *buf)
{
@@ -141,6 +148,7 @@ Mono_Posix_Syscall_lstat (const char *file_name, struct Mono_Posix_Stat *buf)
r = -1;
return r;
}
#endif
#ifdef HAVE_FSTATAT
gint32
@@ -163,6 +171,7 @@ Mono_Posix_Syscall_fstatat (gint32 dirfd, const char *file_name, struct Mono_Pos
}
#endif
#ifndef HOST_WIN32
gint32
Mono_Posix_Syscall_mknod (const char *pathname, guint32 mode, mph_dev_t dev)
{
@@ -170,6 +179,7 @@ Mono_Posix_Syscall_mknod (const char *pathname, guint32 mode, mph_dev_t dev)
return -1;
return mknod (pathname, mode, dev);
}
#endif
#ifdef HAVE_MKNODAT
gint32
@@ -203,6 +213,7 @@ Mono_Posix_Syscall_get_utime_omit ()
#endif
}
#if defined(HAVE_FUTIMENS) || defined(HAVE_UTIMENSAT)
static inline struct timespec*
copy_utimens (struct timespec* to, struct Mono_Posix_Timespec *from)
{
@@ -216,6 +227,7 @@ copy_utimens (struct timespec* to, struct Mono_Posix_Timespec *from)
return NULL;
}
#endif
#ifdef HAVE_FUTIMENS
gint32