C++ 两个进程能否通过ptrace连接到同一PID

C++ 两个进程能否通过ptrace连接到同一PID,c++,linux,process,ptrace,C++,Linux,Process,Ptrace,所以,标题说明了一切 一个进程是否可能有两个跟踪程序 我正在使用ptrace,我可以看到每当有人连接到进程时,TracerPID下的in/proc//status将是tracer的PID。然而,有可能有两个示踪剂吗 我有两个程序(tracer和tracee)。我在调试模式下运行tracee,然后运行tracer,得到了不允许的错误操作(即使有根权限) 问候,, 戈洛比奇他们不能。在ptrace手册页中间接确认: EPERM The specified process cannot b

所以,标题说明了一切

一个进程是否可能有两个跟踪程序

我正在使用ptrace,我可以看到每当有人连接到进程时,TracerPID下的in/proc//status将是tracer的PID。然而,有可能有两个示踪剂吗

我有两个程序(tracer和tracee)。我在调试模式下运行tracee,然后运行tracer,得到了不允许的错误操作(即使有根权限)

问候,,
戈洛比奇

他们不能。在ptrace手册页中间接确认:

   EPERM  The  specified  process cannot be traced.  This could be because
          the tracer has insufficient privileges (the required  capability
          is  CAP_SYS_PTRACE);  unprivileged  processes  cannot trace pro‐
          cesses that they cannot send signals to or  those  running  set-
          user-ID/set-group-ID  programs,  for  obvious reasons.  Alterna‐
          tively, the process may already be being traced, or (on  kernels
          before 2.6.26) be init(1) (PID 1).

他们不能。在ptrace手册页中间接确认:

   EPERM  The  specified  process cannot be traced.  This could be because
          the tracer has insufficient privileges (the required  capability
          is  CAP_SYS_PTRACE);  unprivileged  processes  cannot trace pro‐
          cesses that they cannot send signals to or  those  running  set-
          user-ID/set-group-ID  programs,  for  obvious reasons.  Alterna‐
          tively, the process may already be being traced, or (on  kernels
          before 2.6.26) be init(1) (PID 1).

不错。谢谢,很好。非常感谢。