_cleanup_free_ char *escaped = NULL, *comm = NULL;
int r;
- assert(ret);
assert(pid >= 0);
+ assert(ret);
if (pid == 0 || pid == getpid_cached()) {
comm = new0(char, TASK_COMM_LEN + 1); /* Must fit in 16 byte according to prctl(2) */
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
r = pid_get_comm(pid->pid, &comm);
if (r < 0)
return r;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
r = pid_get_cmdline(pid->pid, max_columns, flags, &s);
if (r < 0)
return r;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
r = pid_get_cmdline_strv(pid->pid, flags, &args);
if (r < 0)
return r;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
result = pid_is_kernel_thread(pid->pid);
if (result < 0)
return result;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
r = pid_get_uid(pid->pid, &uid);
if (r < 0)
return r;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
r = pid_get_start_time(pid->pid, ret ? &t : NULL);
if (r < 0)
return r;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
result = pid_is_my_child(pid->pid);
if (result < 0)
return result;
if (!pidref_is_set(pid))
return -ESRCH;
+ if (pidref_is_remote(pid))
+ return -EREMOTE;
+
if (pid->pid == 1 || pidref_is_self(pid))
return true;
if (!pidref_is_set(pidref))
return -ESRCH;
+ if (pidref_is_remote(pidref))
+ return -EREMOTE;
+
result = pid_is_alive(pidref->pid);
if (result < 0) {
assert(result != -ESRCH);