News for hackers. Stuff that matters.
Re:In C, how do you know if the dynamic allocation succeeded? by Koromix on Saturday November 06, 2021 @04:51AM (#29128522)
I think that in a proper API, we could have:

  int process_handle = spawn("/bin/true", SP_PAUSED); // create process but don't execute, and return a handle
  // most API would take a process handle, thus you could do stuff (such as prctl) on the new process
  unpause(process_handle);
There's a bit of a move in this direction in the Linux API with the PIDFD stuff.
Re:In C, how do you know if the dynamic allocation succeeded? by jagrsw on Saturday November 06, 2021 @05:05AM (#29128616)
Sounds reasonable. I guess most process controlling syscalls (ptrace, prctl, seccomp, bpf, remotely operating on pid's FDs, setsid, signal masks) will have to be replaced to be able to operate on remote process or on a fd, but yeah, this can work, potentially.