forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dotnet#3 from pgavlin/sn2
Merge corefx/master into sn2.
- Loading branch information
Showing
483 changed files
with
46,181 additions
and
23,747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00066" /> | ||
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00069" /> | ||
<package id="dnx-coreclr-win-x86" version="1.0.0-beta5-12101" /> | ||
<package id="Microsoft.DotNet.BuildTools.ApiTools" version="1.0.0-prerelease" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
|
||
internal static partial class Interop | ||
{ | ||
public static unsafe void CheckBounds(byte* buffer, int bufferSize, byte* offset, int accessSize) | ||
{ | ||
var start = checked((int)(IntPtr)(offset - buffer)); | ||
var end = checked(start + accessSize); | ||
if (start < 0 || end > bufferSize) | ||
{ | ||
throw new IndexOutOfRangeException(); | ||
} | ||
} | ||
|
||
public static unsafe void CheckBounds(byte* buffer, int bufferSize, byte* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset, sizeof(byte)); | ||
} | ||
|
||
public static unsafe void CheckBounds(byte* buffer, int bufferSize, ushort* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, (byte*)offset, sizeof(ushort)); | ||
} | ||
|
||
public static unsafe void CheckBounds(byte* buffer, int bufferSize, uint* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, (byte*)offset, sizeof(uint)); | ||
} | ||
|
||
public static unsafe byte CheckedRead(byte* buffer, int bufferSize, byte* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
return *offset; | ||
} | ||
|
||
public static unsafe ushort CheckedRead(byte* buffer, int bufferSize, ushort* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
return *offset; | ||
} | ||
|
||
public static unsafe uint CheckedRead(byte* buffer, int bufferSize, uint* offset) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
return *offset; | ||
} | ||
|
||
public static unsafe void CheckedWrite(byte* buffer, int bufferSize, byte* offset, byte value) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
*offset = value; | ||
} | ||
|
||
public static unsafe void CheckedWrite(byte* buffer, int bufferSize, ushort* offset, ushort value) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
*offset = value; | ||
} | ||
|
||
public static unsafe void CheckedWrite(byte* buffer, int bufferSize, uint* offset, uint value) | ||
{ | ||
CheckBounds(buffer, bufferSize, offset); | ||
*offset = value; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
using socklen_t = System.UInt32; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class libc | ||
{ | ||
public const int AI_NUMERICHOST = 0x0004; // Don't use name resolution. | ||
public const int AI_NUMERICSERV = 0x1000; // Don't use name resolution. | ||
|
||
public const int NI_NUMERICHOST = 2; // Don't try to look up hostname. | ||
|
||
public const int EAI_BADFLAGS = 3; // Invalid value for `ai_flags' field. | ||
public const int EAI_NONAME = 8; // NAME or SERVICE is unknown. | ||
|
||
public unsafe struct addrinfo | ||
{ | ||
public int ai_flags; | ||
public int ai_family; | ||
public int ai_socktype; | ||
public int ai_protocol; | ||
public socklen_t ai_addrlen; | ||
public byte* ai_canonname; | ||
public sockaddr* ai_addr; | ||
public addrinfo* ai_next; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
using in_port_t = System.UInt16; | ||
using sa_family_t = System.Byte; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class libc | ||
{ | ||
public const sa_family_t AF_UNSPEC = 0; // Unspecified. | ||
public const sa_family_t AF_UNIX = 1; // Local to host. | ||
public const sa_family_t AF_INET = 2; // IP protocol family. | ||
public const sa_family_t AF_INET6 = 30; // IP version 6. | ||
|
||
// NOTE: this type is incomplete, and its values should never be used directly. | ||
// Specific sockaddr types (e.g. sockaddr_in or sockaddr_in6) should be used instead. | ||
public unsafe struct sockaddr | ||
{ | ||
// Disable CS0649: Field 'Interop.libc.sockaddr.sa_family' is never assigned to, | ||
// and will always have its default value 0 | ||
#pragma warning disable 649 | ||
public byte sa_len; | ||
public sa_family_t sa_family; | ||
#pragma warning restore 649 | ||
} | ||
|
||
public struct in_addr | ||
{ | ||
public uint s_addr; // Address in network byte order. | ||
} | ||
|
||
public struct sockaddr_in | ||
{ | ||
public const int Size = 16; | ||
|
||
public byte sin_len; // sizeof(sockaddr_in) | ||
public sa_family_t sin_family; // Address family: AF_INET | ||
public in_port_t sin_port; // Port in network byte order | ||
public in_addr sin_addr; // Internet address | ||
private ulong padding; // 8 bytes of padding | ||
} | ||
|
||
public unsafe struct in6_addr | ||
{ | ||
public fixed byte s6_addr[16]; // IPv6 address | ||
} | ||
|
||
public struct sockaddr_in6 | ||
{ | ||
public const int Size = 28; | ||
|
||
public byte sin6_len; // sizeof(sockaddr_in6) | ||
public sa_family_t sin6_family; // AF_INET6 | ||
public in_port_t sin6_port; // Port number | ||
public uint sin6_flowinfo; // IPv6 flow information | ||
public in6_addr sin6_addr; // IPv6 address | ||
public uint sin6_scope_id; // Scope ID | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.