[PATCH 08/13] manual: fix missing include in sigh1 example.

Collin Funk collin.funk1@gmail.com
Sun Sep 28 22:46:01 GMT 2025


Previously this file would fail to compile with the following error:

    $ gcc manual/examples/sigh1.c
    manual/examples/sigh1.c: In function ‘main’:
    manual/examples/sigh1.c:46:3: error: implicit declaration of function ‘alarm’ [-Wimplicit-function-declaration]
       46 |   alarm (2);
          |   ^~~~~
---
 manual/examples/sigh1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/manual/examples/sigh1.c b/manual/examples/sigh1.c
index a540651058..b770158c2b 100644
--- a/manual/examples/sigh1.c
+++ b/manual/examples/sigh1.c
@@ -18,6 +18,7 @@
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 /* This flag controls termination of the main loop. */
 volatile sig_atomic_t keep_going = 1;
-- 
2.51.0



More information about the Libc-alpha mailing list