]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/shm.h
Name shared memory segments in a more portable way
[thirdparty/squid.git] / compat / shm.h
1 /*
2 * $Id$
3 */
4 #ifndef SQUID_COMPAT_SHM_H
5 #define SQUID_COMPAT_SHM_H
6
7 #if HAVE_SHM
8
9 #if HAVE_SYS_STAT_H
10 #include <sys/stat.h> /* for mode constants */
11 #endif
12
13 #if HAVE_FCNTL_H
14 #include <fcntl.h> /* for O_* constants */
15 #endif
16
17 #if HAVE_SYS_MMAN_H
18 #include <sys/mman.h>
19 #endif
20
21 #else /* HAVE_SHM */
22
23 #if HAVE_ERRNO_H
24 #include <errno.h>
25 #endif
26
27 extern "C" {
28
29 inline int
30 shm_open(const char *, int, mode_t) {
31 errno = ENOTSUP;
32 return -1;
33 }
34
35 inline int
36 shm_unlink(const char *) {
37 errno = ENOTSUP;
38 return -1;
39 }
40
41 } /* extern "C" */
42
43 #endif /* HAVE_SHM */
44
45
46 /// Determines whether segment names are iterpreted as full file paths.
47 bool shm_portable_segment_name_is_path();
48
49 #endif /* SQUID_COMPAT_CPU_H */