aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-03-26 01:46:38 +0100
committerAlejandro Colomar <alx@kernel.org>2024-03-26 02:07:02 +0100
commitcc20b5c061638abad254367628f9784d8de78f15 (patch)
tree580a123cffd4cec79f0d829c4075eb7a5d727d79
parent72f675cbf5b1a0f82114b2f303beb3d114e7a295 (diff)
downloadman-pages-cc20b5c061638abad254367628f9784d8de78f15.tar.gz
man*/: EXAMPLES: Add include guards
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man2/shmop.25
-rw-r--r--man3/shm_open.35
-rw-r--r--man7/unix.74
3 files changed, 14 insertions, 0 deletions
diff --git a/man2/shmop.2 b/man2/shmop.2
index cbbd821d82..4d31f7a706 100644
--- a/man2/shmop.2
+++ b/man2/shmop.2
@@ -319,6 +319,9 @@ The following header file is included by the "reader" and "writer" programs:
\&
Licensed under GNU General Public License v2 or later.
*/
+#ifndef SVSHM_STRING_H
+#define SVSHM_STRING_H
+\&
#include <stdio.h>
#include <stdlib.h>
#include <sys/sem.h>
@@ -336,6 +339,8 @@ union semun { /* Used in calls to semctl() */
};
\&
#define MEM_SIZE 4096
+\&
+#endif // include guard
.EE
.\" SRC END
.in
diff --git a/man3/shm_open.3 b/man3/shm_open.3
index 8ab2c30c2e..a907df906d 100644
--- a/man3/shm_open.3
+++ b/man3/shm_open.3
@@ -290,6 +290,9 @@ on the memory object that is shared between the two programs.
.in +4n
.\" SRC BEGIN (pshm_ucase.h)
.EX
+#ifndef PSHM_UCASE_H
+#define PSHM_UCASE_H
+\&
#include <semaphore.h>
#include <stddef.h>
#include <stdio.h>
@@ -309,6 +312,8 @@ struct shmbuf {
size_t cnt; /* Number of bytes used in \[aq]buf\[aq] */
char buf[BUF_SIZE]; /* Data being transferred */
};
+\&
+#endif // include guard
.EE
.\" SRC END
.in
diff --git a/man7/unix.7 b/man7/unix.7
index 869a3d543e..642b0b37e0 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -960,9 +960,13 @@ $
/*
* File connection.h
*/
+#ifndef CONNECTION_H
+#define CONNECTION_H
\&
#define SOCKET_NAME "/tmp/9Lq7BNBnBycd6nxy.socket"
#define BUFFER_SIZE 12
+\&
+#endif // include guard
.EE
.\" SRC END
.P