220 references to Interop
System.Diagnostics.Process (220)
_generated\0\LibraryImports.g.cs (42)
7internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno); 15internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error); 31internal static unsafe extern partial global::Interop.Error Poll(global::Interop.PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); 382internal static partial long SysConf(global::Interop.Sys.SysConfName name) 396static extern unsafe long __PInvoke(global::Interop.Sys.SysConfName __name_native); 489internal static unsafe partial int GetPwUidR(uint uid, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen) 494fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd) 502static extern unsafe int __PInvoke(uint __uid_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native); 511internal static unsafe partial int GetPwNamR(string name, out global::Interop.Sys.Passwd pwd, byte* buf, int bufLen) 523fixed (global::Interop.Sys.Passwd* __pwd_native = &pwd) 539static extern unsafe int __PInvoke(byte* __name_native, global::Interop.Sys.Passwd* __pwd_native, byte* __buf_native, int __bufLen_native); 548private static partial int GetPriority(global::Interop.Sys.PriorityWhich which, int who) 562static extern unsafe int __PInvoke(global::Interop.Sys.PriorityWhich __which_native, int __who_native); 571internal static partial int SetPriority(global::Interop.Sys.PriorityWhich which, int who, int nice) 585static extern unsafe int __PInvoke(global::Interop.Sys.PriorityWhich __which_native, int __who_native, int __nice_native); 818internal static partial int GetRLimit(global::Interop.Sys.RlimitResources resourceType, out global::Interop.Sys.RLimit limits) 824fixed (global::Interop.Sys.RLimit* __limits_native = &limits) 835static extern unsafe int __PInvoke(global::Interop.Sys.RlimitResources __resourceType_native, global::Interop.Sys.RLimit* __limits_native); 844internal static partial int SetRLimit(global::Interop.Sys.RlimitResources resourceType, ref global::Interop.Sys.RLimit limits) 849fixed (global::Interop.Sys.RLimit* __limits_native = &limits) 860static extern unsafe int __PInvoke(global::Interop.Sys.RlimitResources __resourceType_native, global::Interop.Sys.RLimit* __limits_native); 869private static partial int PathConf(string path, global::Interop.Sys.PathConfName name) 898static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native); 958internal static partial int Access(string path, global::Interop.Sys.AccessMode mode) 987static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.AccessMode __mode_native); 996internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 1009fixed (global::Interop.Sys.FileStatus* __output_native = &output) 1028static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native); 1037internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output) 1050fixed (global::Interop.Sys.FileStatus* __output_native = &output) 1069static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 1078internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output) 1091fixed (global::Interop.Sys.FileStatus* __output_native = &output) 1110static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 1260internal static partial int GetSpaceInfoForMountPoint(string name, out global::Interop.Sys.MountPointInformation mpi) 1273fixed (global::Interop.Sys.MountPointInformation* __mpi_native = &mpi) 1292static extern unsafe int __PInvoke(byte* __name_native, global::Interop.Sys.MountPointInformation* __mpi_native);
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (18)
81int result = Interop.Sys.Kill(processId, 0); 85Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 87if (errorInfo.Error == Interop.Error.EPERM) 92if (errorInfo.Error == Interop.Error.ESRCH || errorInfo.Error == Interop.Error.EINVAL) 116int signalNumber = Interop.Sys.GetPlatformSignalNumber(signal); 122int killResult = Interop.Sys.Kill(ProcessId, signalNumber); 125Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 128if (errorInfo.Error == Interop.Error.ESRCH) 273throw new Win32Exception(Interop.Errors.ERROR_NO_ASSOCIATION); 335Interop.ErrorInfo error = Interop.Error.ENOENT.Info(); 356errno = Interop.Sys.ForkAndExecProcess( 391new Interop.ErrorInfo(errno).Error == Interop.Error.ENOEXEC) 396throw ProcessUtils.CreateExceptionForErrorStartingProcess(new Interop.ErrorInfo(errno).GetErrorMessage(), errno, resolvedFilename, cwd);
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (6)
210Interop.Error error = Interop.procfs.GetFileSystemTypeForRealPath(SysFsCgroupFileSystemPath, out string format); 211if (error == Interop.Error.SUCCESS) 302return TryFindHierarchyMount(cgroupVersion, Interop.procfs.ProcMountInfoFilePath, subsystem, out root, out path); 323if (Interop.procfs.TryParseMountInfoLine(line, out Interop.procfs.ParsedMount mount))
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
26rv = Interop.Sys.GetGroupList(userName, primaryGroupId, pGroups, &ngroups);
src\runtime\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\runtime\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)
System\Diagnostics\Process.Linux.cs (16)
56bootTimeTicks = Interop.Sys.GetBootTimeTicks(); 103Interop.procfs.ParsedStat stat = GetStat(); 129if (!ProcessManager.TryGetProcPid(_processId, out Interop.procfs.ProcPid procPid)) 133string path = Interop.procfs.GetFileDescriptorDirectoryPathForProcess(procPid); 157if (Interop.Sys.SchedGetAffinity(_processId, out set) != 0) 168if (Interop.Sys.SchedSetAffinity(_processId, ref value) != 0) 185if (!Interop.cgroups.TryGetMemoryLimit(out ulong rsslim)) 225internal static string? GetExePath(Interop.procfs.ProcPid procPid) 227return procPid == Interop.procfs.ProcPid.Self ? Environment.ProcessPath : 228Interop.Sys.ReadLink(Interop.procfs.GetExeFilePathForProcess(procPid)); 234internal static unsafe string GetUntruncatedProcessName(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat stat) 236string cmdLineFilePath = Interop.procfs.GetCmdLinePathForProcess(procPid); 333private Interop.procfs.ParsedStat GetStat() 336Interop.procfs.ParsedStat stat;
System\Diagnostics\Process.Multiplexing.Unix.cs (26)
45if (Interop.Sys.Fcntl.DangerousSetIsNonBlocking(outputFd, 1) != 0 46|| Interop.Sys.Fcntl.DangerousSetIsNonBlocking(errorFd, 1) != 0) 52Interop.PollEvent[] pollFds = new Interop.PollEvent[2]; 73if (pollFds[i].TriggeredEvents == Interop.PollEvents.POLLNONE) 132Span<Interop.PollEvent> pollFds, 145pollFds[numFds].Events = Interop.PollEvents.POLLIN; 146pollFds[numFds].TriggeredEvents = Interop.PollEvents.POLLNONE; 154pollFds[numFds].Events = Interop.PollEvents.POLLIN; 155pollFds[numFds].TriggeredEvents = Interop.PollEvents.POLLNONE; 168Span<Interop.PollEvent> pollFds, 182Interop.Error pollError; 185fixed (Interop.PollEvent* pPollFds = pollFds) 187pollError = Interop.Sys.Poll(pPollFds, (uint)numFds, pollTimeout, &triggered); 191if (pollError != Interop.Error.SUCCESS) 193if (pollError == Interop.Error.EINTR) 198throw new Win32Exception(Interop.Sys.ConvertErrorPalToPlatform(pollError)); 276if (Interop.Sys.Fcntl.DangerousSetIsNonBlocking(outputFd, 1) != 0 || Interop.Sys.Fcntl.DangerousSetIsNonBlocking(errorFd, 1) != 0) 281Span<Interop.PollEvent> pollFds = stackalloc Interop.PollEvent[2]; 294if (pollFds[i].TriggeredEvents == Interop.PollEvents.POLLNONE) 333int bytesRead = Interop.Sys.Read(handle, pBuffer + offset, buffer.Length - offset); 336Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); 337if (errorInfo.Error == Interop.Error.EAGAIN)
System\Diagnostics\Process.Unix.cs (21)
72int killResult = Interop.Sys.Kill(_processId, Interop.Sys.GetPlatformSignalNumber(PosixSignal.SIGKILL)); 75Interop.Error error = Interop.Sys.GetLastError(); 78if (error == Interop.Error.ESRCH) 108int stopResult = Interop.Sys.Kill(_processId, Interop.Sys.GetPlatformSIGSTOP()); 111Interop.Error error = Interop.Sys.GetLastError(); 113if (error != Interop.Error.ESRCH) 122int killResult = Interop.Sys.Kill(_processId, Interop.Sys.GetPlatformSignalNumber(PosixSignal.SIGKILL)); 125Interop.Error error = Interop.Sys.GetLastError(); 127if (error != Interop.Error.ESRCH) 262int errno = Interop.Sys.GetPriority(Interop.Sys.PriorityWhich.PRIO_PROCESS, _processId, out int pri); 294int result = Interop.Sys.SetPriority(Interop.Sys.PriorityWhich.PRIO_PROCESS, _processId, pri); 388ticksPerSecond = Interop.Sys.SysConf(Interop.Sys.SysConfName._SC_CLK_TCK);
System\Diagnostics\ProcessManager.Linux.cs (33)
38if (TryGetProcPid(processId, out Interop.procfs.ProcPid procPid) && 39Interop.procfs.TryReadStatFile(procPid, out Interop.procfs.ParsedStat stat)) 53if (TryGetProcPid(processId, out Interop.procfs.ProcPid procPid)) 55modules = Interop.procfs.ParseMapsModules(procPid); 84if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid) || 85!Interop.procfs.TryReadStatFile(procPid, out Interop.procfs.ParsedStat stat)) 100Interop.procfs.TryReadStatusFile(procPid, out Interop.procfs.ParsedStatus status); 107internal static ProcessInfo CreateProcessInfo(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat procFsStat, ref Interop.procfs.ParsedStatus procFsStatus, string? processName = null) 131string tasksDir = Interop.procfs.GetTaskDirectoryPathForProcess(procPid); 139Interop.procfs.ParsedStat stat; 141Interop.procfs.TryReadStatFile(procPid, tid, out stat)) 177foreach (string procDir in Directory.EnumerateDirectories(Interop.procfs.RootPath)) 232internal static bool TryReadStatFile(int pid, out Interop.procfs.ParsedStat stat) 234if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 239return Interop.procfs.TryReadStatFile(procPid, out stat); 242internal static bool TryReadStatusFile(int pid, out Interop.procfs.ParsedStatus status) 244if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 249return Interop.procfs.TryReadStatusFile(procPid, out status); 252internal static bool TryReadStatFile(int pid, int tid, out Interop.procfs.ParsedStat stat) 254if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 259return Interop.procfs.TryReadStatFile(procPid, tid, out stat); 262internal static bool TryGetProcPid(int pid, out Interop.procfs.ProcPid procPid) 267procPid = Interop.procfs.ProcPid.Self; 273procPid = (Interop.procfs.ProcPid)pid; 278procPid = Interop.procfs.ProcPid.Invalid; 291if (Interop.Sys.ReadLink($"{Interop.procfs.RootPath}{Interop.procfs.Self}") is string target &&
System\Diagnostics\ProcessManager.Unix.cs (4)
30int output = Interop.Sys.Kill(processId, 0); 32return 0 == output || (-1 == output && Interop.Error.EPERM == Interop.Sys.GetLastError()); 49machineName != Interop.Sys.GetHostName();
System\Diagnostics\ProcessThread.Linux.cs (7)
23Interop.procfs.ParsedStat stat = GetStat(); 24return Interop.Sys.GetThreadPriorityFromNiceValue((int)stat.nice); 43Interop.procfs.ParsedStat stat = GetStat(); 62Interop.procfs.ParsedStat stat = GetStat(); 78Interop.procfs.ParsedStat stat = GetStat(); 83private Interop.procfs.ParsedStat GetStat() 85Interop.procfs.ParsedStat stat;
System\Diagnostics\ProcessUtils.ConfigureTerminalForChildProcesses.Unix.cs (5)
25Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: true); 34Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: false); 41Interop.Sys.SetDelayedSigChildConsoleConfigurationHandler(&DelayedSigChildConsoleConfiguration); 54Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: false); 65internal static bool IsTerminal(SafeFileHandle? standardHandle) => standardHandle is not null && Interop.Sys.IsATty(standardHandle);
System\Diagnostics\ProcessUtils.Unix.cs (19)
22internal static bool SupportsAtomicNonInheritablePipeCreation => Interop.Sys.IsAtomicNonInheritablePipeCreationSupported; 26Interop.Sys.FileStatus fileinfo; 28if (Interop.Sys.Stat(fullPath, out fileinfo) < 0) 34if ((fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 53uint euid = Interop.Sys.GetEUid(); 75if (Interop.Sys.IsMemberOfGroup(fileinfo.Gid)) 96if (!Interop.Sys.InitializeTerminalAndSignalHandling()) 102Interop.Sys.RegisterForSigChld(&OnSigChild); 122uint[]? groups = Interop.Sys.GetGroupList(startInfo.UserName, groupId!.Value); 133Interop.Sys.Passwd? passwd; 137const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 169private static unsafe bool TryGetPasswd(string name, byte* buf, int bufLen, out Interop.Sys.Passwd? passwd) 172Interop.Sys.Passwd tempPasswd; 173int error = Interop.Sys.GetPwNamR(name, out tempPasswd, buf, bufLen); 190var errorInfo = new Interop.ErrorInfo(error); 194if (errorInfo.Error == Interop.Error.ERANGE) 251if (Interop.Sys.Access(resolvedFilename, Interop.Sys.AccessMode.X_OK) == 0)
System\Diagnostics\ProcessWaitState.Unix.cs (8)
369int killResult = Interop.Sys.Kill(_processId, 0); // 0 means don't send a signal, used to check if process is still alive 379Interop.Error errno = Interop.Sys.GetLastError(); 380if (errno == Interop.Error.ESRCH) 385else if (errno == Interop.Error.EPERM) 588int waitResult = Interop.Sys.WaitPidExitedNoHang(_processId, out exitCode, out terminatingSignal); 622pid = Interop.Sys.WaitIdAnyExitedNoHangNoWait(); 694pid = Interop.Sys.WaitPidExitedNoHang(-1, out exitCode, out terminatingSignal);