[libc-commits] [libc] b12385f - [libc] [NFC] wait4Impl: include <signal.h> instead of <sys/signal.h>

Alfred Persson Forsberg via libc-commits libc-commits at lists.llvm.org
Sun Sep 3 16:51:33 PDT 2023


Author: Alfred Persson Forsberg
Date: 2023-09-04T01:51:08+02:00
New Revision: b12385f3aa56210b9dab0c56d2bf0f4a3d0c400d

URL: https://github.com/llvm/llvm-project/commit/b12385f3aa56210b9dab0c56d2bf0f4a3d0c400d
DIFF: https://github.com/llvm/llvm-project/commit/b12385f3aa56210b9dab0c56d2bf0f4a3d0c400d.diff

LOG: [libc] [NFC] wait4Impl: include <signal.h> instead of <sys/signal.h>

sys/signal.h currently does not exist in LLVM-libc. Both glibc and
musl provides this header with simply:

> #include <signal.h>
(and a warning in musl libc)

If you try to build LLVM-libc in a sysroot with only LLVM-libc headers
and linux-headers installed then this will fail the build due to
missing headers. However, if --sysroot is not passed, then the
LLVM-libc build will pick up the header from the system which in turn
includes LLVM-libc's signal.h.

LLVM-libc includes <signal.h> in all other cases, so this simply
matches that. Providing <sys/signal.h> could also be done (instead)
for glibc compatibility.

Added: 
    

Modified: 
    libc/src/sys/wait/wait4Impl.h

Removed: 
    


################################################################################
diff  --git a/libc/src/sys/wait/wait4Impl.h b/libc/src/sys/wait/wait4Impl.h
index 77bfd1cc29e64b..059b2cae430472 100644
--- a/libc/src/sys/wait/wait4Impl.h
+++ b/libc/src/sys/wait/wait4Impl.h
@@ -14,7 +14,7 @@
 #include "src/__support/error_or.h"
 #include "src/errno/libc_errno.h"
 
-#include <sys/signal.h>
+#include <signal.h>
 #include <sys/syscall.h> // For syscall numbers.
 #include <sys/wait.h>
 


        


More information about the libc-commits mailing list