117 references to Interop
System.Diagnostics.Process (117)
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 (17)
34
if (
Interop
.procfs.TryReadStatFile(pid, out
Interop
.procfs.ParsedStat parsedStat))
38
Interop
.procfs.TryReadStatusFile(pid, out
Interop
.procfs.ParsedStatus parsedStatus))
92
bootTimeTicks =
Interop
.Sys.GetBootTimeTicks();
134
Interop
.procfs.ParsedStat stat = GetStat();
163
string path =
Interop
.procfs.GetFileDescriptorDirectoryPathForProcess(_processId);
187
if (
Interop
.Sys.SchedGetAffinity(_processId, out set) != 0)
198
if (
Interop
.Sys.SchedSetAffinity(_processId, ref value) != 0)
215
if (!
Interop
.cgroups.TryGetMemoryLimit(out ulong rsslim))
257
Interop
.Sys.ReadLink(
Interop
.procfs.GetExeFilePathForProcess(processId));
262
internal static string GetUntruncatedProcessName(ref
Interop
.procfs.ParsedStat stat)
264
string cmdLineFilePath =
Interop
.procfs.GetCmdLinePathForProcess(stat.pid);
361
private
Interop
.procfs.ParsedStat GetStat()
364
Interop
.procfs.ParsedStat stat;
365
if (!
Interop
.procfs.TryReadStatFile(_processId, out 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);
669
if (
Interop
.Sys.Access(resolvedFilename,
Interop
.Sys.AccessMode.X_OK) == 0)
753
Interop
.Sys.FileStatus fileinfo;
755
if (
Interop
.Sys.Stat(fullPath, out fileinfo) < 0)
761
if ((fileinfo.Mode &
Interop
.Sys.FileTypes.S_IFMT) ==
Interop
.Sys.FileTypes.S_IFDIR)
780
uint euid =
Interop
.Sys.GetEUid();
802
if (
Interop
.Sys.IsMemberOfGroup(fileinfo.Gid))
824
ticksPerSecond =
Interop
.Sys.SysConf(
Interop
.Sys.SysConfName._SC_CLK_TCK);
973
uint[]? groups =
Interop
.Sys.GetGroupList(startInfo.UserName, groupId!.Value);
984
Interop
.Sys.Passwd? passwd;
988
const int BufLen =
Interop
.Sys.Passwd.InitialBufferSize;
1020
private static unsafe bool TryGetPasswd(string name, byte* buf, int bufLen, out
Interop
.Sys.Passwd? passwd)
1023
Interop
.Sys.Passwd tempPasswd;
1024
int error =
Interop
.Sys.GetPwNamR(name, out tempPasswd, buf, bufLen);
1041
var errorInfo = new
Interop
.ErrorInfo(error);
1045
if (errorInfo.Error ==
Interop
.Error.ERANGE)
1076
if (!
Interop
.Sys.InitializeTerminalAndSignalHandling())
1082
Interop
.Sys.RegisterForSigChld(&OnSigChild);
System\Diagnostics\ProcessManager.Linux.cs (11)
44
ProcessModuleCollection modules =
Interop
.procfs.ParseMapsModules(processId) ?? new(capacity: 0);
73
if (
Interop
.procfs.TryReadStatFile(pid, out
Interop
.procfs.ParsedStat stat))
75
Interop
.procfs.TryReadStatusFile(pid, out
Interop
.procfs.ParsedStatus status);
84
internal static ProcessInfo CreateProcessInfo(ref
Interop
.procfs.ParsedStat procFsStat, ref
Interop
.procfs.ParsedStatus procFsStatus, string? processName = null)
108
string tasksDir =
Interop
.procfs.GetTaskDirectoryPathForProcess(pid);
116
Interop
.procfs.ParsedStat stat;
118
Interop
.procfs.TryReadStatFile(pid, tid, out stat))
152
foreach (string procDir in Directory.EnumerateDirectories(
Interop
.procfs.RootPath))
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 (8)
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;
86
if (!
Interop
.procfs.TryReadStatFile(pid: _processId, tid: Id, result: out 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);