[libc-commits] [PATCH] D135752: [libc] Add a simple implementation of the posix_spawn function.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Oct 12 12:22:47 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/spawn/linux/posix_spawn.cpp:23-31
+pid_t fork() {
+#ifdef SYS_fork
+  return __llvm_libc::syscall_impl(SYS_fork);
+#elif defined(SYS_clone)
+  return __llvm_libc::syscall_impl(SYS_clone, SIGCHLD, 0);
+#else
+#error "SYS_fork or SYS_clone not available."
----------------
michaelrj wrote:
> this feels like it might be better as a shared utility given that it's mostly the same as `unistd/linux/fork.cpp` (and same for the others below)
I have considered that but what I have here is only temporary. We will have to change at least `fork`. I have added a TODO to fork to reflect how it is to be changed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135752/new/

https://reviews.llvm.org/D135752



More information about the libc-commits mailing list