-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to specify file preallocation size (#51111)
Co-authored-by: Carlos Sanchez <[email protected]> Co-authored-by: David Cantú <[email protected]>
- Loading branch information
1 parent
29965d2
commit 4e4b8bf
Showing
48 changed files
with
958 additions
and
114 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAllocate.cs
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,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Sys | ||
{ | ||
/// <summary> | ||
/// Returns -1 on ENOSPC, -2 on EFBIG. On success or ignorable error, 0 is returned. | ||
/// </summary> | ||
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAllocate", SetLastError = false)] | ||
internal static extern int PosixFAllocate(SafeFileHandle fd, long offset, long length); | ||
} | ||
} |
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
75 changes: 75 additions & 0 deletions
75
src/libraries/Common/src/Interop/Windows/Interop.SECURITY_QUALITY_OF_SERVICE.cs
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,75 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
internal static partial class Interop | ||
{ | ||
/// <summary> | ||
/// <a href="https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-security_quality_of_service">SECURITY_QUALITY_OF_SERVICE</a> structure. | ||
/// Used to support client impersonation. Client specifies this to a server to allow | ||
/// it to impersonate the client. | ||
/// </summary> | ||
internal unsafe struct SECURITY_QUALITY_OF_SERVICE | ||
{ | ||
public uint Length; | ||
public ImpersonationLevel ImpersonationLevel; | ||
public ContextTrackingMode ContextTrackingMode; | ||
public BOOLEAN EffectiveOnly; | ||
|
||
public unsafe SECURITY_QUALITY_OF_SERVICE(ImpersonationLevel impersonationLevel, ContextTrackingMode contextTrackingMode, bool effectiveOnly) | ||
{ | ||
Length = (uint)sizeof(SECURITY_QUALITY_OF_SERVICE); | ||
ImpersonationLevel = impersonationLevel; | ||
ContextTrackingMode = contextTrackingMode; | ||
EffectiveOnly = effectiveOnly ? BOOLEAN.TRUE : BOOLEAN.FALSE; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379572.aspx">SECURITY_IMPERSONATION_LEVEL</a> enumeration values. | ||
/// [SECURITY_IMPERSONATION_LEVEL] | ||
/// </summary> | ||
public enum ImpersonationLevel : uint | ||
{ | ||
/// <summary> | ||
/// The server process cannot obtain identification information about the client and cannot impersonate the client. | ||
/// [SecurityAnonymous] | ||
/// </summary> | ||
Anonymous, | ||
|
||
/// <summary> | ||
/// The server process can obtain identification information about the client, but cannot impersonate the client. | ||
/// [SecurityIdentification] | ||
/// </summary> | ||
Identification, | ||
|
||
/// <summary> | ||
/// The server process can impersonate the client's security context on it's local system. | ||
/// [SecurityImpersonation] | ||
/// </summary> | ||
Impersonation, | ||
|
||
/// <summary> | ||
/// The server process can impersonate the client's security context on remote systems. | ||
/// [SecurityDelegation] | ||
/// </summary> | ||
Delegation | ||
} | ||
|
||
/// <summary> | ||
/// <a href="https://msdn.microsoft.com/en-us/library/cc234317.aspx">SECURITY_CONTEXT_TRACKING_MODE</a> | ||
/// </summary> | ||
public enum ContextTrackingMode : byte | ||
{ | ||
/// <summary> | ||
/// The server is given a snapshot of the client's security context. | ||
/// [SECURITY_STATIC_TRACKING] | ||
/// </summary> | ||
Static = 0x00, | ||
|
||
/// <summary> | ||
/// The server is continually updated with changes. | ||
/// [SECURITY_DYNAMIC_TRACKING] | ||
/// </summary> | ||
Dynamic = 0x01 | ||
} | ||
} |
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
Oops, something went wrong.