summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-05-02 01:03:49 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-02 01:24:39 +0200
commit0320049eac3618e0c4ee3ffdc70062e19e0ba33f (patch)
tree6b057faaf150c83c188763bdadfcd603751ab037
parentd57601c87718fb90b222c423d8b875dfd3d13b36 (diff)
man/: EXAMPLES: Add missing includes
Link: <https://github.com/include-what-you-use/include-what-you-use/pull/1283> Link: <https://github.com/include-what-you-use/include-what-you-use/pull/1344> Reported-by: iwyu(1) (`make lint-c-iwyu`) Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2/chown.21
-rw-r--r--man/man2/clone.21
-rw-r--r--man/man2/close_range.21
-rw-r--r--man/man2/copy_file_range.21
-rw-r--r--man/man2/eventfd.21
-rw-r--r--man/man2/fork.21
-rw-r--r--man/man2/getdents.21
-rw-r--r--man/man2/kcmp.21
-rw-r--r--man/man2/memfd_create.21
-rw-r--r--man/man2/mmap.21
-rw-r--r--man/man2/open_by_handle_at.21
-rw-r--r--man/man2/perf_event_open.21
-rw-r--r--man/man2/pidfd_open.21
-rw-r--r--man/man2/pipe.21
-rw-r--r--man/man2/poll.21
-rw-r--r--man/man2/readlink.21
-rw-r--r--man/man2/select_tut.21
-rw-r--r--man/man2/signalfd.21
-rw-r--r--man/man2/syscall.21
-rw-r--r--man/man2/tee.21
-rw-r--r--man/man2/timerfd_create.21
-rw-r--r--man/man2/wait.21
-rw-r--r--man/man3/pthread_create.31
-rw-r--r--man/man7/unix.72
24 files changed, 25 insertions, 0 deletions
diff --git a/man/man2/chown.2 b/man/man2/chown.2
index ffba3acaf..e7e55c9b6 100644
--- a/man/man2/chown.2
+++ b/man/man2/chown.2
@@ -427,6 +427,7 @@ to perform a lookup in the system password file).
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/clone.2 b/man/man2/clone.2
index e88c54eeb..5a4add238 100644
--- a/man/man2/clone.2
+++ b/man/man2/clone.2
@@ -1850,6 +1850,7 @@ so we should include it for portability.
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <unistd.h>
diff --git a/man/man2/close_range.2 b/man/man2/close_range.2
index c5252d660..9806638bd 100644
--- a/man/man2/close_range.2
+++ b/man/man2/close_range.2
@@ -209,6 +209,7 @@ result from the calls to
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <unistd.h>
\&
/* Show the contents of the symbolic links in /proc/self/fd */
diff --git a/man/man2/copy_file_range.2 b/man/man2/copy_file_range.2
index 913d94345..50ecef77c 100644
--- a/man/man2/copy_file_range.2
+++ b/man/man2/copy_file_range.2
@@ -252,6 +252,7 @@ the call failed to copy, while still reporting success.
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/eventfd.2 b/man/man2/eventfd.2
index 3b67239ac..48e9e2ac6 100644
--- a/man/man2/eventfd.2
+++ b/man/man2/eventfd.2
@@ -385,6 +385,7 @@ Parent read 28 (0x1c) from efd
#include <stdio.h>
#include <stdlib.h>
#include <sys/eventfd.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/fork.2 b/man/man2/fork.2
index b5a7816a0..bf491857f 100644
--- a/man/man2/fork.2
+++ b/man/man2/fork.2
@@ -307,6 +307,7 @@ for more examples.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/getdents.2 b/man/man2/getdents.2
index 1e630f9e2..421318e5e 100644
--- a/man/man2/getdents.2
+++ b/man/man2/getdents.2
@@ -262,6 +262,7 @@ inode# file type d_reclen d_off d_name
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
struct linux_dirent {
diff --git a/man/man2/kcmp.2 b/man/man2/kcmp.2
index 0ea604eac..33d4a25e1 100644
--- a/man/man2/kcmp.2
+++ b/man/man2/kcmp.2
@@ -347,6 +347,7 @@ Child duplicated FD 3 to create FD 5
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
\&
diff --git a/man/man2/memfd_create.2 b/man/man2/memfd_create.2
index 794aa0e54..55cb59ef0 100644
--- a/man/man2/memfd_create.2
+++ b/man/man2/memfd_create.2
@@ -417,6 +417,7 @@ Existing seals: WRITE SHRINK
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/mmap.2 b/man/man2/mmap.2
index 63df5a98a..f4cecbefb 100644
--- a/man/man2/mmap.2
+++ b/man/man2/mmap.2
@@ -940,6 +940,7 @@ to output the desired bytes.
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
\&
#define handle_error(msg) \e
diff --git a/man/man2/open_by_handle_at.2 b/man/man2/open_by_handle_at.2
index a4050d664..8fa1bf630 100644
--- a/man/man2/open_by_handle_at.2
+++ b/man/man2/open_by_handle_at.2
@@ -641,6 +641,7 @@ main(int argc, char *argv[])
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <unistd.h>
\&
/* Scan /proc/self/mountinfo to find the line whose mount ID matches
diff --git a/man/man2/perf_event_open.2 b/man/man2/perf_event_open.2
index 5f68f5204..37272edc3 100644
--- a/man/man2/perf_event_open.2
+++ b/man/man2/perf_event_open.2
@@ -3976,6 +3976,7 @@ instruction count of a call to
#include <string.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
static long
diff --git a/man/man2/pidfd_open.2 b/man/man2/pidfd_open.2
index 02c741f2b..4f2b4c6d8 100644
--- a/man/man2/pidfd_open.2
+++ b/man/man2/pidfd_open.2
@@ -214,6 +214,7 @@ event.
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
static int
diff --git a/man/man2/pipe.2 b/man/man2/pipe.2
index a440ad401..b354775ce 100644
--- a/man/man2/pipe.2
+++ b/man/man2/pipe.2
@@ -246,6 +246,7 @@ and echoes it on standard output.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
\&
diff --git a/man/man2/poll.2 b/man/man2/poll.2
index f1a5a9795..4472baf3e 100644
--- a/man/man2/poll.2
+++ b/man/man2/poll.2
@@ -563,6 +563,7 @@ at which point the file descriptor was closed and the program terminated.
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <unistd.h>
\&
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
diff --git a/man/man2/readlink.2 b/man/man2/readlink.2
index da671a9be..9c616f6ed 100644
--- a/man/man2/readlink.2
+++ b/man/man2/readlink.2
@@ -260,6 +260,7 @@ reports a size of zero.
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/select_tut.2 b/man/man2/select_tut.2
index 59c241973..4ef523ead 100644
--- a/man/man2/select_tut.2
+++ b/man/man2/select_tut.2
@@ -344,6 +344,7 @@ from one TCP port to another.
#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <unistd.h>
\&
static int forward_port;
diff --git a/man/man2/signalfd.2 b/man/man2/signalfd.2
index 831fa944c..cf0e6df28 100644
--- a/man/man2/signalfd.2
+++ b/man/man2/signalfd.2
@@ -469,6 +469,7 @@ $
#include <stdio.h>
#include <stdlib.h>
#include <sys/signalfd.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/syscall.2 b/man/man2/syscall.2
index 82f02ebe1..cd69f6b63 100644
--- a/man/man2/syscall.2
+++ b/man/man2/syscall.2
@@ -347,6 +347,7 @@ architectures may indiscriminately clobber other registers not listed here.
#define _GNU_SOURCE
#include <signal.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/tee.2 b/man/man2/tee.2
index 8ed9a67a8..18f6b39a0 100644
--- a/man/man2/tee.2
+++ b/man/man2/tee.2
@@ -140,6 +140,7 @@ Tue Oct 28 10:06:00 CET 2014
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <unistd.h>
\&
int
diff --git a/man/man2/timerfd_create.2 b/man/man2/timerfd_create.2
index 23c399c7d..8d3fd0da4 100644
--- a/man/man2/timerfd_create.2
+++ b/man/man2/timerfd_create.2
@@ -604,6 +604,7 @@ a.out 3 1 100
#include <stdio.h>
#include <stdlib.h>
#include <sys/timerfd.h>
+#include <sys/types.h>
#include <time.h>
#include <unistd.h>
\&
diff --git a/man/man2/wait.2 b/man/man2/wait.2
index 2e0e9c254..ff68f2ddb 100644
--- a/man/man2/wait.2
+++ b/man/man2/wait.2
@@ -661,6 +661,7 @@ $
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
\&
diff --git a/man/man3/pthread_create.3 b/man/man3/pthread_create.3
index fd6253bf4..793939b7f 100644
--- a/man/man3/pthread_create.3
+++ b/man/man3/pthread_create.3
@@ -257,6 +257,7 @@ Joined with thread 3; returned value was SERVUS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <unistd.h>
\&
#define handle_error_en(en, msg) \e
diff --git a/man/man7/unix.7 b/man/man7/unix.7
index 642b0b37e..433ac02f4 100644
--- a/man/man7/unix.7
+++ b/man/man7/unix.7
@@ -980,6 +980,7 @@ $
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
\&
@@ -1125,6 +1126,7 @@ main(void)
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
\&