321 references to Sys
System.Private.CoreLib (321)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (3)
123_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 140get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 145return Interop.Sys.StrError(RawErrno);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (3)
42ThrowExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 53ThrowExceptionForIoErrno(Sys.GetLastErrorInfo(), path: null, isDirError: false); 99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
62ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (3)
36const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 63Interop.Sys.Passwd passwd; 64int error = Interop.Sys.GetPwUidR(uid, out passwd, buf, bufLen);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetRandomBytes.cs (2)
20Sys.GetNonCryptographicallySecureRandomBytes(buffer, length); 25if (Sys.GetCryptographicallySecureRandomBytes(buffer, length) != 0)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (2)
30rv = Interop.Sys.GetGroups(groups.Length, pGroups); 38else if (rv == -1 && Interop.Sys.GetLastError() == Interop.Error.EINVAL)
src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (2)
16Interop.Sys.Log(pBytes, bytes.Length); 27Interop.Sys.LogError(pBytes, bytes.Length);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (69)
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(); 141Interop.Sys.Unlink(_path); // ignore errors; it's valid that the path may no longer exist 151Interop.Sys.FLock(handle, Interop.Sys.LockOperations.LOCK_UN); // ignore any errors 158int result = Interop.Sys.Close(handle); 161t_lastCloseErrorInfo = Interop.Sys.GetLastErrorInfo(); 185Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 191Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 198Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 201Interop.Sys.OpenFlags openFlags = PreOpenConfigurationFromOptions(mode, access, share, options, failForSymlink); 244private static Interop.Sys.OpenFlags PreOpenConfigurationFromOptions(FileMode mode, FileAccess access, FileShare share, FileOptions options, bool failForSymlink) 247Interop.Sys.OpenFlags flags = default; 250flags |= Interop.Sys.OpenFlags.O_NOFOLLOW; 262flags |= Interop.Sys.OpenFlags.O_TRUNC; 268flags |= Interop.Sys.OpenFlags.O_CREAT; 272flags |= Interop.Sys.OpenFlags.O_CREAT; 275flags |= Interop.Sys.OpenFlags.O_TRUNC; 280flags |= (Interop.Sys.OpenFlags.O_CREAT | Interop.Sys.OpenFlags.O_EXCL); 288flags |= Interop.Sys.OpenFlags.O_RDONLY; 292flags |= Interop.Sys.OpenFlags.O_RDWR; 296flags |= Interop.Sys.OpenFlags.O_WRONLY; 303flags |= Interop.Sys.OpenFlags.O_CLOEXEC; 315flags |= Interop.Sys.OpenFlags.O_SYNC; 324Interop.Sys.FileStatus status = default; 336if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 341if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFREG) 347Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 359Interop.Sys.LockOperations lockOperation = (share == FileShare.None) ? Interop.Sys.LockOperations.LOCK_EX : Interop.Sys.LockOperations.LOCK_SH; 360if (CanLockTheFile(lockOperation, access) && !(_isLocked = Interop.Sys.FLock(this, lockOperation | Interop.Sys.LockOperations.LOCK_NB) >= 0)) 366Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 386Interop.Sys.FileStatus pathStatus; 387if (Interop.Sys.Stat(path, out pathStatus) < 0) 392Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 414Interop.Sys.FileAdvice fadv = 415(options & FileOptions.RandomAccess) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_RANDOM : 416(options & FileOptions.SequentialScan) != 0 ? Interop.Sys.FileAdvice.POSIX_FADV_SEQUENTIAL : 420FileStreamHelpers.CheckFileCall(Interop.Sys.PosixFAdvise(this, 0, 0, fadv), path, 428if (Interop.Sys.FTruncate(this, 0) < 0) 430Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 441if (preallocationSize > 0 && Interop.Sys.FAllocate(this, 0, preallocationSize) < 0) 443Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 453Interop.Sys.Unlink(path!); 465private bool CanLockTheFile(Interop.Sys.LockOperations lockOperation, FileAccess access) 467Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 473else if (lockOperation == Interop.Sys.LockOperations.LOCK_EX) 482if (!Interop.Sys.TryGetFileSystemType(this, out Interop.Sys.UnixFileSystemTypes unixFileSystemType)) 489case Interop.Sys.UnixFileSystemTypes.nfs: // #44546 490case Interop.Sys.UnixFileSystemTypes.smb: 491case Interop.Sys.UnixFileSystemTypes.smb2: // #53182 492case Interop.Sys.UnixFileSystemTypes.cifs: 499private void FStatCheckIO(string path, ref Interop.Sys.FileStatus status, ref bool statusHasValue) 503if (Interop.Sys.FStat(this, out status) != 0) 505Interop.ErrorInfo error = Interop.Sys.GetLastErrorInfo(); 521_canSeek = canSeek = Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0 ? NullableBool.True : NullableBool.False; 529int 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\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)
16return (long)Interop.Sys.GetTimestamp();
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) 182if (Interop.Sys.Access(userDirsPath, Interop.Sys.AccessMode.R_OK) == 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 (9)
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(); 86Interop.Sys.ProcessCpuInformation cpuInfo = default; 87Interop.Sys.GetCpuUtilization(ref cpuInfo);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
48if (Interop.Sys.MkdTemp(pPath) is null)
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 (8)
14private Interop.Sys.DirectoryEntry _directoryEntry; 30Interop.Sys.DirectoryEntry directoryEntry, 46bool isDirectory = directoryEntry.InodeType == Interop.Sys.NodeType.DT_DIR; 47bool isSymlink = directoryEntry.InodeType == Interop.Sys.NodeType.DT_LNK; 48bool isUnknown = directoryEntry.InodeType == Interop.Sys.NodeType.DT_UNKNOWN; 63entry._directoryEntry.InodeType = Interop.Sys.NodeType.DT_LNK; 98Span<char> buffer = MemoryMarshal.CreateSpan(ref _fileNameBuffer._buffer[0], Interop.Sys.DirectoryEntry.NameBufferSize); 158internal bool IsSymbolicLink => _directoryEntry.InodeType == Interop.Sys.NodeType.DT_LNK;
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (7)
27private Interop.Sys.DirectoryEntry _entry; 48int size = Interop.Sys.GetReadDirRBufferSize(); 71IntPtr handle = Interop.Sys.OpenDir(path); 74Interop.ErrorInfo info = Interop.Sys.GetLastErrorInfo(); 88Interop.Sys.CloseDir(handle); 178fixed (Interop.Sys.DirectoryEntry* e = &_entry) 180result = Interop.Sys.ReadDirR(_directoryHandle, entryBufferPtr, bufferLength, e);
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (34)
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); 277int rv = handle is not null ? Interop.Sys.FChMod(handle, newMode) : 278Interop.Sys.ChMod(path!, newMode); 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); 431bool updateCreationTime = checkCreationTime && (_fileCache.Flags & Interop.Sys.FileStatusFlags.HasBirthTime) != 0 && 486int rv = handle is not null ? Interop.Sys.FChMod(handle, (int)mode) 487: Interop.Sys.ChMod(path!, (int)mode); 506Interop.Sys.FStat(handle, out _fileCache) : 507Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache); 511Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (13)
18Interop.Sys.FileStatus fileinfo; 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; 37Interop.Sys.FileStatus fileinfo; 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 (46)
51Interop.CheckIo(Interop.Sys.CopyFile(src, dst, fileLength)); 54private static Exception? CreateOpenExceptionForCopyFile(Interop.ErrorInfo error, Interop.Sys.OpenFlags flags, string path) 77if (Interop.Sys.Link(sourceFullPath, destFullPath) >= 0) 87Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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(); 170if (Interop.Sys.Stat(destFullPath, out _) != 0) 172Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); 181Interop.CheckIo(Interop.Sys.Rename(sourceFullPath, destFullPath)); 195if (Interop.Sys.Rename(sourceFullPath, destFullPath) < 0) 197Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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(); 296int result = Interop.Sys.MkDir(path, (int)unixCreateMode); 302Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 340int result = Interop.Sys.MkDir(mkdirPath, (int)DefaultUnixCreateDirectoryMode); 346Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 373int result = Interop.Sys.MkDir(mkdirPath, (int)mode); 376Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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(); 527if (Interop.Sys.RmDir(fullPath) < 0) 529Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 662internal static string? GetLinkTarget(ReadOnlySpan<char> linkPath, bool isDirectory) => Interop.Sys.ReadLink(linkPath); 666Interop.CheckIo(Interop.Sys.SymLink(pathToTarget, path), path); 675string? linkTarget = Interop.Sys.ReadLink(linkPath); 679Interop.Error error = Interop.Sys.GetLastError(); 708current = Interop.Sys.ReadLink(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (7)
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 (4)
66const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 95Interop.Sys.Passwd passwd; 96int error = Interop.Sys.GetPwUidR(Interop.Sys.GetEUid(), out passwd, buf, bufLen);
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (24)
23FileStreamHelpers.CheckFileCall(Interop.Sys.FTruncate(handle, length), handle.Path); 36result = Interop.Sys.PRead(handle, bufPtr, buffer.Length, fileOffset); 41Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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(); 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 (10)
23Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 34CheckFileCall(Interop.Sys.LSeek(handle, offset, (Interop.Sys.SeekWhence)(int)origin), handle.Path); // SeekOrigin values are the same as Interop.libc.SeekWhence values 42if (Interop.Sys.FSync(handle) < 0) 44Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 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\Marshal.Unix.cs (7)
85Interop.Sys.Free(pvNative); 104void* p = Interop.Sys.Malloc((nuint)cbNative & ~WIN32_ALLOC_ALIGN); 130void* p = Interop.Sys.Malloc((nuint)cbNative & ~WIN32_ALLOC_ALIGN); 153Interop.Sys.Free((byte*)ptr - sizeof(nuint)); 178return Interop.Sys.GetErrNo(); 190Interop.Sys.SetErrNo(error); 200return 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\NativeMemory.Unix.cs (8)
46void* result = (adjustedByteCount < byteCount) ? null : Interop.Sys.AlignedAlloc(adjustedAlignment, adjustedByteCount); 67Interop.Sys.AlignedFree(ptr); 107void* result = (adjustedByteCount < byteCount) ? null : Interop.Sys.AlignedRealloc(ptr, adjustedAlignment, adjustedByteCount); 129void* result = Interop.Sys.Malloc((byteCount != 0) ? byteCount : 1); 155result = Interop.Sys.Calloc(elementCount, elementSize); 160result = Interop.Sys.Malloc(1); 182Interop.Sys.Free(ptr); 200void* result = Interop.Sys.Realloc(ptr, (byteCount != 0) ? byteCount : 1);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (6)
16if (!Interop.Sys.InitializeTerminalAndSignalHandling()) 21Interop.Sys.SetPosixSignalHandler(&OnPosixSignal); 28int signo = Interop.Sys.GetPlatformSignalNumber(signal); 45!Interop.Sys.EnablePosixSignalHandling(signo)) 70Interop.Sys.DisablePosixSignalHandling(token.SigNo); 136Interop.Sys.HandleNonCanceledPosixSignal(signo);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (2)
13public static string OSDescription => s_osDescription ??= (GetPrettyOSDescription() ?? Interop.Sys.GetUnixVersion()); 23osArch = Interop.Sys.GetOSArchitecture();
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.NonNativeAot.cs (1)
61uint id = Interop.Sys.TryGetUInt32OSThreadId();
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\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)
46internal static int GetCurrentProcessorNumber() => Interop.Sys.SchedGetCpu();
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (16)
237string? symlinkPath = Interop.Sys.ReadLink(tzFilePath); 253private static string? GetDirectoryEntryFullPath(ref Interop.Sys.DirectoryEntry dirent, string currentPath) 255ReadOnlySpan<char> direntName = dirent.GetName(stackalloc char[Interop.Sys.DirectoryEntry.NameBufferSize]); 271int bufferSize = Interop.Sys.GetReadDirRBufferSize(); 281IntPtr dirHandle = Interop.Sys.OpenDir(currentPath); 284throw Interop.GetExceptionForIoErrno(Interop.Sys.GetLastErrorInfo(), currentPath, isDirError: true); 290Interop.Sys.DirectoryEntry dirent; 291while (Interop.Sys.ReadDirR(dirHandle, dirBufferPtr, bufferSize, &dirent) == 0) 300if (dirent.InodeType == Interop.Sys.NodeType.DT_DIR) 305else if (dirent.InodeType == Interop.Sys.NodeType.DT_LNK || dirent.InodeType == Interop.Sys.NodeType.DT_UNKNOWN) 310Interop.Sys.FileStatus fileinfo; 311if (Interop.Sys.Stat(fullPath, out fileinfo) >= 0) 313isDir = (fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR; 343Interop.Sys.CloseDir(dirHandle);