139 references to Interop
System.Diagnostics.Process (139)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (2)
215int result = Interop.Sys.GetFormatInfoForMountPoint(SysFsCgroupFileSystemPath, formatBuffer, MountPointFormatBufferSizeInBytes, &numericFormat); 218if (numericFormat == (int)Interop.Sys.UnixFileSystemTypes.cgroup2fs)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
123_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 140get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 145return Interop.Sys.StrError(RawErrno); 219public static Interop.ErrorInfo Info(this Interop.Error error) 221return new Interop.ErrorInfo(error);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
26rv = Interop.Sys.GetGroupList(userName, primaryGroupId, pGroups, &ngroups);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (5)
36const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 63Interop.Sys.Passwd passwd; 64int error = Interop.Sys.GetPwUidR(uid, out passwd, buf, bufLen); 82var errorInfo = new Interop.ErrorInfo(error); 86if (errorInfo.Error == Interop.Error.ERANGE)
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.ConfigureTerminalForChildProcesses.Unix.cs (4)
24Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: true); 33Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: false); 40Interop.Sys.SetDelayedSigChildConsoleConfigurationHandler(&DelayedSigChildConsoleConfiguration); 53Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: false);
System\Diagnostics\Process.Linux.cs (21)
34if (ProcessManager.TryGetProcPid(pid, out Interop.procfs.ProcPid procPid) && 35Interop.procfs.TryReadStatFile(procPid, out Interop.procfs.ParsedStat parsedStat)) 39Interop.procfs.TryReadStatusFile(procPid, out Interop.procfs.ParsedStatus parsedStatus)) 90bootTimeTicks = Interop.Sys.GetBootTimeTicks(); 137Interop.procfs.ParsedStat stat = GetStat(); 163if (!ProcessManager.TryGetProcPid(_processId, out Interop.procfs.ProcPid procPid)) 167string path = Interop.procfs.GetFileDescriptorDirectoryPathForProcess(procPid); 191if (Interop.Sys.SchedGetAffinity(_processId, out set) != 0) 202if (Interop.Sys.SchedSetAffinity(_processId, ref value) != 0) 219if (!Interop.cgroups.TryGetMemoryLimit(out ulong rsslim)) 258internal static string? GetExePath(Interop.procfs.ProcPid procPid) 260return procPid == Interop.procfs.ProcPid.Self ? Environment.ProcessPath : 261Interop.Sys.ReadLink(Interop.procfs.GetExeFilePathForProcess(procPid)); 267internal static string GetUntruncatedProcessName(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat stat) 269string cmdLineFilePath = Interop.procfs.GetCmdLinePathForProcess(procPid); 366private Interop.procfs.ParsedStat GetStat() 369Interop.procfs.ParsedStat stat;
System\Diagnostics\Process.Unix.cs (46)
76int killResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.SIGKILL); 79Interop.Error error = Interop.Sys.GetLastError(); 82if (error == Interop.Error.ESRCH) 112int stopResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.SIGSTOP); 115Interop.Error error = Interop.Sys.GetLastError(); 117if (error != Interop.Error.ESRCH) 126int killResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.SIGKILL); 129Interop.Error error = Interop.Sys.GetLastError(); 131if (error != Interop.Error.ESRCH) 266int errno = Interop.Sys.GetPriority(Interop.Sys.PriorityWhich.PRIO_PROCESS, _processId, out int pri); 298int result = Interop.Sys.SetPriority(Interop.Sys.PriorityWhich.PRIO_PROCESS, _processId, pri); 414throw new Win32Exception(Interop.Errors.ERROR_NO_ASSOCIATION); 498Interop.ErrorInfo errno = Interop.Error.ENOENT.Info(); 519int errno = Interop.Sys.ForkAndExecProcess( 541new Interop.ErrorInfo(errno).Error == Interop.Error.ENOEXEC) 546throw CreateExceptionForErrorStartingProcess(new Interop.ErrorInfo(errno).GetErrorMessage(), errno, resolvedFilename, cwd); 675if (Interop.Sys.Access(resolvedFilename, Interop.Sys.AccessMode.X_OK) == 0) 759Interop.Sys.FileStatus fileinfo; 761if (Interop.Sys.Stat(fullPath, out fileinfo) < 0) 767if ((fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) 786uint euid = Interop.Sys.GetEUid(); 808if (Interop.Sys.IsMemberOfGroup(fileinfo.Gid)) 830ticksPerSecond = Interop.Sys.SysConf(Interop.Sys.SysConfName._SC_CLK_TCK); 979uint[]? groups = Interop.Sys.GetGroupList(startInfo.UserName, groupId!.Value); 990Interop.Sys.Passwd? passwd; 994const int BufLen = Interop.Sys.Passwd.InitialBufferSize; 1026private static unsafe bool TryGetPasswd(string name, byte* buf, int bufLen, out Interop.Sys.Passwd? passwd) 1029Interop.Sys.Passwd tempPasswd; 1030int error = Interop.Sys.GetPwNamR(name, out tempPasswd, buf, bufLen); 1047var errorInfo = new Interop.ErrorInfo(error); 1051if (errorInfo.Error == Interop.Error.ERANGE) 1082if (!Interop.Sys.InitializeTerminalAndSignalHandling()) 1088Interop.Sys.RegisterForSigChld(&OnSigChild);
System\Diagnostics\ProcessManager.Linux.cs (30)
47if (TryGetProcPid(processId, out Interop.procfs.ProcPid procPid)) 49modules = Interop.procfs.ParseMapsModules(procPid); 78if (TryGetProcPid(pid, out Interop.procfs.ProcPid procPid) && 79Interop.procfs.TryReadStatFile(procPid, out Interop.procfs.ParsedStat stat)) 81Interop.procfs.TryReadStatusFile(procPid, out Interop.procfs.ParsedStatus status); 90internal static ProcessInfo CreateProcessInfo(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat procFsStat, ref Interop.procfs.ParsedStatus procFsStatus, string? processName = null) 114string tasksDir = Interop.procfs.GetTaskDirectoryPathForProcess(procPid); 122Interop.procfs.ParsedStat stat; 124Interop.procfs.TryReadStatFile(procPid, tid, out stat)) 160foreach (string procDir in Directory.EnumerateDirectories(Interop.procfs.RootPath)) 215internal static bool TryReadStatFile(int pid, out Interop.procfs.ParsedStat stat) 217if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 222return Interop.procfs.TryReadStatFile(procPid, out stat); 225internal static bool TryReadStatusFile(int pid, out Interop.procfs.ParsedStatus status) 227if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 232return Interop.procfs.TryReadStatusFile(procPid, out status); 235internal static bool TryReadStatFile(int pid, int tid, out Interop.procfs.ParsedStat stat) 237if (!TryGetProcPid(pid, out Interop.procfs.ProcPid procPid)) 242return Interop.procfs.TryReadStatFile(procPid, tid, out stat); 245internal static bool TryGetProcPid(int pid, out Interop.procfs.ProcPid procPid) 250procPid = Interop.procfs.ProcPid.Self; 256procPid = (Interop.procfs.ProcPid)pid; 261procPid = Interop.procfs.ProcPid.Invalid; 278if (Interop.Sys.ReadLink($"{Interop.procfs.RootPath}{Interop.procfs.Self}") is string target &&
System\Diagnostics\ProcessManager.Unix.cs (5)
30int output = Interop.Sys.Kill(processId, Interop.Sys.Signals.None); 32return 0 == output || (-1 == output && Interop.Error.EPERM == Interop.Sys.GetLastError()); 69machineName != 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\ProcessWaitState.Unix.cs (9)
354int killResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.None); // None means don't send a signal 364Interop.Error errno = Interop.Sys.GetLastError(); 365if (errno == Interop.Error.ESRCH) 370else if (errno == Interop.Error.EPERM) 571int waitResult = Interop.Sys.WaitPidExitedNoHang(_processId, out exitCode); 605pid = Interop.Sys.WaitIdAnyExitedNoHangNoWait(); 676pid = Interop.Sys.WaitPidExitedNoHang(-1, out exitCode);