LibraryImports.g.cs (111)
377private 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);
1938private static extern partial global::Interop.BOOL CanCastTo_NoCacheLookup(void* fromTypeHnd, void* toTypeHnd);
2688private 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);
2728private static partial global::Interop.BOOL GetFields(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Span<nint> data, ref int usedCount)
2730global::Interop.BOOL __retVal;
2741static extern unsafe global::Interop.BOOL __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native, nint* __data_native, int* __usedCount_native);
2860internal static extern partial void GetInstantiation(global::System.Runtime.CompilerServices.QCallTypeHandle type, global::System.Runtime.CompilerServices.ObjectHandleOnStack types, global::Interop.BOOL fAsRuntimeTypeArray);
2916private 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);
2940internal 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);
2956private 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);
2964private static extern partial void GetMethodInstantiation(global::System.RuntimeMethodHandleInternal method, global::System.Runtime.CompilerServices.ObjectHandleOnStack types, global::Interop.BOOL fAsRuntimeTypeArray);
3213private 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);
3221private static extern partial void GetCustomModifiersAtOffset(global::System.Runtime.CompilerServices.ObjectHandleOnStack sigObj, int offset, global::Interop.BOOL required, global::System.Runtime.CompilerServices.ObjectHandleOnStack result);
3513private static unsafe extern partial void StartInternal(global::System.Threading.ThreadHandle t, int stackSize, int priority, global::Interop.BOOL isThreadPool, char* pThreadName);
3545private static extern partial global::Interop.BOOL YieldInternal();
3588private static extern partial global::Interop.BOOL GetIsBackground(global::System.Threading.ThreadHandle t);
3596private static extern partial void SetIsBackground(global::System.Threading.ThreadHandle t, global::Interop.BOOL value);
4080private 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, global::System.Runtime.InteropServices.TypeMapLazyDictionary.CallbackContext* context);
4110internal static unsafe partial global::Interop.Globalization.ResultCode GetCalendarInfo(string localeName, global::System.Globalization.CalendarId calendarId, global::System.Globalization.CalendarDataType calendarDataType, char* result, int resultCapacity)
4112global::Interop.Globalization.ResultCode __retVal;
4122static 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);
4263internal static unsafe partial global::Interop.Globalization.ResultCode GetSortHandle(string localeName, out nint sortHandle)
4267global::Interop.Globalization.ResultCode __retVal = default;
4291static extern unsafe global::Interop.Globalization.ResultCode __PInvoke(byte* __localeName_native, nint* __sortHandle_native);
4721internal static unsafe partial global::Interop.Globalization.ResultCode GetTimeZoneDisplayName(string localeName, string timeZoneId, global::Interop.Globalization.TimeZoneDisplayNameType type, char* result, int resultLength)
4723global::Interop.Globalization.ResultCode __retVal;
4734static 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);
4892internal static unsafe partial int FindStringOrdinal(uint dwFindStringOrdinalFlags, char* lpStringSource, int cchSource, char* lpStringValue, int cchValue, global::Interop.BOOL bIgnoreCase)
4906static extern unsafe int __PInvoke(uint __dwFindStringOrdinalFlags_native, char* __lpStringSource_native, int __cchSource_native, char* __lpStringValue_native, int __cchValue_native, global::Interop.BOOL __bIgnoreCase_native);
4937internal static unsafe extern partial global::Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer);
4966internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged<char*, uint, void*, global::Interop.BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, nint reserved)
4979static extern unsafe int __PInvoke(delegate* unmanaged<char*, uint, void*, global::Interop.BOOL> __lpLocaleEnumProcEx_native, uint __dwFlags_native, void* __lParam_native, nint __reserved_native);
4988internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged<char*, void*, global::Interop.BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam)
5003static extern unsafe int __PInvoke(delegate* unmanaged<char*, void*, global::Interop.BOOL> __lpTimeFmtEnumProcEx_native, ushort* __lpLocaleName_native, uint __dwFlags_native, void* __lParam_native);
5072internal 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)
5088static 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);
5097internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, global::Interop.Kernel32.NlsVersionInfoEx* lpVersionInformation)
5112static extern unsafe int __PInvoke(int __function_native, ushort* __localeName_native, global::Interop.Kernel32.NlsVersionInfoEx* __lpVersionInformation_native);
5188internal static unsafe partial global::Interop.BOOL IsNormalizedString(global::System.Text.NormalizationForm normForm, char* source, int length)
5191global::Interop.BOOL __retVal;
5202static extern unsafe global::Interop.BOOL __PInvoke(global::System.Text.NormalizationForm __normForm_native, char* __source_native, int __length_native);
5234internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath, global::Interop.HostPolicy.corehost_resolve_component_dependencies_result_fn result)
5298internal 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)
5310static 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);
5916internal static unsafe extern partial global::Interop.BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock);
6253internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno);
6261internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
6277internal static partial int Access(string path, global::Interop.Sys.AccessMode mode)
6306static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.AccessMode __mode_native);
6660internal static partial int FLock(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, global::Interop.Sys.LockOperations operation)
6689static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.LockOperations __operation_native);
6698internal static partial int FLock(nint fd, global::Interop.Sys.LockOperations operation)
6712static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.LockOperations __operation_native);
6797internal static partial double GetCpuUtilization(ref global::Interop.Sys.ProcessCpuInformation previousCpuInfo)
6801fixed (global::Interop.Sys.ProcessCpuInformation* __previousCpuInfo_native = &previousCpuInfo)
6809static extern unsafe double __PInvoke(global::Interop.Sys.ProcessCpuInformation* __previousCpuInfo_native);
7203internal static partial int LockFileRegion(global::System.Runtime.InteropServices.SafeHandle fd, long offset, long length, global::Interop.Sys.LockType lockType)
7232static extern unsafe int __PInvoke(nint __fd_native, long __offset_native, long __length_native, global::Interop.Sys.LockType __lockType_native);
7327internal static partial long LSeek(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset, global::Interop.Sys.SeekWhence whence)
7356static extern unsafe long __PInvoke(nint __fd_native, long __offset_native, global::Interop.Sys.SeekWhence __whence_native);
7492internal 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)
7521static 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);
7530internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, nint fd, long offset)
7544static 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);
7584internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
7628static extern unsafe nint __PInvoke(byte* __filename_native, global::Interop.Sys.OpenFlags __flags_native, int __mode_native);
7637private static partial int PathConf(string path, global::Interop.Sys.PathConfName name)
7666static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native);
7675internal static partial int PosixFAdvise(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, long offset, long length, global::Interop.Sys.FileAdvice advice)
7700static extern unsafe int __PInvoke(nint __fd_native, long __offset_native, long __length_native, global::Interop.Sys.FileAdvice __advice_native);
7785internal static unsafe partial long PReadV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset)
7814static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native, long __fileOffset_native);
7861internal static unsafe partial long PWriteV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset)
7890static extern unsafe long __PInvoke(nint __fd_native, global::Interop.Sys.IOVector* __vectors_native, int __vectorCount_native, long __fileOffset_native);
7975internal static unsafe extern partial int ReadDir(nint dir, global::Interop.Sys.DirectoryEntry* outputEntry);
8147internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output)
8160fixed (global::Interop.Sys.FileStatus* __output_native = &output)
8179static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native);
8188internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output)
8201fixed (global::Interop.Sys.FileStatus* __output_native = &output)
8220static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
8229internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output)
8242fixed (global::Interop.Sys.FileStatus* __output_native = &output)
8261static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
8270internal static partial int Stat(ref byte path, out global::Interop.Sys.FileStatus output)
8276fixed (global::Interop.Sys.FileStatus* __output_native = &output)
8288static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
8297internal static partial int LStat(ref byte path, out global::Interop.Sys.FileStatus output)
8303fixed (global::Interop.Sys.FileStatus* __output_native = &output)
8315static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
8367internal static partial long SysConf(global::Interop.Sys.SysConfName name)
8381static extern unsafe long __PInvoke(global::Interop.Sys.SysConfName __name_native);
8390internal static partial void SysLog(global::Interop.Sys.SysLogPriority priority, string message, string arg1)
8418static extern unsafe void __PInvoke(global::Interop.Sys.SysLogPriority __priority_native, byte* __message_native, byte* __arg1_native);
8495internal static unsafe partial int UTimensat(string path, global::Interop.Sys.TimeSpec* times)
8524static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.TimeSpec* __times_native);
8533internal static unsafe partial int FUTimens(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.TimeSpec* times)
8562static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.TimeSpec* __times_native);
8671internal static unsafe partial int GetPwUidR(uint uid, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen)
8676fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd)
8684static extern unsafe int __PInvoke(uint __uid_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native);
8693internal static unsafe partial int GetPwNamR(string name, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen)
8705fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd)
8721static extern unsafe int __PInvoke(byte* __name_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (95)
91private static SafeFileHandle Open(string path, Interop.Sys.OpenFlags flags, int mode, bool failForSymlink, out bool wasSymlink,
92Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException)
96SafeFileHandle handle = Interop.Sys.Open(path, flags, mode);
101Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo();
104if (failForSymlink && error.Error == Interop.Error.ELOOP)
115if (error.Error == Interop.Error.EISDIR)
117error = Interop.Error.EACCES.Info();
120Interop.CheckIo(error.Error, path);
137Interop.Sys.Unlink(_path); // ignore errors; it's valid that the path may no longer exist
147Interop.Sys.FLock(handle, Interop.Sys.LockOperations.LOCK_UN); // ignore any errors
152return Interop.Sys.Close(handle) == 0;
174Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null)
180Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null)
187Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null)
190Interop.Sys.OpenFlags openFlags = PreOpenConfigurationFromOptions(mode, access, share, options, failForSymlink);
233private static Interop.Sys.OpenFlags PreOpenConfigurationFromOptions(FileMode mode, FileAccess access, FileShare share, FileOptions options, bool failForSymlink)
236Interop.Sys.OpenFlags flags = default;
239flags |= Interop.Sys.OpenFlags.O_NOFOLLOW;
251flags |= Interop.Sys.OpenFlags.O_TRUNC;
257flags |= Interop.Sys.OpenFlags.O_CREAT;
261flags |= Interop.Sys.OpenFlags.O_CREAT;
264flags |= Interop.Sys.OpenFlags.O_TRUNC;
269flags |= (Interop.Sys.OpenFlags.O_CREAT | Interop.Sys.OpenFlags.O_EXCL);
277flags |= Interop.Sys.OpenFlags.O_RDONLY;
281flags |= Interop.Sys.OpenFlags.O_RDWR;
285flags |= Interop.Sys.OpenFlags.O_WRONLY;
292flags |= Interop.Sys.OpenFlags.O_CLOEXEC;
304flags |= Interop.Sys.OpenFlags.O_SYNC;
313Interop.Sys.FileStatus status = default;
325if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR)
327throw Interop.GetExceptionForIoErrno(Interop.Error.EACCES.Info(), path);
330if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFREG)
336Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0);
348Interop.Sys.LockOperations lockOperation = (share == FileShare.None) ? Interop.Sys.LockOperations.LOCK_EX : Interop.Sys.LockOperations.LOCK_SH;
349if (CanLockTheFile(lockOperation, access) && !(_isLocked = Interop.Sys.FLock(this, lockOperation | Interop.Sys.LockOperations.LOCK_NB) >= 0))
355Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
356if (errorInfo.Error == Interop.Error.EWOULDBLOCK)
358throw Interop.GetExceptionForIoErrno(errorInfo, path);
375Interop.Sys.FileStatus pathStatus;
376if (Interop.Sys.Stat(path, out pathStatus) < 0)
381Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo();
383if (error.Error == Interop.Error.ENOENT)
388throw Interop.GetExceptionForIoErrno(error, path);
403Interop.Sys.FileAdvice fadv =
404(options & FileOptions.RandomAccess) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_RANDOM :
405(options & FileOptions.SequentialScan) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_SEQUENTIAL :
409FileStreamHelpers.CheckFileCall(Interop.Sys.PosixFAdvise(this, 0, 0, fadv), path,
417if (Interop.Sys.FTruncate(this, 0) < 0)
419Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
420if (errorInfo.Error != Interop.Error.EBADF && errorInfo.Error != Interop.Error.EINVAL)
425throw Interop.GetExceptionForIoErrno(errorInfo, path);
430if (preallocationSize > 0 && Interop.Sys.FAllocate(this, 0, preallocationSize) < 0)
432Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
435if (errorInfo.Error == Interop.Error.EFBIG ||
436errorInfo.Error == Interop.Error.ENOSPC)
442Interop.Sys.Unlink(path);
444throw new IOException(SR.Format(errorInfo.Error == Interop.Error.EFBIG
454private bool CanLockTheFile(Interop.Sys.LockOperations lockOperation, FileAccess access)
456Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH);
462else if (lockOperation == Interop.Sys.LockOperations.LOCK_EX)
471if (!Interop.Sys.TryGetFileSystemType(this, out Interop.Sys.UnixFileSystemTypes unixFileSystemType))
478case Interop.Sys.UnixFileSystemTypes.nfs: // #44546
479case Interop.Sys.UnixFileSystemTypes.smb:
480case Interop.Sys.UnixFileSystemTypes.smb2: // #53182
481case Interop.Sys.UnixFileSystemTypes.cifs:
488private void FStatCheckIO(string path, ref Interop.Sys.FileStatus status, ref bool statusHasValue)
492if (Interop.Sys.FStat(this, out status) != 0)
494Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo();
495throw Interop.GetExceptionForIoErrno(error, path);
510_canSeek = canSeek = Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0 ? NullableBool.True : NullableBool.False;
518int result = Interop.Sys.FStat(this, out Interop.Sys.FileStatus status);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (4)
101count = Interop.Globalization.GetCalendars(localeName, calendars, calendars.Length);
126return Interop.CallStringMethod(
131return Interop.Globalization.GetCalendarInfo(locale, id, type, bufferPtr, buffer.Length);
435return Interop.Globalization.EnumCalendarInfo(&EnumCalendarInfoCallback, localeName, calendarId, dataType, (IntPtr)callbackContext);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (8)
29return Interop.Kernel32.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType | CAL_RETURN_NUMBER, IntPtr.Zero, 0, out data) != 0;
39int ret = Interop.Kernel32.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType, (IntPtr)buffer, BUFFER_LENGTH, IntPtr.Zero);
62private static unsafe Interop.BOOL EnumCalendarInfoCallback(char* lpCalendarInfoString, uint calendar, IntPtr pReserved, void* lParam)
76return Interop.BOOL.TRUE;
80return Interop.BOOL.FALSE;
94private static unsafe Interop.BOOL EnumCalendarsCallback(char* lpCalendarInfoString, uint calendar, IntPtr reserved, void* lParam)
103return Interop.BOOL.TRUE;
107return Interop.BOOL.FALSE;
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (25)
62return Interop.Globalization.CompareString(_sortHandle, pString1, string1.Length, pString2, string2.Length, options);
92return Interop.Globalization.IndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr);
94return Interop.Globalization.LastIndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr);
213return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
215return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
307return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
309return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
338return Interop.Globalization.StartsWith(_sortHandle, pPrefix, prefix.Length, pSource, source.Length, options, matchLengthPtr);
421return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr);
493return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr);
522return Interop.Globalization.EndsWith(_sortHandle, pSuffix, suffix.Length, pSource, source.Length, options, matchLengthPtr);
606return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr);
678return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr);
713sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options);
730if (Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKeyLength, options) != sortKeyLength)
769actualSortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pDest, destination.Length, options);
815return Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options);
882sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options);
905sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options);
949int sortVersion = Interop.Globalization.GetSortVersion(_sortHandle);
969Interop.Globalization.ResultCode resultCode = Interop.Globalization.GetSortHandle(sortName, out result);
971if (resultCode == Interop.Globalization.ResultCode.OutOfMemory)
973else if (resultCode != Interop.Globalization.ResultCode.Success)
982Interop.Globalization.CloseSortHandle(result);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (25)
26int ret = Interop.Kernel32.LCMapStringEx(cultureName, Interop.Kernel32.LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero);
34ret = Interop.Kernel32.LCMapStringEx(null, Interop.Kernel32.LCMAP_HASH, &a, 1, &hashValue, sizeof(int), null, null, handle);
60int ret = Interop.Kernel32.FindStringOrdinal(
66bIgnoreCase ? Interop.BOOL.TRUE : Interop.BOOL.FALSE);
71Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS);
140int sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
162if (Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
199int result = Interop.Kernel32.CompareStringOrdinal(char1, count1, char2, count2, bIgnoreCase: true);
237int result = Interop.Kernel32.CompareStringEx(
288int result = Interop.Kernel32.FindNLSStringEx(
303Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS);
395int sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
409if (Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
494actualSortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
509if (Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_INSUFFICIENT_BUFFER)
546sortKeyLength = Interop.Kernel32.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
574return Interop.Kernel32.IsNLSDefinedString(Interop.Kernel32.COMPARE_STRING, 0, IntPtr.Zero, pText, text.Length);
624Interop.Kernel32.NlsVersionInfoEx nlsVersion = default;
625nlsVersion.dwNLSVersionInfoSize = sizeof(Interop.Kernel32.NlsVersionInfoEx);
626Interop.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;
44return Interop.Kernel32.GetLocaleInfoEx(lpLocaleName, lcType, lpLCData, cchData);
72lctype |= Interop.Kernel32.LOCALE_NOUSEROVERRIDE;
91return GetLocaleInfoExInt(name, Interop.Kernel32.LOCALE_ICONSTRUCTEDLOCALE) != 1;
98return ReescapeWin32String(GetLocaleInfoFromLCType(_sRealName, Interop.Kernel32.LOCALE_STIMEFORMAT, _bUseOverrides));
106int result = GetLocaleInfoExInt(_sRealName, Interop.Kernel32.LOCALE_IFIRSTDAYOFWEEK | (!_bUseOverrides ? Interop.Kernel32.LOCALE_NOUSEROVERRIDE : 0));
126Interop.Kernel32.EnumSystemLocalesEx(&EnumSystemLocalesProc, Interop.Kernel32.LOCALE_SPECIFICDATA | Interop.Kernel32.LOCALE_SUPPLEMENTAL, &context, IntPtr.Zero);
181lctype |= Interop.Kernel32.LOCALE_NOUSEROVERRIDE;
348private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
354string? regionName = GetLocaleInfoEx(cultureName, Interop.Kernel32.LOCALE_SISO3166CTRYNAME);
358return Interop.BOOL.FALSE; // we found a match, then stop the enumeration
361return Interop.BOOL.TRUE;
365return Interop.BOOL.FALSE;
371private static unsafe Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
376return Interop.BOOL.TRUE;
380return Interop.BOOL.FALSE;
392private static unsafe Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam)
397return Interop.BOOL.TRUE;
401return Interop.BOOL.FALSE;
411Interop.Kernel32.EnumTimeFormatsEx(&EnumTimeCallback, localeName, dwFlags, &data);
426uint lcType = (dwFlags == Interop.Kernel32.TIME_NOSECONDS) ? Interop.Kernel32.LOCALE_SSHORTTIME : Interop.Kernel32.LOCALE_STIMEFORMAT;
449return Interop.Kernel32.LocaleNameToLCID(cultureName, Interop.Kernel32.LOCALE_ALLOW_NEUTRAL_NAMES);
468flags |= Interop.Kernel32.LOCALE_NEUTRALDATA | Interop.Kernel32.LOCALE_SPECIFICDATA;
474flags |= Interop.Kernel32.LOCALE_NEUTRALDATA;
479flags |= Interop.Kernel32.LOCALE_SPECIFICDATA;
484flags |= Interop.Kernel32.LOCALE_SUPPLEMENTAL;
489flags |= Interop.Kernel32.LOCALE_SUPPLEMENTAL;
497Interop.Kernel32.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, flags, &context, IntPtr.Zero);
525Interop.Kernel32.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, Interop.Kernel32.LOCALE_REPLACEMENT, &context, IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (7)
27actualLength = Interop.Globalization.ToAscii(flags, unicode, count, outputStack, estimatedLength);
35actualLength = Interop.Globalization.ToAscii(flags, unicode, count, null, 0);
45actualLength = Interop.Globalization.ToAscii(flags, unicode, count, pOutputHeap, actualLength);
85int realLen = Interop.Globalization.ToUnicode(flags, ascii, count, output, outputLength);
112(AllowUnassigned ? Interop.Globalization.AllowUnassigned : 0) |
113(UseStd3AsciiRules ? Interop.Globalization.UseStd3AsciiRules : 0);
127if ((flags & Interop.Globalization.UseStd3AsciiRules) == 0)
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (7)
21int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, null, 0);
50int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, output, outputLength);
68int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, null, 0);
97int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, output, outputLength);
111(AllowUnassigned ? Interop.Normaliz.IDN_ALLOW_UNASSIGNED : 0) |
112(UseStd3AsciiRules ? Interop.Normaliz.IDN_USE_STD3_ASCII_RULES : 0);
123lastError == Interop.Errors.ERROR_INVALID_NAME ? SR.Argument_IdnIllegalName :
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\TextInfo.Icu.cs (3)
26Interop.Globalization.ChangeCaseInvariant(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper);
36Interop.Globalization.ChangeCaseTurkish(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper);
40Interop.Globalization.ChangeCase(src, srcLen, dstBuffer, dstBufferCapacity, bToUpper);
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.Unix.cs (120)
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);
672ValueStringBuilder sb = new(Interop.DefaultPathBufferSize);
675string? linkTarget = Interop.Sys.ReadLink(linkPath);
679Interop.Error error = Interop.Sys.GetLastError();
681if (error == Interop.Error.EINVAL)
686throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(error), linkPath, isDirectory);
708current = Interop.Sys.ReadLink(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (30)
23FileStreamHelpers.CheckFileCall(Interop.Sys.FTruncate(handle, length), handle.Path);
36result = Interop.Sys.PRead(handle, bufPtr, buffer.Length, fileOffset);
41Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
43if (errorInfo.Error == Interop.Error.ENXIO ||
44errorInfo.Error == Interop.Error.ESPIPE)
47result = Interop.Sys.Read(handle, bufPtr, buffer.Length);
53result = Interop.Sys.Read(handle, bufPtr, buffer.Length);
64Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count];
74vectors[i] = new Interop.Sys.IOVector { Base = (byte*)memoryHandle.Pointer, Count = (UIntPtr)buffer.Length };
78fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(vectors))
80result = Interop.Sys.PReadV(handle, pinnedVectors, buffers.Count, fileOffset);
113bytesWritten = Interop.Sys.PWrite(handle, bufPtr, bytesToWrite, fileOffset);
118Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
120if (errorInfo.Error == Interop.Error.ENXIO ||
121errorInfo.Error == Interop.Error.ESPIPE)
124bytesWritten = Interop.Sys.Write(handle, bufPtr, bytesToWrite);
130bytesWritten = Interop.Sys.Write(handle, bufPtr, bytesToWrite);
170Span<Interop.Sys.IOVector> vectors = buffersCount <= IovStackThreshold ?
171stackalloc Interop.Sys.IOVector[IovStackThreshold].Slice(0, buffersCount) :
172new Interop.Sys.IOVector[buffersCount];
183vectors[i] = new Interop.Sys.IOVector { Base = (byte*)memoryHandle.Pointer, Count = (UIntPtr)buffer.Length };
191Span<Interop.Sys.IOVector> left = vectors.Slice(buffersOffset);
192fixed (Interop.Sys.IOVector* pinnedVectors = &MemoryMarshal.GetReference(left))
194bytesWritten = Interop.Sys.PWriteV(handle, pinnedVectors, left.Length, fileOffset);
223Interop.Sys.IOVector current = vectors[buffersOffset];
224vectors[buffersOffset] = new Interop.Sys.IOVector
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\Runtime\InteropServices\TypeMapLazyDictionary.cs (10)
79delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newExternalTypeEntry,
80delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newProxyTypeEntry,
122private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg)
142return Interop.BOOL.FALSE; // Stop processing.
145return Interop.BOOL.TRUE; // Continue processing.
149private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg)
177return Interop.BOOL.FALSE; // Stop processing.
184return Interop.BOOL.TRUE; // Continue processing.
189delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newExternalTypeEntry,
190delegate* unmanaged<CallbackContext*, ProcessAttributesCallbackArg*, Interop.BOOL> newProxyTypeEntry)
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\System\RuntimeHandles.cs (23)
342Interop.BOOL fCtorIsPublicTemp = default;
353ctorIsPublic = fCtorIsPublicTemp != Interop.BOOL.FALSE;
363Interop.BOOL* pfCtorIsPublic);
539private static partial Interop.BOOL GetFields(MethodTable* pMT, Span<IntPtr> data, ref int usedCount);
553bool success = GetFields(typeHandle.AsMethodTable(), buffer, ref countLocal) != Interop.BOOL.FALSE;
737internal static partial void GetInstantiation(QCallTypeHandle type, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
743GetInstantiation(new QCallTypeHandle(ref nativeHandle), ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE);
751GetInstantiation(new QCallTypeHandle(ref nativeHandle), ObjectHandleOnStack.Create(ref types), Interop.BOOL.FALSE);
855private static partial Interop.BOOL SatisfiesConstraints(QCallTypeHandle paramType, QCallTypeHandle pTypeContext, RuntimeMethodHandleInternal pMethodContext, QCallTypeHandle toType);
860bool result = SatisfiesConstraints(new QCallTypeHandle(ref paramType), new QCallTypeHandle(ref typeContext!), methodContextRaw, new QCallTypeHandle(ref toType)) != Interop.BOOL.FALSE;
1057internal static partial Interop.BOOL IsCAVisibleFromDecoratedType(
1158private static partial void InvokeMethod(ObjectHandleOnStack target, void** arguments, ObjectHandleOnStack sig, Interop.BOOL isConstructor, ObjectHandleOnStack result);
1169isConstructor ? Interop.BOOL.TRUE : Interop.BOOL.FALSE,
1212private static partial void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
1217GetMethodInstantiation(EnsureNonNullMethodInfo(method).Value, ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE);
1225GetMethodInstantiation(method, ObjectHandleOnStack.Create(ref types), Interop.BOOL.TRUE);
1232GetMethodInstantiation(EnsureNonNullMethodInfo(method).Value, ObjectHandleOnStack.Create(ref types), Interop.BOOL.FALSE);
2100private static partial Interop.BOOL AreEqual(
2108sig2._sig, sig2._csig, new QCallTypeHandle(ref sig2._declaringType)) != Interop.BOOL.FALSE;
2166Interop.BOOL required,
2176required ? Interop.BOOL.TRUE : Interop.BOOL.FALSE,
src\System\Threading\Thread.CoreCLR.cs (11)
93StartInternal(GetNativeHandle(), _startHelper?._maxStackSize ?? 0, _priority, _isThreadPool ? Interop.BOOL.TRUE : Interop.BOOL.FALSE, pThreadName);
99private static unsafe partial void StartInternal(ThreadHandle t, int stackSize, int priority, Interop.BOOL isThreadPool, char* pThreadName);
150private static partial Interop.BOOL YieldInternal();
152public static bool Yield() => YieldInternal() != Interop.BOOL.FALSE;
205Interop.BOOL res = GetIsBackground(GetNativeHandle());
207return res != Interop.BOOL.FALSE;
216SetIsBackground(GetNativeHandle(), value ? Interop.BOOL.TRUE : Interop.BOOL.FALSE);
227private static partial Interop.BOOL GetIsBackground(ThreadHandle t);
230private static partial void SetIsBackground(ThreadHandle t, Interop.BOOL value);