1053 references to Interop
System.Private.CoreLib (1053)
LibraryImports.g.cs (122)
369private static extern partial void GetEnumValuesAndNames(global::System.Runtime.CompilerServices.QCallTypeHandle enumType, global::System.Runtime.CompilerServices.ObjectHandleOnStack values, global::System.Runtime.CompilerServices.ObjectHandleOnStack names, global::Interop.BOOL getNames); 1993private static extern partial global::Interop.BOOL CanCastTo_NoCacheLookup(void* fromTypeHnd, void* toTypeHnd); 2689private static extern partial void GetActivationInfo(global::System.Runtime.CompilerServices.ObjectHandleOnStack pRuntimeType, delegate*<void*, object> * ppfnAllocator, void** pvAllocatorFirstArg, delegate*<object, void> * ppfnRefCtor, delegate*<ref byte, void> * ppfnValueCtor, global::Interop.BOOL* pfCtorIsPublic); 2729private static partial global::Interop.BOOL GetFields(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Span<nint> data, ref int usedCount) 2731global::Interop.BOOL __retVal; 2742static extern unsafe global::Interop.BOOL __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native, nint* __data_native, int* __usedCount_native); 2861internal static extern partial void GetInstantiation(global::System.Runtime.CompilerServices.QCallTypeHandle type, global::System.Runtime.CompilerServices.ObjectHandleOnStack types, global::Interop.BOOL fAsRuntimeTypeArray); 2937private static extern partial global::Interop.BOOL SatisfiesConstraints(global::System.Runtime.CompilerServices.QCallTypeHandle paramType, global::System.Runtime.CompilerServices.QCallTypeHandle pTypeContext, global::System.RuntimeMethodHandleInternal pMethodContext, global::System.Runtime.CompilerServices.QCallTypeHandle toType); 2961internal static extern partial global::Interop.BOOL IsCAVisibleFromDecoratedType(global::System.Runtime.CompilerServices.QCallTypeHandle attrTypeHandle, global::System.RuntimeMethodHandleInternal attrCtor, global::System.Runtime.CompilerServices.QCallTypeHandle sourceTypeHandle, global::System.Runtime.CompilerServices.QCallModule sourceModule); 2977private static extern partial void InvokeMethod(global::System.Runtime.CompilerServices.ObjectHandleOnStack target, void** arguments, global::System.Runtime.CompilerServices.ObjectHandleOnStack sig, global::Interop.BOOL isConstructor, global::System.Runtime.CompilerServices.ObjectHandleOnStack result); 2985private static extern partial void GetMethodInstantiation(global::System.RuntimeMethodHandleInternal method, global::System.Runtime.CompilerServices.ObjectHandleOnStack types, global::Interop.BOOL fAsRuntimeTypeArray); 3234private static extern partial global::Interop.BOOL AreEqual(void* sig1, int csig1, global::System.Runtime.CompilerServices.QCallTypeHandle type1, void* sig2, int csig2, global::System.Runtime.CompilerServices.QCallTypeHandle type2); 3242private static extern partial void GetCustomModifiersAtOffset(global::System.Runtime.CompilerServices.ObjectHandleOnStack sigObj, int offset, global::Interop.BOOL required, global::System.Runtime.CompilerServices.ObjectHandleOnStack result); 3472private static unsafe extern partial global::Interop.BOOL StartInternal(global::System.Threading.ThreadHandle t, int stackSize, int priority, global::Interop.BOOL isThreadPool, char* pThreadName, global::System.Runtime.CompilerServices.ObjectHandleOnStack exception); 3496private static extern partial global::Interop.BOOL YieldInternal(); 3539private static extern partial global::Interop.BOOL GetIsBackground(global::System.Threading.ThreadHandle t); 3547private static extern partial void SetIsBackground(global::System.Threading.ThreadHandle t, global::Interop.BOOL value); 3859private static unsafe extern partial void ProcessAttributes(global::System.Runtime.CompilerServices.QCallAssembly assembly, global::System.Runtime.CompilerServices.QCallTypeHandle groupType, delegate* unmanaged<global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext*, global::System.Runtime.InteropServices.TypeMapLazyDictionary.ProcessAttributesCallbackArg*, global::Interop.BOOL> newExternalTypeEntry, delegate* unmanaged<global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext*, global::System.Runtime.InteropServices.TypeMapLazyDictionary.ProcessAttributesCallbackArg*, global::Interop.BOOL> newProxyTypeEntry, delegate* unmanaged<global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext*, global::Interop.BOOL> newPrecachedExternalTypeMap, delegate* unmanaged<global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext*, global::Interop.BOOL> newPrecachedProxyTypeMap, global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext* context); 3955internal static unsafe partial global::Interop.Globalization.ResultCode GetCalendarInfo(string localeName, global::System.Globalization.CalendarId calendarId, global::System.Globalization.CalendarDataType calendarDataType, char* result, int resultCapacity) 3957global::Interop.Globalization.ResultCode __retVal; 3967static extern unsafe global::Interop.Globalization.ResultCode __PInvoke(ushort* __localeName_native, global::System.Globalization.CalendarId __calendarId_native, global::System.Globalization.CalendarDataType __calendarDataType_native, char* __result_native, int __resultCapacity_native); 4108internal static unsafe partial global::Interop.Globalization.ResultCode GetSortHandle(string localeName, out nint sortHandle) 4112global::Interop.Globalization.ResultCode __retVal = default; 4136static extern unsafe global::Interop.Globalization.ResultCode __PInvoke(byte* __localeName_native, nint* __sortHandle_native); 4594internal static unsafe partial global::Interop.Globalization.ResultCode GetTimeZoneDisplayName(string localeName, string timeZoneId, global::Interop.Globalization.TimeZoneDisplayNameType type, char* result, int resultLength) 4596global::Interop.Globalization.ResultCode __retVal; 4607static extern unsafe global::Interop.Globalization.ResultCode __PInvoke(ushort* __localeName_native, ushort* __timeZoneId_native, global::Interop.Globalization.TimeZoneDisplayNameType __type_native, char* __result_native, int __resultLength_native); 4765internal static unsafe partial int FindStringOrdinal(uint dwFindStringOrdinalFlags, char* lpStringSource, int cchSource, char* lpStringValue, int cchValue, global::Interop.BOOL bIgnoreCase) 4779static extern unsafe int __PInvoke(uint __dwFindStringOrdinalFlags_native, char* __lpStringSource_native, int __cchSource_native, char* __lpStringValue_native, int __cchValue_native, global::Interop.BOOL __bIgnoreCase_native); 4810internal static unsafe extern partial global::Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer); 4839internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged<char*, uint, void*, global::Interop.BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, nint reserved) 4852static extern unsafe int __PInvoke(delegate* unmanaged<char*, uint, void*, global::Interop.BOOL> __lpLocaleEnumProcEx_native, uint __dwFlags_native, void* __lParam_native, nint __reserved_native); 4861internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged<char*, void*, global::Interop.BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam) 4876static extern unsafe int __PInvoke(delegate* unmanaged<char*, void*, global::Interop.BOOL> __lpTimeFmtEnumProcEx_native, ushort* __lpLocaleName_native, uint __dwFlags_native, void* __lParam_native); 4945internal static unsafe partial bool EnumCalendarInfoExEx(delegate* unmanaged<char*, uint, nint, void*, global::Interop.BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, void* lParam) 4961static extern unsafe int __PInvoke(delegate* unmanaged<char*, uint, nint, void*, global::Interop.BOOL> __pCalInfoEnumProcExEx_native, ushort* __lpLocaleName_native, uint __Calendar_native, ushort* __lpReserved_native, uint __CalType_native, void* __lParam_native); 4970internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, global::Interop.Kernel32.NlsVersionInfoEx* lpVersionInformation) 4985static extern unsafe int __PInvoke(int __function_native, ushort* __localeName_native, global::Interop.Kernel32.NlsVersionInfoEx* __lpVersionInformation_native); 5067internal static unsafe partial global::Interop.BOOL IsNormalizedString(global::System.Text.NormalizationForm normForm, char* source, int length) 5070global::Interop.BOOL __retVal; 5081static extern unsafe global::Interop.BOOL __PInvoke(global::System.Text.NormalizationForm __normForm_native, char* __source_native, int __length_native); 5113internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath, global::Interop.HostPolicy.corehost_resolve_component_dependencies_result_fn result) 5177internal static unsafe partial nint CreateProvider(string providerName, delegate* unmanaged<byte*, int, byte, long, long, global::Interop.Advapi32.EVENT_FILTER_DESCRIPTOR*, void*, void> callbackFunc, void* callbackContext) 5189static extern unsafe nint __PInvoke(ushort* __providerName_native, delegate* unmanaged<byte*, int, byte, long, long, global::Interop.Advapi32.EVENT_FILTER_DESCRIPTOR*, void*, void> __callbackFunc_native, void* __callbackContext_native); 5590internal static unsafe extern partial global::Interop.BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock); 5627internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno); 5635internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error); 5651internal static partial int Access(string path, global::Interop.Sys.AccessMode mode) 5680static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.AccessMode __mode_native); 6221internal static partial bool FileSystemSupportsLocking(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, global::Interop.Sys.LockOperations lockOperation, bool accessWrite) 6252static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.LockOperations __lockOperation_native, int __accessWrite_native); 6261internal static partial int FLock(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, global::Interop.Sys.LockOperations operation) 6290static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.LockOperations __operation_native); 6299internal static partial int FLock(nint fd, global::Interop.Sys.LockOperations operation) 6313static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.LockOperations __operation_native); 6398internal static partial double GetCpuUtilization(ref global::Interop.Sys.ProcessCpuInformation previousCpuInfo) 6402fixed (global::Interop.Sys.ProcessCpuInformation* __previousCpuInfo_native = &previousCpuInfo) 6410static extern unsafe double __PInvoke(global::Interop.Sys.ProcessCpuInformation* __previousCpuInfo_native); 6419internal static unsafe partial int Pipe(int* pipefd, global::Interop.Sys.PipeFlags flags) 6433static extern unsafe int __PInvoke(int* __pipefd_native, global::Interop.Sys.PipeFlags __flags_native); 6827internal static partial int LockFileRegion(global::System.Runtime.InteropServices.SafeHandle fd, long offset, long length, global::Interop.Sys.LockType lockType) 6856static extern unsafe int __PInvoke(nint __fd_native, long __offset_native, long __length_native, global::Interop.Sys.LockType __lockType_native); 6951internal static partial long LSeek(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset, global::Interop.Sys.SeekWhence whence) 6980static extern unsafe long __PInvoke(nint __fd_native, long __offset_native, global::Interop.Sys.SeekWhence __whence_native); 7129internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset) 7158static extern unsafe nint __PInvoke(nint __addr_native, ulong __len_native, global::Interop.Sys.MemoryMappedProtections __prot_native, global::Interop.Sys.MemoryMappedFlags __flags_native, nint __fd_native, long __offset_native); 7167internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, nint fd, long offset) 7181static extern unsafe nint __PInvoke(nint __addr_native, ulong __len_native, global::Interop.Sys.MemoryMappedProtections __prot_native, global::Interop.Sys.MemoryMappedFlags __flags_native, nint __fd_native, long __offset_native); 7221internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle Open(string filename, global::Interop.Sys.OpenFlags flags, int mode) 7265static extern unsafe nint __PInvoke(byte* __filename_native, global::Interop.Sys.OpenFlags __flags_native, int __mode_native); 7274private static partial int PathConf(string path, global::Interop.Sys.PathConfName name) 7303static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native); 7312internal static partial int PosixFAdvise(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset, long length, global::Interop.Sys.FileAdvice advice) 7337static extern unsafe int __PInvoke(nint __fd_native, long __offset_native, long __length_native, global::Interop.Sys.FileAdvice __advice_native); 7422internal static unsafe partial long ReadV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount) 7451static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native); 7460internal static unsafe partial long PReadV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset) 7489static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native, long __fileOffset_native); 7536internal static unsafe partial long PWriteV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset) 7565static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native, long __fileOffset_native); 7650internal static unsafe partial long WriteV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount) 7679static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native); 7726internal static unsafe extern partial int ReadDir(nint dir, global::Interop.Sys.DirectoryEntry* outputEntry); 7886internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 7899fixed (global::Interop.Sys.FileStatus* __output_native = &output) 7918static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native); 7927internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output) 7940fixed (global::Interop.Sys.FileStatus* __output_native = &output) 7959static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 7968internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output) 7981fixed (global::Interop.Sys.FileStatus* __output_native = &output) 8000static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 8009internal static partial int Stat(global::System.ReadOnlySpan<char> path, out global::Interop.Sys.FileStatus output) 8022fixed (global::Interop.Sys.FileStatus* __output_native = &output) 8041static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 8050internal static partial int LStat(global::System.ReadOnlySpan<char> path, out global::Interop.Sys.FileStatus output) 8063fixed (global::Interop.Sys.FileStatus* __output_native = &output) 8082static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 8134internal static partial long SysConf(global::Interop.Sys.SysConfName name) 8148static extern unsafe long __PInvoke(global::Interop.Sys.SysConfName __name_native); 8157internal static partial void SysLog(global::Interop.Sys.SysLogPriority priority, string message, string arg1) 8185static extern unsafe void __PInvoke(global::Interop.Sys.SysLogPriority __priority_native, byte* __message_native, byte* __arg1_native); 8262internal static unsafe partial int UTimensat(string path, global::Interop.Sys.TimeSpec* times) 8291static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.TimeSpec* __times_native); 8300internal static unsafe partial int FUTimens(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.TimeSpec* times) 8329static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.TimeSpec* __times_native); 8476internal static unsafe partial int GetPwUidR(uint uid, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen) 8481fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd) 8489static extern unsafe int __PInvoke(uint __uid_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native); 8498internal static unsafe partial int GetPwNamR(string name, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen) 8510fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd) 8526static extern unsafe int __PInvoke(byte* __name_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native);
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 141get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 146return Interop.Sys.StrError(RawErrno); 220public static Interop.ErrorInfo Info(this Interop.Error error) 222return new Interop.ErrorInfo(error);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
16throw Interop.GetExceptionForIoErrno(errorInfo, path, isDirError); 21if (error != Interop.Error.SUCCESS) 99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 183internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.DynamicLoad.cs (5)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)] 14[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetLoadLibraryError")] 17[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")] 20[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)] 23[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ErrNo.cs (2)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")] 15[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (3)
63ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 64if (errorInfo.Error == Interop.Error.ERANGE) 68throw Interop.GetExceptionForIoErrno(errorInfo);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetEnv.cs (1)
11[LibraryImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetEnviron.cs (2)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")] 14[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (5)
37const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 64Interop.Sys.Passwd passwd; 65int error = Interop.Sys.GetPwUidR(uid, out passwd, buf, bufLen); 83var errorInfo = new Interop.ErrorInfo(error); 87if (errorInfo.Error == Interop.Error.ERANGE)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetRandomBytes.cs (2)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] 14[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSystemTimeAsTicks.cs (1)
10[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (3)
30rv = Interop.Sys.GetGroups(groups.Length, pGroups); 38else if (rv == -1 && Interop.Sys.GetLastError() == Interop.Error.EINVAL)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MemAlloc.cs (7)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")] 14[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")] 17[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")] 20[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")] 23[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")] 26[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")] 29[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")]
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MountPoints.cs (4)
44if (File.Exists(Interop.procfs.ProcMountInfoFilePath)) 48using StreamReader reader = new(Interop.procfs.ProcMountInfoFilePath); 53if (Interop.procfs.TryParseMountInfoLine(line, out Interop.procfs.ParsedMount mount))
src\libraries\Common\src\Interop\Unix\System.Native\Interop.SchedGetCpu.cs (1)
11[LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")]
src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (2)
18Interop.Sys.Log(pBytes, bytes.Length); 30Interop.Sys.LogError(pBytes, bytes.Length);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (116)
64if (Interop.Sys.Fcntl.GetIsNonBlocking(this, out bool isNonBlocking) != 0) 66throw Interop.GetExceptionForIoErrno(Interop.Sys.GetLastErrorInfo(), Path); 110private static SafeFileHandle Open(string path, Interop.Sys.OpenFlags flags, int mode, bool failForSymlink, out bool wasSymlink, 111Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException) 115SafeFileHandle handle = Interop.Sys.Open(path, flags, mode); 120Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 123if (failForSymlink && error.Error == Interop.Error.ELOOP) 134if (error.Error == Interop.Error.EISDIR) 136error = Interop.Error.EACCES.Info(); 139Interop.CheckIo(error.Error, path); 156Interop.Sys.Unlink(_path); // ignore errors; it's valid that the path may no longer exist 166Interop.Sys.FLock(handle, Interop.Sys.LockOperations.LOCK_UN); // ignore any errors 171return Interop.Sys.Close(handle) == 0; 189Interop.Sys.PipeFlags flags = Interop.Sys.PipeFlags.O_CLOEXEC; 192flags |= Interop.Sys.PipeFlags.O_NONBLOCK_READ; 197flags |= Interop.Sys.PipeFlags.O_NONBLOCK_WRITE; 204if (Interop.Sys.Pipe(fds, flags) != 0) 206Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 209throw Interop.GetExceptionForIoErrno(error); 212readFd = fds[Interop.Sys.ReadEndOfPipe]; 213writeFd = fds[Interop.Sys.WriteEndOfPipe]; 236Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 242Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 249Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 252Interop.Sys.OpenFlags openFlags = PreOpenConfigurationFromOptions(mode, access, share, options, failForSymlink); 295private static Interop.Sys.OpenFlags PreOpenConfigurationFromOptions(FileMode mode, FileAccess access, FileShare share, FileOptions options, bool failForSymlink) 298Interop.Sys.OpenFlags flags = default; 301flags |= Interop.Sys.OpenFlags.O_NOFOLLOW; 313flags |= Interop.Sys.OpenFlags.O_TRUNC; 319flags |= Interop.Sys.OpenFlags.O_CREAT; 323flags |= Interop.Sys.OpenFlags.O_CREAT; 326flags |= Interop.Sys.OpenFlags.O_TRUNC; 331flags |= (Interop.Sys.OpenFlags.O_CREAT | Interop.Sys.OpenFlags.O_EXCL); 339flags |= Interop.Sys.OpenFlags.O_RDONLY; 343flags |= Interop.Sys.OpenFlags.O_RDWR; 347flags |= Interop.Sys.OpenFlags.O_WRONLY; 354flags |= Interop.Sys.OpenFlags.O_CLOEXEC; 366flags |= Interop.Sys.OpenFlags.O_SYNC; 375Interop.Sys.FileStatus status = default; 387if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 389throw Interop.GetExceptionForIoErrno(Interop.Error.EACCES.Info(), path); 392if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFREG) 401Debug.Assert(status.Size == 0 || Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 416Interop.Sys.LockOperations lockOperation = (share == FileShare.None) ? Interop.Sys.LockOperations.LOCK_EX : Interop.Sys.LockOperations.LOCK_SH; 417if (CanLockTheFile(lockOperation, access) && !(_isLocked = Interop.Sys.FLock(this, lockOperation | Interop.Sys.LockOperations.LOCK_NB) >= 0)) 423Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 424if (errorInfo.Error == Interop.Error.EWOULDBLOCK) 426throw Interop.GetExceptionForIoErrno(errorInfo, path); 443Interop.Sys.FileStatus pathStatus; 444if (Interop.Sys.Stat(path, out pathStatus) < 0) 449Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 451if (error.Error == Interop.Error.ENOENT) 456throw Interop.GetExceptionForIoErrno(error, path); 471Interop.Sys.FileAdvice fadv = 472(options & FileOptions.RandomAccess) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_RANDOM : 473(options & FileOptions.SequentialScan) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_SEQUENTIAL : 477FileStreamHelpers.CheckFileCall(Interop.Sys.PosixFAdvise(this, 0, 0, fadv), path, 485if (Interop.Sys.FTruncate(this, 0) < 0) 487Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 488if (errorInfo.Error != Interop.Error.EBADF && errorInfo.Error != Interop.Error.EINVAL) 493throw Interop.GetExceptionForIoErrno(errorInfo, path); 498if (preallocationSize > 0 && Interop.Sys.FAllocate(this, 0, preallocationSize) < 0) 500Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 503if (errorInfo.Error == Interop.Error.EFBIG || 504errorInfo.Error == Interop.Error.ENOSPC) 510Interop.Sys.Unlink(path); 512throw new IOException(SR.Format(errorInfo.Error == Interop.Error.EFBIG 522private bool CanLockTheFile(Interop.Sys.LockOperations lockOperation, FileAccess access) 524Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 531return Interop.Sys.FileSystemSupportsLocking(this, lockOperation, accessWrite: (access & FileAccess.Write) != 0); 534private void FStatCheckIO(string path, ref Interop.Sys.FileStatus status, ref bool statusHasValue) 538if (Interop.Sys.FStat(this, out status) != 0) 540Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 541throw Interop.GetExceptionForIoErrno(error, path); 556_canSeek = canSeek = Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0 ? NullableBool.True : NullableBool.False; 564int result = Interop.Sys.FStat(this, out Interop.Sys.FileStatus status); 567Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 568throw Interop.GetExceptionForIoErrno(error, Path); 574private static FileHandleType MapUnixFileTypeToFileType(Interop.Sys.FileStatus status) 575=> (status.Mode & Interop.Sys.FileTypes.S_IFMT) switch 577Interop.Sys.FileTypes.S_IFREG => FileHandleType.RegularFile, 578Interop.Sys.FileTypes.S_IFDIR => FileHandleType.Directory, 579Interop.Sys.FileTypes.S_IFLNK => FileHandleType.SymbolicLink, 580Interop.Sys.FileTypes.S_IFIFO => FileHandleType.Pipe, 581Interop.Sys.FileTypes.S_IFSOCK => FileHandleType.Socket, 582Interop.Sys.FileTypes.S_IFCHR => FileHandleType.CharacterDevice, 583Interop.Sys.FileTypes.S_IFBLK => FileHandleType.BlockDevice, 589int result = Interop.Sys.FStat(this, out Interop.Sys.FileStatus status);
src\libraries\System.Private.CoreLib\src\System\AppDomain.Unix.cs (2)
12Interop.Sys.ProcessCpuInformation cpuInfo = default; 13Interop.Sys.GetCpuUtilization(ref cpuInfo);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\RandomizedStringEqualityComparer.cs (1)
26Interop.GetRandomBytes((byte*)seed, sizeof(MarvinSeed));
src\libraries\System.Private.CoreLib\src\System\DateTime.Unix.cs (1)
14return new DateTime(((ulong)(Interop.Sys.GetSystemTimeAsTicks() + UnixEpochTicks)) | KindUtc);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.Unix.cs (3)
56Interop.Sys.SysLog(Interop.Sys.SysLogPriority.LOG_DEBUG, "%s", message); 89int bytesWritten = Interop.Sys.Write((IntPtr)2 /* stderr */, buf + totalBytesWritten, bufCount);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Stopwatch.Unix.cs (1)
14public static long GetTimestamp() => Interop.Sys.GetTimestamp();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.Internal.cs (1)
35delegate* unmanaged<byte*, int, byte, long, long, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR*, void*, void> callbackFunc,
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (4)
28Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData) 66long matchAnyKeywords, long matchAllKeywords, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, void* callbackContext) 138internal override int ActivityIdControl(Interop.Advapi32.ActivityControl controlCode, ref Guid activityId) 152internal static int EventActivityIdControl(Interop.Advapi32.ActivityControl controlCode, ref Guid activityId)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (7)
1163Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData) 1249internal virtual int ActivityIdControl(Interop.Advapi32.ActivityControl ControlCode, ref Guid ActivityId) 1270Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData) 1277if (controlCode == Interop.Advapi32.EVENT_CONTROL_CODE_ENABLE_PROVIDER) 1285if (controlCode == Interop.Advapi32.EVENT_CONTROL_CODE_DISABLE_PROVIDER) 1289else if (controlCode == Interop.Advapi32.EVENT_CONTROL_CODE_CAPTURE_STATE) 1345protected unsafe bool MarshalFilterData(Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, out ControllerCommand command, out byte[]? data)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (3)
610Interop.Advapi32.ActivityControl.EVENT_ACTIVITY_CTRL_SET_ID, 642Interop.Advapi32.ActivityControl.EVENT_ACTIVITY_CTRL_GET_ID, 686Interop.Advapi32.ActivityControl.EVENT_ACTIVITY_CTRL_GET_SET_ID,
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs (2)
8private static Interop.Sys.ProcessCpuInformation s_cpuInfo; 11Interop.Sys.GetCpuUtilization(ref s_cpuInfo) / Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (4)
30Interop.Sys.Access(path, Interop.Sys.AccessMode.R_OK) == 0) 185if (Interop.Sys.Access(userDirsPath, Interop.Sys.AccessMode.R_OK) == 0)
src\libraries\System.Private.CoreLib\src\System\Environment.Linux.cs (3)
10public static long WorkingSet => (long)(Interop.procfs.TryReadStatusFile(Interop.procfs.ProcPid.Self, out Interop.procfs.ParsedStatus status) ? status.VmRSS : 0);
src\libraries\System.Private.CoreLib\src\System\Environment.OSVersion.Unix.cs (1)
8private static OperatingSystem GetOSVersion() => GetOperatingSystem(Interop.Sys.GetUnixRelease());
src\libraries\System.Private.CoreLib\src\System\Environment.Unix.cs (7)
15public static string[] GetLogicalDrives() => Interop.Sys.GetAllMountPoints(); 21string hostName = Interop.Sys.GetHostName(); 27public static string UserName => Interop.Sys.GetUserNameFromPasswd(Interop.Sys.GetEUid()); 29private static bool IsPrivilegedProcessCore() => Interop.Sys.GetEUid() == 0; 32private static int GetProcessId() => Interop.Sys.GetPid(); 35private static string? GetProcessPath() => Interop.Sys.GetProcessPath();
src\libraries\System.Private.CoreLib\src\System\Environment.UnixOrBrowser.cs (14)
20get => Interop.Sys.GetCwd(); 21set => Interop.CheckIo(Interop.Sys.ChDir(value), value, isDirError: true); 56private static int GetSystemPageSize() => CheckedSysConf(Interop.Sys.SysConfName._SC_PAGESIZE); 60/// <summary>Invoke <see cref="Interop.Sys.SysConf"/>, throwing if it fails.</summary> 61private static int CheckedSysConf(Interop.Sys.SysConfName name) 63long result = Interop.Sys.SysConf(name); 66Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); 67throw errno.Error == Interop.Error.EINVAL ? 69Interop.GetIOException(errno); 86Interop.Sys.ProcessCpuInformation cpuInfo = default; 87Interop.Sys.GetCpuUtilization(ref cpuInfo); 99public static long TickCount64 => Interop.Sys.GetLowResolutionTimestamp();
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (12)
18while ((length = Interop.Kernel32.GetEnvironmentVariable(variable, ref builder.GetPinnableReference(), (uint)builder.Capacity)) > builder.Capacity) 23if (length == 0 && Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_ENVVAR_NOT_FOUND) 37uint length = Interop.Kernel32.GetEnvironmentVariable(variable, ref MemoryMarshal.GetReference(span), (uint)span.Length); 45if (!Interop.Kernel32.SetEnvironmentVariable(variable, value)) 50case Interop.Errors.ERROR_ENVVAR_NOT_FOUND: 54case Interop.Errors.ERROR_FILENAME_EXCED_RANGE: 59case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: 60case Interop.Errors.ERROR_NO_SYSTEM_RESOURCES: 84char* stringPtr = Interop.Kernel32.GetEnvironmentStringsW(); 129Interop.BOOL success = Interop.Kernel32.FreeEnvironmentStringsW(stringPtr); 130Debug.Assert(success != Interop.BOOL.FALSE);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (4)
102count = Interop.Globalization.GetCalendars(localeName, calendars, calendars.Length); 127return Interop.CallStringMethod( 132return Interop.Globalization.GetCalendarInfo(locale, id, type, bufferPtr, buffer.Length); 437return Interop.Globalization.EnumCalendarInfo(&EnumCalendarInfoCallback, localeName, calendarId, dataType, (IntPtr)callbackContext);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (8)
30return Interop.Kernel32.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType | CAL_RETURN_NUMBER, IntPtr.Zero, 0, out data) != 0; 40int ret = Interop.Kernel32.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType, (IntPtr)buffer, BUFFER_LENGTH, IntPtr.Zero); 64private static unsafe Interop.BOOL EnumCalendarInfoCallback(char* lpCalendarInfoString, uint calendar, IntPtr pReserved, void* lParam) 78return Interop.BOOL.TRUE; 82return Interop.BOOL.FALSE; 97private static unsafe Interop.BOOL EnumCalendarsCallback(char* lpCalendarInfoString, uint calendar, IntPtr reserved, void* lParam) 106return Interop.BOOL.TRUE; 110return Interop.BOOL.FALSE;
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (25)
63return Interop.Globalization.CompareString(_sortHandle, pString1, string1.Length, pString2, string2.Length, options); 93return Interop.Globalization.IndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr); 95return Interop.Globalization.LastIndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr); 215return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr); 217return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr); 310return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr); 312return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr); 342return Interop.Globalization.StartsWith(_sortHandle, pPrefix, prefix.Length, pSource, source.Length, options, matchLengthPtr); 426return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr); 499return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr); 529return Interop.Globalization.EndsWith(_sortHandle, pSuffix, suffix.Length, pSource, source.Length, options, matchLengthPtr); 614return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr); 687return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr); 722sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options); 739if (Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKeyLength, options) != sortKeyLength) 778actualSortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pDest, destination.Length, options); 824return Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options); 891sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options); 914sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options); 958int sortVersion = Interop.Globalization.GetSortVersion(_sortHandle); 978Interop.Globalization.ResultCode resultCode = Interop.Globalization.GetSortHandle(sortName, out result); 980if (resultCode == Interop.Globalization.ResultCode.OutOfMemory) 982else if (resultCode != Interop.Globalization.ResultCode.Success) 991Interop.Globalization.CloseSortHandle(result);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (25)
27int ret = Interop.Kernel32.LCMapStringEx(cultureName, Interop.Kernel32.LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero); 35ret = Interop.Kernel32.LCMapStringEx(null, Interop.Kernel32.LCMAP_HASH, &a, 1, &hashValue, sizeof(int), null, null, handle); 61int ret = Interop.Kernel32.FindStringOrdinal( 67bIgnoreCase ? Interop.BOOL.TRUE : Interop.BOOL.FALSE); 72Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 128int sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 150if (Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 187int result = Interop.Kernel32.CompareStringOrdinal(char1, count1, char2, count2, bIgnoreCase: true); 225int result = Interop.Kernel32.CompareStringEx( 277int result = Interop.Kernel32.FindNLSStringEx( 292Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 387int sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 401if (Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 449actualSortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 464if (Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_INSUFFICIENT_BUFFER) 501sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, 529return Interop.Kernel32.IsNLSDefinedString(Interop.Kernel32.COMPARE_STRING, 0, IntPtr.Zero, pText, text.Length); 579Interop.Kernel32.NlsVersionInfoEx nlsVersion = default; 580nlsVersion.dwNLSVersionInfoSize = sizeof(Interop.Kernel32.NlsVersionInfoEx); 581Interop.Kernel32.GetNLSVersionEx(Interop.Kernel32.COMPARE_STRING, _sortName, &nlsVersion);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (9)
176if (!Interop.Globalization.GetLocaleName(localeName, buffer, ICU_ULOC_FULLNAME_CAPACITY)) 200if (!Interop.Globalization.GetDefaultLocaleName(buffer, ICU_ULOC_FULLNAME_CAPACITY)) 242bool result = Interop.Globalization.GetLocaleInfoString(localeName, (uint)type, buffer, ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY, uiCultureName); 267bool result = Interop.Globalization.GetLocaleInfoInt(_sWindowsName, (uint)type, ref value); 284bool result = Interop.Globalization.GetLocaleInfoGroupingSizes(_sWindowsName, (uint)type, ref primaryGroupingSize, ref secondaryGroupingSize); 321bool result = Interop.Globalization.GetLocaleTimeFormat(_sWindowsName, shortFormat, buffer, ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); 361return Interop.Globalization.IsPredefinedLocale(name); 537bufferLength = Interop.Globalization.GetLocales(null, 0); 555bufferLength = Interop.Globalization.GetLocales(chars, bufferLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (37)
34field |= Interop.Kernel32.LOCALE_RETURN_NUMBER; 45return Interop.Kernel32.GetLocaleInfoEx(lpLocaleName, lcType, lpLCData, cchData); 73lctype |= Interop.Kernel32.LOCALE_NOUSEROVERRIDE; 92return GetLocaleInfoExInt(name, Interop.Kernel32.LOCALE_ICONSTRUCTEDLOCALE) != 1; 99return ReescapeWin32String(GetLocaleInfoFromLCType(_sRealName, Interop.Kernel32.LOCALE_STIMEFORMAT, _bUseOverrides)); 107int result = GetLocaleInfoExInt(_sRealName, Interop.Kernel32.LOCALE_IFIRSTDAYOFWEEK | (!_bUseOverrides ? Interop.Kernel32.LOCALE_NOUSEROVERRIDE : 0)); 127Interop.Kernel32.EnumSystemLocalesEx(&EnumSystemLocalesProc, Interop.Kernel32.LOCALE_SPECIFICDATA | Interop.Kernel32.LOCALE_SUPPLEMENTAL, &context, IntPtr.Zero); 182lctype |= Interop.Kernel32.LOCALE_NOUSEROVERRIDE; 350private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) 356string? regionName = GetLocaleInfoEx(cultureName, Interop.Kernel32.LOCALE_SISO3166CTRYNAME); 360return Interop.BOOL.FALSE; // we found a match, then stop the enumeration 363return Interop.BOOL.TRUE; 367return Interop.BOOL.FALSE; 374private static unsafe Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) 379return Interop.BOOL.TRUE; 383return Interop.BOOL.FALSE; 396private static unsafe Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam) 401return Interop.BOOL.TRUE; 405return Interop.BOOL.FALSE; 415Interop.Kernel32.EnumTimeFormatsEx(&EnumTimeCallback, localeName, dwFlags, &data); 430uint lcType = (dwFlags == Interop.Kernel32.TIME_NOSECONDS) ? Interop.Kernel32.LOCALE_SSHORTTIME : Interop.Kernel32.LOCALE_STIMEFORMAT; 453return Interop.Kernel32.LocaleNameToLCID(cultureName, Interop.Kernel32.LOCALE_ALLOW_NEUTRAL_NAMES); 472flags |= Interop.Kernel32.LOCALE_NEUTRALDATA | Interop.Kernel32.LOCALE_SPECIFICDATA; 478flags |= Interop.Kernel32.LOCALE_NEUTRALDATA; 483flags |= Interop.Kernel32.LOCALE_SPECIFICDATA; 488flags |= Interop.Kernel32.LOCALE_SUPPLEMENTAL; 493flags |= Interop.Kernel32.LOCALE_SUPPLEMENTAL; 501Interop.Kernel32.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, flags, &context, IntPtr.Zero); 529Interop.Kernel32.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, Interop.Kernel32.LOCALE_REPLACEMENT, &context, IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\Globalization\GlobalizationMode.LoadICU.Unix.cs (1)
8private static int LoadICU() => Interop.Globalization.LoadICU();
src\libraries\System.Private.CoreLib\src\System\Globalization\GlobalizationMode.Unix.cs (1)
79Interop.Globalization.InitICUFunctions(icuucLib, icuinLib, version, suffix);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (9)
27actualLength = Interop.Globalization.ToAscii(flags, unicode, count, outputStack, estimatedLength); 35actualLength = Interop.Globalization.ToAscii(flags, unicode, count, Span<char>.Empty, 0); 43actualLength = Interop.Globalization.ToAscii(flags, unicode, count, outputHeap, actualLength); 60int actualLength = Interop.Globalization.ToAscii(flags, unicode, unicode.Length, destination, destination.Length); 104int realLen = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, output, output.Length); 131int actualLength = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, destination, destination.Length); 153(AllowUnassigned ? Interop.Globalization.AllowUnassigned : 0) | 154(UseStd3AsciiRules ? Interop.Globalization.UseStd3AsciiRules : 0); 168if ((flags & Interop.Globalization.UseStd3AsciiRules) == 0)
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (11)
21int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, Span<char>.Empty, 0); 46int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, output, output.Length); 63int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, Span<char>.Empty, 0); 76int actualLength = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, destination, destination.Length); 95int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, Span<char>.Empty, 0); 120int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, output, output.Length); 137int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, Span<char>.Empty, 0); 150int actualLength = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, destination, destination.Length); 165(AllowUnassigned ? Interop.Normaliz.IDN_ALLOW_UNASSIGNED : 0) | 166(UseStd3AsciiRules ? Interop.Normaliz.IDN_USE_STD3_ASCII_RULES : 0); 177lastError == Interop.Errors.ERROR_INVALID_NAME ? SR.Argument_IdnIllegalName :
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (2)
47latestEra = Interop.Globalization.GetLatestJapaneseEra(); 163result = Interop.Globalization.GetJapaneseEraStartDate(era, out startYear, out startMonth, out startDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (4)
35ret = Interop.Globalization.IsNormalized(normalizationForm, pInput, source.Length); 78realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); 149realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length); 188realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, source.Length, null, 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (24)
21Interop.BOOL result; 24result = Interop.Normaliz.IsNormalizedString(normalizationForm, pInput, source.Length); 32return result != Interop.BOOL.FALSE; 65realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); 71case Interop.Errors.ERROR_SUCCESS: 78case Interop.Errors.ERROR_INSUFFICIENT_BUFFER: 92case Interop.Errors.ERROR_INVALID_PARAMETER: 93case Interop.Errors.ERROR_NO_UNICODE_TRANSLATION: 97case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: 136realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length); 142case Interop.Errors.ERROR_SUCCESS: 147case Interop.Errors.ERROR_INSUFFICIENT_BUFFER: 151case Interop.Errors.ERROR_INVALID_PARAMETER: 152case Interop.Errors.ERROR_NO_UNICODE_TRANSLATION: 156case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: 179realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, source.Length, null, 0); 185case Interop.Errors.ERROR_SUCCESS: 188case Interop.Errors.ERROR_INVALID_PARAMETER: 189case Interop.Errors.ERROR_NO_UNICODE_TRANSLATION: 193case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: 208case Interop.Errors.ERROR_SUCCESS: 211case Interop.Errors.ERROR_INVALID_PARAMETER: 212case Interop.Errors.ERROR_NO_UNICODE_TRANSLATION: 215case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY:
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (1)
426Interop.Globalization.InitOrdinalCasingPage(pageNumber, pTable);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Icu.cs (3)
28Interop.Globalization.ChangeCaseInvariant(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper); 38Interop.Globalization.ChangeCaseTurkish(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper); 42Interop.Globalization.ChangeCase(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (1)
27int ret = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _textInfoName,
src\libraries\System.Private.CoreLib\src\System\Guid.Unix.cs (1)
18Interop.GetCryptographicallySecureRandomBytes((byte*)&g, sizeof(Guid));
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (1)
74Interop.GetRandomBytes((byte*)&result, sizeof(uint));
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
48if (Interop.Sys.MkdTemp(pPath) is null) 50Interop.ThrowIOExceptionForLastError();
src\libraries\System.Private.CoreLib\src\System\IO\DriveInfoInternal.Unix.cs (1)
9internal static string[] GetLogicalDrives() => Interop.Sys.GetAllMountPoints();
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (7)
18private Interop.Sys.DirectoryEntry _directoryEntry; 34Interop.Sys.DirectoryEntry directoryEntry, 50bool isDirectory = directoryEntry.InodeType == Interop.Sys.NodeType.DT_DIR; 51bool isSymlink = directoryEntry.InodeType == Interop.Sys.NodeType.DT_LNK; 52bool isUnknown = directoryEntry.InodeType == Interop.Sys.NodeType.DT_UNKNOWN; 67entry._directoryEntry.InodeType = Interop.Sys.NodeType.DT_LNK; 164internal bool IsSymbolicLink => _directoryEntry.InodeType == Interop.Sys.NodeType.DT_LNK;
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (19)
27private Interop.Sys.DirectoryEntry _entry; 68private bool InternalContinueOnError(Interop.ErrorInfo info, bool ignoreNotFound = false) 71private static bool IsDirectoryNotFound(Interop.ErrorInfo info) 72=> info.Error == Interop.Error.ENOTDIR || info.Error == Interop.Error.ENOENT; 74private static bool IsAccessError(Interop.ErrorInfo info) 75=> info.Error == Interop.Error.EACCES || info.Error == Interop.Error.EBADF 76|| info.Error == Interop.Error.EPERM; 80IntPtr handle = Interop.Sys.OpenDir(path); 83Interop.ErrorInfo info = Interop.Sys.GetLastErrorInfo(); 88throw Interop.GetExceptionForIoErrno(info, path, isDirError: true); 97Interop.Sys.CloseDir(handle); 176fixed (Interop.Sys.DirectoryEntry* e = &_entry) 178result = Interop.Sys.ReadDir(_directoryHandle, e); 192if (InternalContinueOnError(new Interop.ErrorInfo(result))) 199throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(result), _currentPath, isDirError: true);
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.SetTimes.OtherUnix.cs (1)
22private static Interop.Error SetCreationTimeCore(SafeFileHandle? handle, string? path, long seconds, long nanoseconds) =>
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (52)
29private Interop.Sys.FileStatus _fileCache; 44return EntryExists && (_fileCache.UserFlags & (uint)Interop.Sys.UserFlags.UF_HIDDEN) == (uint)Interop.Sys.UserFlags.UF_HIDDEN; 106if (_fileCache.Uid == Interop.Sys.GetEUid()) 118if (Interop.Sys.IsMemberOfGroup(_fileCache.Gid)) 138return EntryExists && (_fileCache.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFLNK; 162if (!Interop.Sys.SupportsHiddenFlag) 246if (Interop.Sys.CanSetHiddenFlag) 251uint flags = hidden ? _fileCache.UserFlags | (uint)Interop.Sys.UserFlags.UF_HIDDEN : 252_fileCache.UserFlags & ~(uint)Interop.Sys.UserFlags.UF_HIDDEN; 253int rv = handle is not null ? Interop.Sys.FChflags(handle, flags) : 254Interop.Sys.LChflags(path!, flags); 255Interop.CheckIo(rv, path, asDirectory); 277int rv = handle is not null ? Interop.Sys.FChMod(handle, newMode) : 278Interop.Sys.ChMod(path!, newMode); 279Interop.CheckIo(rv, path, asDirectory); 304if ((_fileCache.Flags & Interop.Sys.FileStatusFlags.HasBirthTime) != 0) 392Interop.Sys.TimeSpec* buf = stackalloc Interop.Sys.TimeSpec[2]; 419? Interop.Sys.FUTimens(handle, buf) 420: Interop.Sys.UTimensat(path!, buf); 421Interop.CheckIo(rv, path, asDirectory); 431bool updateCreationTime = checkCreationTime && (_fileCache.Flags & Interop.Sys.FileStatusFlags.HasBirthTime) != 0 && 438Interop.Error error = SetCreationTimeCore(handle, path, _fileCache.BirthTime, _fileCache.BirthTimeNsec); 439if (error != Interop.Error.SUCCESS && error != Interop.Error.ENOTSUP) 441Interop.CheckIo(error, path, asDirectory); 486int rv = handle is not null ? Interop.Sys.FChMod(handle, (int)mode) 487: Interop.Sys.ChMod(path!, (int)mode); 488Interop.CheckIo(rv, path); 506Interop.Sys.FStat(handle, out _fileCache) : 507Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache); 511Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 515case Interop.Error.ENOENT: 518case Interop.Error.ENOTDIR: 531int fileType = _fileCache.Mode & Interop.Sys.FileTypes.S_IFMT; 532bool isDirectory = fileType == Interop.Sys.FileTypes.S_IFDIR; 534if (fileType == Interop.Sys.FileTypes.S_IFLNK) 536if (Interop.Sys.Stat(path, out Interop.Sys.FileStatus target) == 0) 538isDirectory = (target.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR; 541_fileCache.Mode = Interop.Sys.FileTypes.S_IFLNK | (target.Mode & (int)FileSystem.ValidUnixFileModes); 579throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(errno), new string(path)); 590Interop.Error error = _state == InitializedNotExistsNotADir ? Interop.Error.ENOTDIR : Interop.Error.ENOENT; 591throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(error), path);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (17)
16private static bool DirectoryExists(ReadOnlySpan<char> fullPath, out Interop.ErrorInfo errorInfo) 18Interop.Sys.FileStatus fileinfo; 19errorInfo = default(Interop.ErrorInfo); 21if (Interop.Sys.Stat(fullPath, out fileinfo) < 0) 23errorInfo = Interop.Sys.GetLastErrorInfo(); 27return (fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR; 35private static bool FileExists(ReadOnlySpan<char> fullPath, out Interop.ErrorInfo errorInfo) 37Interop.Sys.FileStatus fileinfo; 38errorInfo = default(Interop.ErrorInfo); 49if (Interop.Sys.LStat(fullPath, out fileinfo) < 0) 51errorInfo = Interop.Sys.GetLastErrorInfo(); 57if ((fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFLNK) 59if (Interop.Sys.Stat(fullPath, out fileinfo) < 0) 65return (fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) != Interop.Sys.FileTypes.S_IFDIR;
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (122)
51Interop.CheckIo(Interop.Sys.CopyFile(src, dst, fileLength)); 54private static Exception? CreateOpenExceptionForCopyFile(Interop.ErrorInfo error, Interop.Sys.OpenFlags flags, string path) 57if (error.Error == Interop.Error.EEXIST && DirectoryExists(path)) 77if (Interop.Sys.Link(sourceFullPath, destFullPath) >= 0) 87Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 88if (errorInfo.Error == Interop.Error.EXDEV || // rename fails across devices / mount points 89errorInfo.Error == Interop.Error.EACCES || 90errorInfo.Error == Interop.Error.EPERM || // permissions might not allow creating hard links even if a copy would work 91errorInfo.Error == Interop.Error.EOPNOTSUPP || // links aren't supported by the source file system 92errorInfo.Error == Interop.Error.EMLINK || // too many hard links to the source file 93errorInfo.Error == Interop.Error.ENOSYS) // the file system doesn't support link 101if (errorInfo.Error == Interop.Error.ENOENT) 105throw Interop.GetExceptionForIoErrno(errorInfo, destFullPath, isDirError: true); 109throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath); 112else if (errorInfo.Error == Interop.Error.EEXIST) 114throw Interop.GetExceptionForIoErrno(errorInfo, destFullPath); 117throw Interop.GetExceptionForIoErrno(errorInfo); 126Interop.CheckIo(Interop.Sys.LStat(sourceFullPath, out Interop.Sys.FileStatus sourceStat), sourceFullPath); 129if ((sourceStat.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 134Interop.Sys.FileStatus destStat; 135if (Interop.Sys.LStat(destFullPath, out destStat) == 0) 138if ((destStat.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 154if (Interop.Sys.Unlink(destBackupFullPath) != 0) 156Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); 157if (errno.Error != Interop.Error.ENOENT) 159throw Interop.GetExceptionForIoErrno(errno, destBackupFullPath); 170if (Interop.Sys.Stat(destFullPath, out _) != 0) 172Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); 173if (errno.Error == Interop.Error.ENOENT) 175throw Interop.GetExceptionForIoErrno(errno, destBackupFullPath); 181Interop.CheckIo(Interop.Sys.Rename(sourceFullPath, destFullPath)); 195if (Interop.Sys.Rename(sourceFullPath, destFullPath) < 0) 197Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 198if (errorInfo.Error == Interop.Error.EXDEV) // rename fails across devices / mount points 205throw Interop.GetExceptionForIoErrno(errorInfo, destFullPath); 224Interop.Sys.FileStatus sourceStat, destStat; 225if (Interop.Sys.LStat(sourceFullPath, out sourceStat) == 0 && // source file exists 226(Interop.Sys.LStat(destFullPath, out destStat) != 0 || // dest file does not exist 229Interop.Sys.Rename(sourceFullPath, destFullPath) == 0) // try the rename 241if (Interop.Sys.Unlink(fullPath) < 0) 243Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 246case Interop.Error.ENOENT: 252throw Interop.GetExceptionForIoErrno(errorInfo, fullPath, true); 255case Interop.Error.EROFS: 259Interop.ErrorInfo fileExistsError; 264fileExistsError.Error == Interop.Error.ENOENT) 269case Interop.Error.EISDIR: 270errorInfo = Interop.Error.EACCES.Info(); 273throw Interop.GetExceptionForIoErrno(errorInfo, fullPath); 296int result = Interop.Sys.MkDir(path, (int)unixCreateMode); 302Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 303if (errorInfo.Error == Interop.Error.EEXIST && DirectoryExists(fullPath)) 307else if (errorInfo.Error == Interop.Error.ENOENT) // Some parts of the path don't exist yet. 313throw Interop.GetExceptionForIoErrno(errorInfo, fullPath); 340int result = Interop.Sys.MkDir(mkdirPath, (int)DefaultUnixCreateDirectoryMode); 346Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 347if (errorInfo.Error == Interop.Error.ENOENT) 355else if (errorInfo.Error == Interop.Error.EEXIST) 363throw Interop.GetExceptionForIoErrno(errorInfo, mkdirPath.ToString()); 373int result = Interop.Sys.MkDir(mkdirPath, (int)mode); 376Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 377if (errorInfo.Error == Interop.Error.EEXIST) 392throw Interop.GetExceptionForIoErrno(errorInfo, mkdirPath.ToString()); 414if (!isCaseSensitiveRename && Interop.Sys.LStat(destNoDirectorySeparator, out Interop.Sys.FileStatus destFileStatus) >= 0) 419if (Interop.Sys.LStat(srcNoDirectorySeparator, out Interop.Sys.FileStatus sourceFileStatus) < 0) 438else if ((sourceFileStatus.Mode & Interop.Sys.FileTypes.S_IFMT) != Interop.Sys.FileTypes.S_IFDIR 449if (Interop.Sys.Rename(sourceFullPath, destNoDirectorySeparator) < 0) 451Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 454case Interop.Error.EACCES: // match Win32 exception 456case Interop.Error.ENOENT: 458case Interop.Error.ENOTDIR: // sourceFullPath exists and it's not a directory 461throw Interop.GetExceptionForIoErrno(errorInfo); 527if (Interop.Sys.RmDir(fullPath) < 0) 529Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 531if (errorInfo.Error == Interop.Error.ENOTEMPTY) 538else if (errorInfo.Error == Interop.Error.ENOENT) 546else if (DirectoryExists(fullPath, out Interop.ErrorInfo existErr)) 549if (topLevel && errorInfo.Error == Interop.Error.ENOTDIR) 555else if (existErr.Error == Interop.Error.ENOENT) 561if (errorInfo.Error == Interop.Error.EACCES || 562errorInfo.Error == Interop.Error.EPERM || 563errorInfo.Error == Interop.Error.EROFS) 568throw Interop.GetExceptionForIoErrno(errorInfo, fullPath, isDirError: true); 587throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(Interop.Error.ENOENT), fullPath); 606throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(Interop.Error.ENOENT), fullPath); 662internal static string? GetLinkTarget(ReadOnlySpan<char> linkPath, bool isDirectory) => Interop.Sys.ReadLink(linkPath); 666Interop.CheckIo(Interop.Sys.SymLink(pathToTarget, path), path); 672Interop.CheckIo(Interop.Sys.Link(pathToTarget, path), path); 677ValueStringBuilder sb = new(stackalloc char[Interop.DefaultPathBufferSize]); 680string? linkTarget = Interop.Sys.ReadLink(linkPath); 683Interop.Error error = Interop.Sys.GetLastError(); 686if (error == Interop.Error.EINVAL) 691throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(error), linkPath, isDirectory); 713current = Interop.Sys.ReadLink(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (1)
282Interop.GetRandomBytes(pKey, KeyLength);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (9)
19bool result = Interop.Sys.LStat(fullPath, out Interop.Sys.FileStatus fileInfo) == Interop.Errors.ERROR_SUCCESS; 20isDirectory = result && (fileInfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR; 62path = Combine(Interop.Sys.GetCwd(), path); 115IntPtr fd = Interop.CheckIo(Interop.Sys.MksTemps(pPath, SuffixByteLength), tempPath, isDirError: true); 116Interop.Sys.Close(fd); // ignore any errors from close; nothing to do if cleanup isn't possible
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (6)
72const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 101Interop.Sys.Passwd passwd; 102int error = Interop.Sys.GetPwUidR(Interop.Sys.GetEUid(), out passwd, buf, bufLen); 121var errorInfo = new Interop.ErrorInfo(error); 125if (errorInfo.Error == Interop.Error.ERANGE)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (31)
23FileStreamHelpers.CheckFileCall(Interop.Sys.FTruncate(handle, length), handle.Path); 35result = Interop.Sys.ReadFromNonblocking(handle, bufPtr, buffer.Length); 40result = Interop.Sys.PRead(handle, bufPtr, buffer.Length, fileOffset); 42if (result == -1 && ShouldFallBackToNonOffsetSyscall(Interop.Sys.GetLastErrorInfo())) 50result = Interop.Sys.Read(handle, bufPtr, buffer.Length); 61Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 71vectors[i] = new Interop.Sys.IOVector { Base = (byte*)memoryHandle.Pointer, Count = (UIntPtr)buffer.Length }; 75fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(vectors)) 79result = Interop.Sys.PReadV(handle, pinnedVectors, buffers.Count, fileOffset); 81if (result == -1 && ShouldFallBackToNonOffsetSyscall(Interop.Sys.GetLastErrorInfo())) 89result = Interop.Sys.ReadV(handle, pinnedVectors, buffers.Count); 123bytesWritten = Interop.Sys.WriteToNonblocking(handle, bufPtr, bytesToWrite); 127bytesWritten = Interop.Sys.PWrite(handle, bufPtr, bytesToWrite, fileOffset); 129if (bytesWritten == -1 && ShouldFallBackToNonOffsetSyscall(Interop.Sys.GetLastErrorInfo())) 137bytesWritten = Interop.Sys.Write(handle, bufPtr, bytesToWrite); 177Span<Interop.Sys.IOVector> vectors = buffersCount <= IovStackThreshold ? 178stackalloc Interop.Sys.IOVector[IovStackThreshold].Slice(0, buffersCount) : 179new Interop.Sys.IOVector[buffersCount]; 190vectors[i] = new Interop.Sys.IOVector { Base = (byte*)memoryHandle.Pointer, Count = (UIntPtr)buffer.Length }; 198Span<Interop.Sys.IOVector> left = vectors.Slice(buffersOffset); 199fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(left)) 203bytesWritten = Interop.Sys.PWriteV(handle, pinnedVectors, left.Length, fileOffset); 205if (bytesWritten == -1 && ShouldFallBackToNonOffsetSyscall(Interop.Sys.GetLastErrorInfo())) 213bytesWritten = Interop.Sys.WriteV(handle, pinnedVectors, left.Length); 243Interop.Sys.IOVector current = vectors[buffersOffset]; 244vectors[buffersOffset] = new Interop.Sys.IOVector 273private static bool ShouldFallBackToNonOffsetSyscall(Interop.ErrorInfo lastError) 274=> lastError.Error is Interop.Error.ENXIO or Interop.Error.ESPIPE;
src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (90)
24private static int SessionId { get; } = Interop.Sys.GetSid(Environment.ProcessId); 50Uid = IsUserScope ? Interop.Sys.GetEUid() : 0; 211Interop.Sys.FLock(fileHandle, Interop.Sys.LockOperations.LOCK_UN); 223if (Interop.Sys.FTruncate(fileHandle, (long)sharedDataTotalByteCount) < 0) 225Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 226throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 231if (Interop.Sys.FStat(fileHandle, out Interop.Sys.FileStatus fileStatus) != 0) 233Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 234throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 242if (Interop.Sys.FTruncate(fileHandle, (long)sharedDataTotalByteCount) < 0) 244Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 245throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 256Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 257throw Interop.GetExceptionForIoErrno(errorInfo, sharedMemoryFilePath); 341Interop.Sys.FLock(_fileHandle, Interop.Sys.LockOperations.LOCK_UN); 356Interop.Sys.MUnmap((nint)_sharedDataHeader, _sharedDataTotalByteCount); 372Interop.Sys.Unlink(sharedMemoryFilePath); 374Interop.Sys.RmDir(sessionDirectoryPath); 423SafeFileHandle fd = Interop.Sys.Open(sharedMemoryFilePath, Interop.Sys.OpenFlags.O_RDWR | Interop.Sys.OpenFlags.O_CLOEXEC, 0); 424Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 429if (Interop.Sys.FStat(fd, out Interop.Sys.FileStatus fileStatus) != 0) 431error = Interop.Sys.GetLastErrorInfo(); 433throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 452if (error.Error != Interop.Error.ENOENT) 454throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 469fd = Interop.Sys.Open( 471Interop.Sys.OpenFlags.O_RDWR | Interop.Sys.OpenFlags.O_CLOEXEC | Interop.Sys.OpenFlags.O_CREAT | Interop.Sys.OpenFlags.O_EXCL, 476error = Interop.Sys.GetLastErrorInfo(); 477throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 480int result = Interop.Sys.FChMod(fd, (int)permissionsMask); 484error = Interop.Sys.GetLastErrorInfo(); 486Interop.Sys.Unlink(sharedMemoryFilePath); 487throw Interop.GetExceptionForIoErrno(error, sharedMemoryFilePath); 500int statResult = Interop.Sys.Stat(directoryPath, out Interop.Sys.FileStatus fileStatus); 502if (statResult != 0 && Interop.Sys.GetLastError() == Interop.Error.ENOENT) 541if (Interop.Sys.MkdTemp(tempPathPtr) == null) 544Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 545throw Interop.GetExceptionForIoErrno(error, tempPath); 562if (Interop.Sys.Rename(tempPath, directoryPath) == 0) 570statResult = Interop.Sys.Stat(directoryPath, out fileStatus); 574if (statResult != 0 || (fileStatus.Mode & Interop.Sys.FileTypes.S_IFDIR) == 0) 578Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 579if (error.Error != Interop.Error.ENOENT) 581throw Interop.GetExceptionForIoErrno(error, directoryPath); 628|| (createIfNotExist && Interop.Sys.ChMod(directoryPath, (int)permissionsMask) == 0)) 653nint addr = Interop.Sys.MMap( 656Interop.Sys.MemoryMappedProtections.PROT_READ | Interop.Sys.MemoryMappedProtections.PROT_WRITE, 657Interop.Sys.MemoryMappedFlags.MAP_SHARED, 663Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 664throw Interop.GetExceptionForIoErrno(errorInfo, "Failed to memory map the file"); 672Interop.Sys.LockOperations lockOperation = exclusive ? Interop.Sys.LockOperations.LOCK_EX : Interop.Sys.LockOperations.LOCK_SH; 675lockOperation |= Interop.Sys.LockOperations.LOCK_NB; 677int result = Interop.Sys.FLock(sharedLockFileHandle, lockOperation); 684Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 685if (errorInfo.Error == Interop.Error.EWOULDBLOCK) 690throw Interop.GetExceptionForIoErrno(errorInfo); 707Interop.Sys.MUnmap(addr, length); 730Interop.Sys.FLock(FileHandle, Interop.Sys.LockOperations.LOCK_UN); 764Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 765throw Interop.GetExceptionForIoErrno(error, SharedMemoryHelpers.SharedFilesPath); 779fd = Interop.Sys.Open(sharedMemoryDirectory, Interop.Sys.OpenFlags.O_RDONLY, 0); 782Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 784throw Interop.GetExceptionForIoErrno(error, sharedMemoryDirectory);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamHelpers.Unix.cs (21)
23Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 24if (!(ignoreNotSupported && errorInfo.Error == Interop.Error.ENOTSUP)) 26throw Interop.GetExceptionForIoErrno(errorInfo, path); 34CheckFileCall(Interop.Sys.LSeek(handle, offset, (Interop.Sys.SeekWhence)(int)origin), handle.Path); // SeekOrigin values are the same as Interop.libc.SeekWhence values 37throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(Interop.Error.EINVAL), handle.Path); 42if (Interop.Sys.FSync(handle) < 0) 44Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 47case Interop.Error.EROFS: 48case Interop.Error.EINVAL: 49case Interop.Error.ENOTSUP: 54throw Interop.GetExceptionForIoErrno(errorInfo, handle.Path); 66CheckFileCall(Interop.Sys.LockFileRegion(handle, position, length, canWrite ? Interop.Sys.LockType.F_WRLCK : Interop.Sys.LockType.F_RDLCK), handle.Path); 76CheckFileCall(Interop.Sys.LockFileRegion(handle, position, length, Interop.Sys.LockType.F_UNLCK), handle.Path);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\UnixFileStreamStrategy.cs (6)
30long result = Interop.Sys.LSeek(_fileHandle, _filePosition, Interop.Sys.SeekWhence.SEEK_SET); 33Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 34if (errorInfo.Error != Interop.Error.ESPIPE) 36throw Interop.GetExceptionForIoErrno(errorInfo, _fileHandle.Path);
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (1)
252Interop.GetRandomBytes((byte*)&seed, sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (1)
38Interop.GetRandomBytes((byte*)ptr, 4 * sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (7)
87Interop.Sys.Free(pvNative); 106void* p = Interop.Sys.Malloc((nuint)cbNative & ~WIN32_ALLOC_ALIGN); 132void* p = Interop.Sys.Malloc((nuint)cbNative & ~WIN32_ALLOC_ALIGN); 155Interop.Sys.Free((byte*)ptr - sizeof(nuint)); 180return Interop.Sys.GetErrNo(); 192Interop.Sys.SetErrNo(error); 202return Interop.Sys.StrError(error);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.cs (1)
257result = Interop.Sys.GetDefaultSearchOrderPseudoHandle();
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Unix.cs (4)
14IntPtr ret = Interop.Sys.LoadLibrary(libraryName); 17string? message = Marshal.PtrToStringUTF8(Interop.Sys.GetLoadLibraryError()); 28Interop.Sys.FreeLibrary(handle); 33return Interop.Sys.GetProcAddress(handle, symbolName);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeMemory.Unix.cs (8)
47void* result = (adjustedByteCount < byteCount) ? null : Interop.Sys.AlignedAlloc(adjustedAlignment, adjustedByteCount); 69Interop.Sys.AlignedFree(ptr); 110void* result = (adjustedByteCount < byteCount) ? null : Interop.Sys.AlignedRealloc(ptr, adjustedAlignment, adjustedByteCount); 132void* result = Interop.Sys.Malloc((byteCount != 0) ? byteCount : 1); 158result = Interop.Sys.Calloc(elementCount, elementSize); 163result = Interop.Sys.Malloc(1); 186Interop.Sys.Free(ptr); 205void* result = Interop.Sys.Realloc(ptr, (byteCount != 0) ? byteCount : 1);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (8)
16if (!Interop.Sys.InitializeTerminalAndSignalHandling()) 18Interop.ThrowIOExceptionForLastError(); 21Interop.Sys.SetPosixSignalHandler(&OnPosixSignal); 28int signo = Interop.Sys.GetPlatformSignalNumber(signal); 45!Interop.Sys.EnablePosixSignalHandling(signo)) 47Interop.ThrowIOExceptionForLastError(); 70Interop.Sys.DisablePosixSignalHandling(token.SigNo); 139Interop.Sys.HandleNonCanceledPosixSignal(signo);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (3)
26Interop.OSReleaseFile.GetPrettyName() ?? Interop.Sys.GetUnixVersion(); 39osArch = Interop.Sys.GetOSArchitecture();
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapLazyDictionary.cs (18)
86delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newExternalTypeEntry, 87delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newProxyTypeEntry, 88delegate* unmanaged<CallbackContext*, Interop.BOOL> newPrecachedExternalTypeMap, 89delegate* unmanaged<CallbackContext*, Interop.BOOL> newPrecachedProxyTypeMap, 138private static unsafe Interop.BOOL NewPrecachedExternalTypeMap(CallbackContext* context) 149return Interop.BOOL.FALSE; // Stop processing. 152return Interop.BOOL.TRUE; // Continue processing. 157private static unsafe Interop.BOOL NewPrecachedProxyTypeMap(CallbackContext* context) 168return Interop.BOOL.FALSE; // Stop processing. 171return Interop.BOOL.TRUE; // Continue processing. 176private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) 196return Interop.BOOL.FALSE; // Stop processing. 199return Interop.BOOL.TRUE; // Continue processing. 204private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) 232return Interop.BOOL.FALSE; // Stop processing. 239return Interop.BOOL.TRUE; // Continue processing. 245delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newExternalTypeEntry, 246delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newProxyTypeEntry)
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (4)
48var errorWriter = new Interop.HostPolicy.corehost_error_writer_fn(message => errorMessage.AppendLine(Marshal.PtrToStringAuto(message))); 51IntPtr previousErrorWriterPtr = Interop.HostPolicy.corehost_set_error_writer(errorWriterPtr); 57returnCode = Interop.HostPolicy.corehost_resolve_component_dependencies( 69Interop.HostPolicy.corehost_set_error_writer(previousErrorWriterPtr);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.Unix.cs (7)
14_nativeMonitor = Interop.Sys.LowLevelMonitor_Create(); 28Interop.Sys.LowLevelMonitor_Destroy(_nativeMonitor); 34Interop.Sys.LowLevelMonitor_Acquire(_nativeMonitor); 39Interop.Sys.LowLevelMonitor_Release(_nativeMonitor); 44Interop.Sys.LowLevelMonitor_Wait(_nativeMonitor); 57return Interop.Sys.LowLevelMonitor_TimedWait(_nativeMonitor, timeoutMilliseconds); 62Interop.Sys.LowLevelMonitor_Signal_Release(_nativeMonitor);
src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (23)
269if (Interop.Sys.LowLevelCrossProcessMutex_Init(v) != 0) 271Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 272throw Interop.GetExceptionForIoErrno(errorInfo, SR.Arg_FailedToInitializePThreadMutex); 296public static nuint SharedDataSize { get; } = (nuint)Interop.Sys.LowLevelCrossProcessMutex_Size(); 301Interop.Sys.LowLevelCrossProcessMutex_GetOwnerProcessAndThreadId(_sharedData, out uint ownerProcessId, out uint ownerThreadId); 308Interop.Sys.LowLevelCrossProcessMutex_SetOwnerProcessAndThreadId( 316get => Interop.Sys.LowLevelCrossProcessMutex_IsAbandoned(_sharedData); 317set => Interop.Sys.LowLevelCrossProcessMutex_SetAbandoned(_sharedData, value); 322Interop.Error lockResult = (Interop.Error)Interop.Sys.LowLevelCrossProcessMutex_Acquire(_sharedData, timeoutMilliseconds); 326Interop.Error.SUCCESS => MutexTryAcquireLockResult.AcquiredLock, 327Interop.Error.EBUSY => MutexTryAcquireLockResult.TimedOut, 328Interop.Error.ETIMEDOUT => MutexTryAcquireLockResult.TimedOut, 329Interop.Error.EOWNERDEAD => MutexTryAcquireLockResult.AcquiredLockButMutexWasAbandoned, 330Interop.Error.EAGAIN => throw new OutOfMemoryException(), 363Interop.Sys.LowLevelCrossProcessMutex_Release(_sharedData); 373Interop.Sys.LowLevelCrossProcessMutex_SetOwnerProcessAndThreadId( 378Interop.Sys.LowLevelCrossProcessMutex_Release(_sharedData); 388Interop.Sys.LowLevelCrossProcessMutex_Destroy(_sharedData); 453Interop.Sys.FLock(_sharedLockFileHandle, Interop.Sys.LockOperations.LOCK_UN);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Unix.cs (2)
15private Interop.Sys.ProcessCpuInformation _cpuInfo; 18Interop.Sys.GetCpuUtilization(ref _cpuInfo) / Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (1)
94internal static int GetCurrentProcessorNumber() => Interop.Sys.SchedGetCpu();
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.cs (2)
27int length = Interop.Globalization.IanaIdToWindowsId(ianaId, buffer, 100); 92int length = Interop.Globalization.WindowsIdToIanaId(windowsId, regionPtr, buffer, 100);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (13)
47GetDisplayName(UtcId, Interop.Globalization.TimeZoneDisplayNameType.Standard, uiCulture.Name, ref standardDisplayName); 92GetDisplayName(timeZoneId, Interop.Globalization.TimeZoneDisplayNameType.Standard, UICulture.Name, ref displayName); 97GetDisplayName(timeZoneId, Interop.Globalization.TimeZoneDisplayNameType.DaylightSavings, UICulture.Name, ref displayName); 101private static unsafe void GetDisplayName(string timeZoneId, Interop.Globalization.TimeZoneDisplayNameType nameType, string uiCulture, ref string? displayName) 109bool result = Interop.CallStringMethod( 118return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); 129result = Interop.CallStringMethod( 138return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); 177GetDisplayName(timeZoneId, Interop.Globalization.TimeZoneDisplayNameType.Generic, uiCulture.Name, ref genericName); 186GetDisplayName(timeZoneId, Interop.Globalization.TimeZoneDisplayNameType.GenericLocation, uiCulture.Name, ref genericLocationName); 193GetDisplayName(GmtId, Interop.Globalization.TimeZoneDisplayNameType.GenericLocation, uiCulture.Name, ref gmtLocationName); 203GetDisplayName(GmtId, Interop.Globalization.TimeZoneDisplayNameType.Generic, uiCulture.Name, ref gmtGenericName); 278GetDisplayName(timeZoneId, Interop.Globalization.TimeZoneDisplayNameType.ExemplarCity, uiCultureName, ref exemplarCityName);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
247string? symlinkPath = Interop.Sys.ReadLink(tzFilePath);
src\System\Enum.CoreCLR.cs (3)
15private static partial void GetEnumValuesAndNames(QCallTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, Interop.BOOL getNames); 114getNames ? Interop.BOOL.TRUE : Interop.BOOL.FALSE);
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
1706new QCallModule(ref decoratedModule)) != Interop.BOOL.FALSE;
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (2)
1323return CanCastTo_NoCacheLookup(srcTH.m_asTAddr, destTH.m_asTAddr) != Interop.BOOL.FALSE; 1328private static partial Interop.BOOL CanCastTo_NoCacheLookup(void* fromTypeHnd, void* toTypeHnd);
src\System\RuntimeHandles.cs (23)
350Interop.BOOL fCtorIsPublicTemp = default; 361ctorIsPublic = fCtorIsPublicTemp != Interop.BOOL.FALSE; 372Interop.BOOL* pfCtorIsPublic); 550private static partial Interop.BOOL GetFields(MethodTable* pMT, Span<IntPtr> data, ref int usedCount); 564bool success = GetFields(typeHandle.AsMethodTable(), buffer, ref countLocal) != Interop.BOOL.FALSE; 750internal static partial void GetInstantiation(QCallTypeHandle type, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray); 756GetInstantiation(new QCallTypeHandle(ref nativeHandle), ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE); 764GetInstantiation(new QCallTypeHandle(ref nativeHandle), ObjectHandleOnStack.Create(ref types), Interop.BOOL.FALSE); 893private static partial Interop.BOOL SatisfiesConstraints(QCallTypeHandle paramType, QCallTypeHandle pTypeContext, RuntimeMethodHandleInternal pMethodContext, QCallTypeHandle toType); 898bool result = SatisfiesConstraints(new QCallTypeHandle(ref paramType), new QCallTypeHandle(ref typeContext!), methodContextRaw, new QCallTypeHandle(ref toType)) != Interop.BOOL.FALSE; 1095internal static partial Interop.BOOL IsCAVisibleFromDecoratedType( 1199private static partial void InvokeMethod(ObjectHandleOnStack target, void** arguments, ObjectHandleOnStack sig, Interop.BOOL isConstructor, ObjectHandleOnStack result); 1211isConstructor ? Interop.BOOL.TRUE : Interop.BOOL.FALSE, 1254private static partial void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray); 1259GetMethodInstantiation(EnsureNonNullMethodInfo(method).Value, ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE); 1267GetMethodInstantiation(method, ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE); 1274GetMethodInstantiation(EnsureNonNullMethodInfo(method).Value, ObjectHandleOnStack.Create(ref types), Interop.BOOL.FALSE); 2162private static partial Interop.BOOL AreEqual( 2170sig2._sig, sig2._csig, new QCallTypeHandle(ref sig2._declaringType)) != Interop.BOOL.FALSE; 2231Interop.BOOL required, 2241required ? Interop.BOOL.TRUE : Interop.BOOL.FALSE,
src\System\StubHelpers.cs (3)
153Interop.BOOL defaultCharUsed = Interop.BOOL.FALSE; 174if (defaultCharUsed != Interop.BOOL.FALSE)
src\System\Threading\Thread.CoreCLR.cs (13)
103if (StartInternal(GetNativeHandle(), _startHelper?._maxStackSize ?? 0, _priority, _isThreadPool ? Interop.BOOL.TRUE : Interop.BOOL.FALSE, pThreadName, ObjectHandleOnStack.Create(ref exception)) == Interop.BOOL.FALSE) 113private static unsafe partial Interop.BOOL StartInternal(ThreadHandle t, int stackSize, int priority, Interop.BOOL isThreadPool, char* pThreadName, ObjectHandleOnStack exception); 164private static partial Interop.BOOL YieldInternal(); 166public static bool Yield() => YieldInternal() != Interop.BOOL.FALSE; 219Interop.BOOL res = GetIsBackground(GetNativeHandle()); 221return res != Interop.BOOL.FALSE; 230SetIsBackground(GetNativeHandle(), value ? Interop.BOOL.TRUE : Interop.BOOL.FALSE); 241private static partial Interop.BOOL GetIsBackground(ThreadHandle t); 244private static partial void SetIsBackground(ThreadHandle t, Interop.BOOL value);