]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/shm.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / compat / shm.h
1 /*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_COMPAT_SHM_H
10 #define SQUID_COMPAT_SHM_H
11
12 #if HAVE_SHM
13
14 #if HAVE_SYS_STAT_H
15 #include <sys/stat.h> /* for mode constants */
16 #endif
17
18 #if HAVE_FCNTL_H
19 #include <fcntl.h> /* for O_* constants */
20 #endif
21
22 #if HAVE_SYS_MMAN_H
23 #include <sys/mman.h>
24 #endif
25
26 #else /* HAVE_SHM */
27
28 #if HAVE_ERRNO_H
29 #include <errno.h>
30 #endif
31
32 extern "C" {
33
34 inline int
35 shm_open(const char *, int, mode_t) {
36 errno = ENOTSUP;
37 return -1;
38 }
39
40 inline int
41 shm_unlink(const char *) {
42 errno = ENOTSUP;
43 return -1;
44 }
45
46 } /* extern "C" */
47
48 #endif /* HAVE_SHM */
49
50 /// Determines whether segment names are iterpreted as full file paths.
51 bool shm_portable_segment_name_is_path();
52
53 #endif /* SQUID_COMPAT_CPU_H */
54