[libc-commits] [PATCH] D74949: [libc] Create abort and _Exit

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Feb 20 23:47:23 PST 2020


abrachet marked 2 inline comments as done.
abrachet added inline comments.


================
Comment at: libc/src/stdlib/abort.cpp:19
+  __llvm_libc::raise(SIGABRT);
+  __llvm_libc::raise(SIGKILL);
+  __llvm_libc::_Exit(127);
----------------
MaskRay wrote:
> If there is a signal handler for SIGABRT, the code should try blocking the signal. Since signals are not available, this is fine.
I have added the above TODO. Maybe it is wrong as I think more about it though, maybe `sigprocmask` is a better choice to remove the signal handler.

I think there also needs to be some kind of lock once we start playing with signal handlers. WDYT?


================
Comment at: libc/src/stdlib/linux/_Exit.cpp:19
+  for (;;) {
+#ifdef SYS_exit_group
+    __llvm_libc::syscall(SYS_exit_group, status);
----------------
MaskRay wrote:
> Which arch does not define `SYS_exit_group`?
It is since 2.5.35. I guess that is old enough to remove the check, so I have removed it.


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

https://reviews.llvm.org/D74949





More information about the libc-commits mailing list