Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -1,272 +0,0 @@
2010-07-21 Jackson Harper <jackson@ximian.com>
* Syscall.cs: Add bindings to the various epoll
functions. (epoll_create, epoll_ctl, epoll_wait).
2008-12-19 Jonathan Pryor <jpryor@novell.com>
* NativeConvert.cs: Add FromRealTimeSignum(), ToRealTimeSignum().
Patch thanks to tim.jenks@realtimeworlds.com.
* RealTimeSignum.cs: Added; structure which represents a real-time
signal, a value V such that V >= SIGRTMIN and V <= SIGRTMAX.
Patch thanks to tim.jenks@realtimeworlds.com.
* Stdlib.cs: Add SetSignalAction() and raise() overloads which accept
a RealTimeSignum instance.
Patch thanks to tim.jenks@realtimeworlds.com.
2008-10-15 Jonathan Pryor <jpryor@novell.com>
* Syscall.cs: [Map] Flock, add Timespec, bind nanosleep(2).
* NativeConvert.generated.cs: Flush (Add TryCopy methods for Flock,
Timespec).
2008-01-28 Jonathan Pryor <jpryor@novell.com>
* Stdlib.cs: Obsolete Stdlib.signal(), as it's not safe; see also:
http://lists.ximian.com/pipermail/mono-devel-list/2008-January/026501.html
http://lists.ximian.com/pipermail/mono-devel-list/2008-January/026503.html
Add SetSignalAction() as a replacement.
2008-01-22 Sebastien Pouliot <sebastien@ximian.com>
* Syscall.cs: Fix Flock.Equals to avoid NRE (and return false if object
is null). Found using Gendarme.
2008-01-05 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: Add ST_NOEXEC, ST_REMOUNT, ST_BIND to MountFlags. Patch from
Joe Dluzen <jdluzen@gmail.com>.
2007-12-17 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: Bind uname(2).
2007-10-25 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: Fix perror(3) so that it works as expected. (Since errno is
cleared during P/Invoke, previously Stdlib.perror("") would always print
"Success", which isn't very helpful.)
2007-06-28 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.generated.cs: Flush (add TryCopy() methods for Utimbuf).
* Syscall.cs: Map Utimbuf to `struct utimbuf'; needed so that Mono.Fuse can
rely on Mono.Posix.dll for copying all native types.
2006-11-14 Jonathan Pryor <jonpryor@vt.edu>
* MapAttribute.cs: Update (changes SuppressFlags to a string holding mask).
* Syscall.cs: Specify the mask value for non-bitmask values in
FilePermissions.
2006-10-27 Jonathan Pryor <jonpryor@vt.edu>
* MapAttribute.cs: Update (adds SuppressFlags property).
* Syscall.cs: Mark non-flags FilePermissions enumeration members so that
they aren't treated as bitfields. Impacts e.g. S_IFDIR, S_IFCHR, etc..
2006-10-24 Jonathan Pryor <jonpryor@vt.edu>
* HeaderAttribute.cs: Removed. Use create-native-map command-line arguments
instead of HeaderAttribute.Includes & HeaderAttribute.Defines.
* make-map.cs: Moved to mono-tools/create-native-map/src/create-native-map.cs.
* MapAttribute.cs: Moved from ../Mono.Unix. Can now be
specified on Class, Delegeate, Enum, Field, & Struct (instead of just
Enum). Add NativeType property.
* NativeConvert.generated.cs: Flush (adds new .TryCopy methods to copy [Map]'d
structures).
* NativeConvert.cs: Add .TryCopy methods for Statvfs.
* Syscall.cs: Remove HeaderAttribute declaration; Markup [Map]'d structure
members with [Map] attributes (or MapAttribute subclasses) to specify the
native types they correspond to (used by create-native-map).
* TypeAttributes.cs: Added; internal subclasses of MapAttribute to help
markup structures (e.g. so I can use [blkcnt_t] instead of
[Map ("blkcnt_t")], thus minimizing the liklihood of a spelling error).
2006-09-15 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: "Remove" crypt(3), encrypt(3), setkey(3). These use an
encryption algorithm which was broken years ago and could be cracked in
minutes on a modern machine. This also removes a libcrypt.so dependency,
which means you don't need to have development packages installed to use
these either (since "crypt" wasn't <dllmap>'d). These are still present,
but marked [Obsolete] and throw a SecurityException when invoked.
2006-09-07 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: readdir(P) is not thread-safe, so it needs to be locked so
that the `struct dirent' it returns is stable.
2006-04-06 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.cs: Fix ToDateTime()/FromDateTime()/ToTimeT()/FromTimeT() so
that they take timezones into account. Previously, results would be off
by an hour if Daylight Savings Time was in effect. Fixes #78033.
2006-03-23 Raja R Harinath <rharinath@novell.com>
* NativeConvert.generated.cs: Update after merge.
2006-02-25 Marek Safar <marek.safar@seznam.cz>
* NativeConvert.generated.cs: Guarded CLSCompliant attribute by NET_2_0
until mcs is merged with gmcs.
2006-02-21 Marek Safar <marek.safar@seznam.cz>
* NativeConvert.generated.cs: Removed duplicated CLSCompliant attribute.
2006-01-10 Raja R Harinath <rharinath@novell.com>
* Syscall.cs (sys_futimes): Remove buggy custom marshaller on 'fd' parameter.
2005-01-09 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.cs: s/IsType/IsSet/g: deal with UnixFileSystemInfo method
name change.
2005-01-02 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: s/ACCESS/ACCES/g. I didn't create a badly named errno value, I
mis-read EACCES in man pages. I can't read. :-(
2005-01-02 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.generated.cs: Flush (remove Obsolete members).
* Syscall.cs: Remove invalid utimes(2) wrapper.
2005-01-02 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: s/ACCES/ACCESS/g. How'd I create a badly named errno value?
2005-12-29 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Properly handle managed arrays in argument lists.
* Syscall.cs: Properly bind utimes(2) (the Linux man pages are vague on what
it does; the BSD ones are much better). Bind lutimes(2) and futimes(2).
2005-12-27 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: Include <sys/mman.h> for map.c generation. Fixes #77091.
2005-12-27 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Always include 2nd parameter of [Obsolete] attributes; mark
the [DllImport]ed method with [Obsolete] if the underlying type is
[Obsolete].
* NativeConvert.generated.cs: Flush.
2005-12-27 Jonathan Pryor <jonpryor@vt.edu>
* FileNameMarshaler.cs: Use UnixMarshal.PtrToStringUnix -- it's faster.
2005-11-28 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: Prelink all SignalHandlers passed to Stdlib.signal(). This is
so that mono doesn't have to JIT the handler within signal context.
2005-11-08 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: Implement IEquatable<FilePosition> for FilePosition.
* Syscall.cs: Provide GetHashCode(), Equals(), operator==, operator!= for
all structure types. Implement IEquatable<T> for all "value type"
structs and classes.
2005-11-07 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: *xattr functions should use the FileNameMarshaler for filenames.
2005-11-07 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Always use ordinal string sorting behavior. The string
collation sorting has changed, so to keep the mono/support diff sizes down
we have to explicitly specify the previous implicit ordering.
2005-11-02 Jonathan Pryor <jonpryor@vt.edu>
* Syscall.cs: Remove [CLSCompliant(false)] when it isn't needed.
2005-11-02 Jonathan Pryor <jonpryor@vt.edu>
* FileNameMarshaler.cs: Use UnixMarshal.FreeHeap(). .Free() is obsolete.
2005-10-27 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: Correct return type of setbuf(IntPtr, byte*).
* Syscall.cs: Remove [Obsolete] SyslogFacility.LOG_USRE member
(Mono.Unix.Native hasn't shipped yet, so nobody is using it); correct
[Obsolete] comment for getpagesize().
2005-10-26 Jonathan Pryor <jonpryor@vt.edu>
* FileNameMarshaler.cs: Deal with UnixMarshal method name changes.
2005-10-26 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs: FilePosition should derive from MarshalByRefObject, for two
reasons: (1) it's a recommendation from FxCop that classes implementing
IDisposable also derive from MarshalByRefObject; (2) FilePosition is
exposed from Mono.Unix.StdioFileStream, which (indirectly) inherits from
MarshalByRefObject. Fix Equals() so it doesn't rely on Reflection.
2005-10-25 Jonathan Pryor <jonpryor@vt.edu>
* FileNameMarshaler.cs: Custom marshaler to marshal filenames using
Mono.Unix.UnixEncoding. A custom marshaler is used to remove the need to
have ~6 lines of boilerplate on every method that takes filenames.
* Stdlib.cs, Syscall.cs: Filenames need to be marshaled through the
FileNameMarshaler, which will encode/decode filenames with UnixEncoder.
2005-10-14 Jonathan Pryor <jonpryor@vt.edu>
* Stdlib.cs, Syscall.cs: Flush naming convention documentation.
2005-10-14 Jonathan Pryor <jonpryor@vt.edu>
* NativeConvert.generated.cs: Flush currently generated version.
2005-10-14 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Fix documentation comment.
* Stdlib.cs: Fix export of XprintfFunctions.syslog(); make SetLastError()
protected (normal user code shouldn't call it, as it isn't safe);
replace functions which return `void' with functions which return `int'
(adding them to MonoPosixHelper.so as well) -- since users can't reliably
use SetLastError(), they need the "normal" error detection mechanism;
correct the strlen(3) export.
* Syscall.cs:
- s/PathConf/PathconfName/, s/SysConf/SysconfName/, s/ConfStr/ConfstrName/
to follow documented enumeration naming conventions.
- replace functions which return `void' with functions which return `int'
(adding them to MonoPosixHelper.so as well) -- since users can't reliably
use SetLastError(), they need the "normal" error detection mechanism;
2005-10-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Stdlib.cs: add strlen() to fix the build.
2005-09-23 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Generate NativeConvert documentation XML fragments for use in
monodoc.
2005-09-20 Jonathan Pryor <jonpryor@vt.edu>
* ChangeLog: Started.
* CdeclFunction.cs: Copied from ../Mono.Unix; change namespace.
* HeaderAttribute.cs: Added
* make-map.cs: Copied from ../Mono.Unix; sort type and member names in
output (makes for a more stable svn history, as types/members won't change
position anymore within generated code); look for HeaderAttribute not
IncludeAttribute for getting headers & #defines; generate NativeConvert
partial class.
* NativeConvert.cs: Copied from ../Mono.Unix; change namespace; turn into a
partial class; Remove generated code (generated code is in
NativeConvert.generated.cs).
* NativeConvert.generated.cs: Added
* Stdlib.cs: Copied from ../Mono.Unix; change namespace; rename Error to
Errno (as Error is a "reserved word" in FxCop); [CLSCompliant(false)]
support.
* Syscall.cs: Use HeaderAttribute, not IncludeAttribute, for CLS compliance;
add [CLSCompliant(false)] as needed; use NativeConvert, not UnixConvert.

View File

@@ -359,7 +359,117 @@ namespace Mono.Unix.Native {
{
return ToStatvfs (source, out destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromInAddr")]
private static extern int FromInAddr (ref InAddr source, IntPtr destination);
public static bool TryCopy (ref InAddr source, IntPtr destination)
{
return FromInAddr (ref source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToInAddr")]
private static extern int ToInAddr (IntPtr source, out InAddr destination);
public static bool TryCopy (IntPtr source, out InAddr destination)
{
return ToInAddr (source, out destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromIn6Addr")]
private static extern int FromIn6Addr (ref In6Addr source, IntPtr destination);
public static bool TryCopy (ref In6Addr source, IntPtr destination)
{
return FromIn6Addr (ref source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToIn6Addr")]
private static extern int ToIn6Addr (IntPtr source, out In6Addr destination);
public static bool TryCopy (IntPtr source, out In6Addr destination)
{
return ToIn6Addr (source, out destination) == 0;
}
public static InAddr ToInAddr (System.Net.IPAddress address)
{
if (address == null)
throw new ArgumentNullException ("address");
if (address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork)
throw new ArgumentException ("address", "address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork");
return new InAddr (address.GetAddressBytes ());
}
public static System.Net.IPAddress ToIPAddress (InAddr address)
{
var bytes = new byte[4];
address.CopyTo (bytes, 0);
return new System.Net.IPAddress (bytes);
}
public static In6Addr ToIn6Addr (System.Net.IPAddress address)
{
if (address == null)
throw new ArgumentNullException ("address");
if (address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)
throw new ArgumentException ("address", "address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6");
return new In6Addr (address.GetAddressBytes ());
}
public static System.Net.IPAddress ToIPAddress (In6Addr address)
{
var bytes = new byte[16];
address.CopyTo (bytes, 0);
return new System.Net.IPAddress (bytes);
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSockaddr")]
private static extern unsafe int FromSockaddr (_SockaddrHeader* source, IntPtr destination);
public static unsafe bool TryCopy (Sockaddr source, IntPtr destination)
{
if (source == null)
throw new ArgumentNullException ("source");
byte[] array = Sockaddr.GetDynamicData (source);
// SockaddrStorage has to be handled extra because the native code assumes that SockaddrStorage input is used in-place
if (source.type == (SockaddrType.SockaddrStorage | SockaddrType.MustBeWrapped)) {
Marshal.Copy (array, 0, destination, (int) source.GetDynamicLength ());
return true;
}
fixed (SockaddrType* addr = &Sockaddr.GetAddress (source).type)
fixed (byte* data = array) {
var dyn = new _SockaddrDynamic (source, data, useMaxLength: false);
return FromSockaddr (Sockaddr.GetNative (&dyn, addr), destination) == 0;
}
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToSockaddr")]
private static extern unsafe int ToSockaddr (IntPtr source, long size, _SockaddrHeader* destination);
public static unsafe bool TryCopy (IntPtr source, long size, Sockaddr destination)
{
if (destination == null)
throw new ArgumentNullException ("destination");
byte[] array = Sockaddr.GetDynamicData (destination);
fixed (SockaddrType* addr = &Sockaddr.GetAddress (destination).type)
fixed (byte* data = Sockaddr.GetDynamicData (destination)) {
var dyn = new _SockaddrDynamic (destination, data, useMaxLength: true);
var r = ToSockaddr (source, size, Sockaddr.GetNative (&dyn, addr));
dyn.Update (destination);
// SockaddrStorage has to be handled extra because the native code assumes that SockaddrStorage input is used in-place
if (r == 0 && destination.type == (SockaddrType.SockaddrStorage | SockaddrType.MustBeWrapped)) {
Marshal.Copy (source, array, 0, (int) destination.GetDynamicLength ());
}
return r == 0;
}
}
}
}
// vim: noexpandtab
// Local Variables:
// tab-width: 4
// c-basic-offset: 4
// indent-tabs-mode: t
// End:

View File

@@ -86,6 +86,22 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromCmsghdr")]
private static extern int FromCmsghdr (ref Cmsghdr source, IntPtr destination);
public static bool TryCopy (ref Cmsghdr source, IntPtr destination)
{
return FromCmsghdr (ref source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToCmsghdr")]
private static extern int ToCmsghdr (IntPtr source, out Cmsghdr destination);
public static bool TryCopy (IntPtr source, out Cmsghdr destination)
{
return ToCmsghdr (source, out destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromConfstrName")]
private static extern int FromConfstrName (ConfstrName value, out Int32 rval);
@@ -918,6 +934,70 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSockaddrIn")]
private static extern int FromSockaddrIn (SockaddrIn source, IntPtr destination);
public static bool TryCopy (SockaddrIn source, IntPtr destination)
{
return FromSockaddrIn (source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToSockaddrIn")]
private static extern int ToSockaddrIn (IntPtr source, SockaddrIn destination);
public static bool TryCopy (IntPtr source, SockaddrIn destination)
{
return ToSockaddrIn (source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSockaddrIn6")]
private static extern int FromSockaddrIn6 (SockaddrIn6 source, IntPtr destination);
public static bool TryCopy (SockaddrIn6 source, IntPtr destination)
{
return FromSockaddrIn6 (source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToSockaddrIn6")]
private static extern int ToSockaddrIn6 (IntPtr source, SockaddrIn6 destination);
public static bool TryCopy (IntPtr source, SockaddrIn6 destination)
{
return ToSockaddrIn6 (source, destination) == 0;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSockaddrType")]
private static extern int FromSockaddrType (SockaddrType value, out Int32 rval);
internal static bool TryFromSockaddrType (SockaddrType value, out Int32 rval)
{
return FromSockaddrType (value, out rval) == 0;
}
internal static Int32 FromSockaddrType (SockaddrType value)
{
Int32 rval;
if (FromSockaddrType (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToSockaddrType")]
private static extern int ToSockaddrType (Int32 value, out SockaddrType rval);
internal static bool TryToSockaddrType (Int32 value, out SockaddrType rval)
{
return ToSockaddrType (value, out rval) == 0;
}
internal static SockaddrType ToSockaddrType (Int32 value)
{
SockaddrType rval;
if (ToSockaddrType (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSysconfName")]
private static extern int FromSysconfName (SysconfName value, out Int32 rval);
@@ -1126,6 +1206,38 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromUnixSocketControlMessage")]
private static extern int FromUnixSocketControlMessage (UnixSocketControlMessage value, out Int32 rval);
public static bool TryFromUnixSocketControlMessage (UnixSocketControlMessage value, out Int32 rval)
{
return FromUnixSocketControlMessage (value, out rval) == 0;
}
public static Int32 FromUnixSocketControlMessage (UnixSocketControlMessage value)
{
Int32 rval;
if (FromUnixSocketControlMessage (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToUnixSocketControlMessage")]
private static extern int ToUnixSocketControlMessage (Int32 value, out UnixSocketControlMessage rval);
public static bool TryToUnixSocketControlMessage (Int32 value, out UnixSocketControlMessage rval)
{
return ToUnixSocketControlMessage (value, out rval) == 0;
}
public static UnixSocketControlMessage ToUnixSocketControlMessage (Int32 value)
{
UnixSocketControlMessage rval;
if (ToUnixSocketControlMessage (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromUnixSocketFlags")]
private static extern int FromUnixSocketFlags (UnixSocketFlags value, out Int32 rval);

View File

@@ -1 +1 @@
4125978df0c8371b3c21d2a86e7e00364e2f7e54
cbeb54b0ec2778f87a457f5494c2f349d5ddb223