aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-03-26 01:35:11 +0100
committerAlejandro Colomar <alx@kernel.org>2024-03-26 02:07:02 +0100
commit72f675cbf5b1a0f82114b2f303beb3d114e7a295 (patch)
treea6227e628df859236426d91e04c968f532849f86
parent0b999a861eac677140d14421a04d209b41bc74cd (diff)
downloadman-pages-72f675cbf5b1a0f82114b2f303beb3d114e7a295.tar.gz
man*/: EXAMPLES: Fix includes
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man2/shmop.26
-rw-r--r--man3/shm_open.316
2 files changed, 13 insertions, 9 deletions
diff --git a/man2/shmop.2 b/man2/shmop.2
index f675955522..cbbd821d82 100644
--- a/man2/shmop.2
+++ b/man2/shmop.2
@@ -319,13 +319,9 @@ The following header file is included by the "reader" and "writer" programs:
\&
Licensed under GNU General Public License v2 or later.
*/
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <sys/sem.h>
\&
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
diff --git a/man3/shm_open.3 b/man3/shm_open.3
index 03e96dc11c..8ab2c30c2e 100644
--- a/man3/shm_open.3
+++ b/man3/shm_open.3
@@ -290,13 +290,10 @@ on the memory object that is shared between the two programs.
.in +4n
.\" SRC BEGIN (pshm_ucase.h)
.EX
-#include <fcntl.h>
#include <semaphore.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
\&
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e
} while (0)
@@ -338,6 +335,11 @@ to tell the "send" program that it may now access the shared memory.
Licensed under GNU General Public License v2 or later.
*/
#include <ctype.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <unistd.h>
\&
#include "pshm_ucase.h"
\&
@@ -430,7 +432,13 @@ on standard output.
\&
Licensed under GNU General Public License v2 or later.
*/
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
\&
#include "pshm_ucase.h"
\&