180 references to Interop
System.Diagnostics.Process (180)
LibraryImports.g.cs (33)
71
private static partial int PathConf(string path, global::
Interop
.Sys.PathConfName name)
100
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.PathConfName __name_native);
109
internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::
Interop
.Sys.FileStatus output)
122
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
141
static extern unsafe int __PInvoke(nint __fd_native, global::
Interop
.Sys.FileStatus* __output_native);
150
internal static partial int Stat(string path, out global::
Interop
.Sys.FileStatus output)
163
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
182
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.FileStatus* __output_native);
191
internal static partial int LStat(string path, out global::
Interop
.Sys.FileStatus output)
204
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
223
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.FileStatus* __output_native);
602
internal static partial nuint ZSTD_decompressStream(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, ref global::
Interop
.Zstd.ZstdOutBuffer output, ref global::
Interop
.Zstd.ZstdInBuffer input)
613
fixed (global::
Interop
.Zstd.ZstdInBuffer* __input_native = &input)
614
fixed (global::
Interop
.Zstd.ZstdOutBuffer* __output_native = &output)
630
static extern unsafe nuint __PInvoke(nint __dctx_native, global::
Interop
.Zstd.ZstdOutBuffer* __output_native, global::
Interop
.Zstd.ZstdInBuffer* __input_native);
639
internal static partial nuint ZSTD_DCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::
Interop
.Zstd.ZstdDParameter param, int value)
664
static extern unsafe nuint __PInvoke(nint __dctx_native, global::
Interop
.Zstd.ZstdDParameter __param_native, int __value_native);
707
internal static partial nuint ZSTD_DCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::
Interop
.Zstd.ZstdResetDirective reset)
732
static extern unsafe nuint __PInvoke(nint __dctx_native, global::
Interop
.Zstd.ZstdResetDirective __reset_native);
741
internal static partial nuint ZSTD_compressStream2(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, ref global::
Interop
.Zstd.ZstdOutBuffer output, ref global::
Interop
.Zstd.ZstdInBuffer input, global::
Interop
.Zstd.ZstdEndDirective endOp)
752
fixed (global::
Interop
.Zstd.ZstdInBuffer* __input_native = &input)
753
fixed (global::
Interop
.Zstd.ZstdOutBuffer* __output_native = &output)
769
static extern unsafe nuint __PInvoke(nint __cctx_native, global::
Interop
.Zstd.ZstdOutBuffer* __output_native, global::
Interop
.Zstd.ZstdInBuffer* __input_native, global::
Interop
.Zstd.ZstdEndDirective __endOp_native);
778
internal static partial nuint ZSTD_CCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::
Interop
.Zstd.ZstdCParameter param, int value)
803
static extern unsafe nuint __PInvoke(nint __cctx_native, global::
Interop
.Zstd.ZstdCParameter __param_native, int __value_native);
846
internal static partial nuint ZSTD_CCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::
Interop
.Zstd.ZstdResetDirective reset)
871
static extern unsafe nuint __PInvoke(nint __cctx_native, global::
Interop
.Zstd.ZstdResetDirective __reset_native);
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (6)
210
Interop
.Error error =
Interop
.procfs.GetFileSystemTypeForRealPath(SysFsCgroupFileSystemPath, out string format);
211
if (error ==
Interop
.Error.SUCCESS)
302
return TryFindHierarchyMount(cgroupVersion,
Interop
.procfs.ProcMountInfoFilePath, subsystem, out root, out path);
323
if (
Interop
.procfs.TryParseMountInfoLine(line, out
Interop
.procfs.ParsedMount mount))
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
141
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
146
return
Interop
.Sys.StrError(RawErrno);
220
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
222
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)
37
const int BufLen =
Interop
.Sys.Passwd.InitialBufferSize;
64
Interop
.Sys.Passwd passwd;
65
int error =
Interop
.Sys.GetPwUidR(uid, out passwd, buf, bufLen);
83
var errorInfo = new
Interop
.ErrorInfo(error);
87
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))
259
internal static string? GetExePath(
Interop
.procfs.ProcPid procPid)
261
return procPid ==
Interop
.procfs.ProcPid.Self ? Environment.ProcessPath :
262
Interop
.Sys.ReadLink(
Interop
.procfs.GetExeFilePathForProcess(procPid));
268
internal static string GetUntruncatedProcessName(
Interop
.procfs.ProcPid procPid, ref
Interop
.procfs.ParsedStat stat)
270
string cmdLineFilePath =
Interop
.procfs.GetCmdLinePathForProcess(procPid);
367
private
Interop
.procfs.ParsedStat GetStat()
370
Interop
.procfs.ParsedStat stat;
System\Diagnostics\Process.Unix.cs (44)
75
int killResult =
Interop
.Sys.Kill(_processId,
Interop
.Sys.Signals.SIGKILL);
78
Interop
.Error error =
Interop
.Sys.GetLastError();
81
if (error ==
Interop
.Error.ESRCH)
111
int stopResult =
Interop
.Sys.Kill(_processId,
Interop
.Sys.Signals.SIGSTOP);
114
Interop
.Error error =
Interop
.Sys.GetLastError();
116
if (error !=
Interop
.Error.ESRCH)
125
int killResult =
Interop
.Sys.Kill(_processId,
Interop
.Sys.Signals.SIGKILL);
128
Interop
.Error error =
Interop
.Sys.GetLastError();
130
if (error !=
Interop
.Error.ESRCH)
265
int errno =
Interop
.Sys.GetPriority(
Interop
.Sys.PriorityWhich.PRIO_PROCESS, _processId, out int pri);
297
int result =
Interop
.Sys.SetPriority(
Interop
.Sys.PriorityWhich.PRIO_PROCESS, _processId, pri);
390
bool usesTerminal = (stdinHandle is not null &&
Interop
.Sys.IsATty(stdinHandle))
391
|| (stdoutHandle is not null &&
Interop
.Sys.IsATty(stdoutHandle))
392
|| (stderrHandle is not null &&
Interop
.Sys.IsATty(stderrHandle));
400
throw new Win32Exception(
Interop
.Errors.ERROR_NO_ASSOCIATION);
460
Interop
.ErrorInfo errno =
Interop
.Error.ENOENT.Info();
481
int errno =
Interop
.Sys.ForkAndExecProcess(
502
new
Interop
.ErrorInfo(errno).Error ==
Interop
.Error.ENOEXEC)
507
throw CreateExceptionForErrorStartingProcess(new
Interop
.ErrorInfo(errno).GetErrorMessage(), errno, resolvedFilename, cwd);
633
if (
Interop
.Sys.Access(resolvedFilename,
Interop
.Sys.AccessMode.X_OK) == 0)
702
ticksPerSecond =
Interop
.Sys.SysConf(
Interop
.Sys.SysConfName._SC_CLK_TCK);
726
private static bool SupportsAtomicNonInheritablePipeCreation =>
Interop
.Sys.IsAtomicNonInheritablePipeCreationSupported;
859
uint[]? groups =
Interop
.Sys.GetGroupList(startInfo.UserName, groupId!.Value);
870
Interop
.Sys.Passwd? passwd;
874
const int BufLen =
Interop
.Sys.Passwd.InitialBufferSize;
906
private static unsafe bool TryGetPasswd(string name, byte* buf, int bufLen, out
Interop
.Sys.Passwd? passwd)
909
Interop
.Sys.Passwd tempPasswd;
910
int error =
Interop
.Sys.GetPwNamR(name, out tempPasswd, buf, bufLen);
927
var errorInfo = new
Interop
.ErrorInfo(error);
931
if (errorInfo.Error ==
Interop
.Error.ERANGE)
962
if (!
Interop
.Sys.InitializeTerminalAndSignalHandling())
968
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;
274
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\ProcessUtils.Unix.cs (6)
12
Interop
.Sys.FileStatus fileinfo;
14
if (
Interop
.Sys.Stat(fullPath, out fileinfo) < 0)
20
if ((fileinfo.Mode &
Interop
.Sys.FileTypes.S_IFMT) ==
Interop
.Sys.FileTypes.S_IFDIR)
39
uint euid =
Interop
.Sys.GetEUid();
61
if (
Interop
.Sys.IsMemberOfGroup(fileinfo.Gid))
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);