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