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