/src/php-src/Zend/zend_mmap.h
Line | Count | Source |
1 | | /* |
2 | | +----------------------------------------------------------------------+ |
3 | | | This source file is subject to version 2.00 of the Zend license, | |
4 | | | that is bundled with this package in the file LICENSE, and is | |
5 | | | available through the world-wide-web at the following url: | |
6 | | | http://www.zend.com/license/2_00.txt. | |
7 | | | If you did not receive a copy of the Zend license and are unable to | |
8 | | | obtain it through the world-wide-web, please send a note to | |
9 | | | license@zend.com so we can mail you a copy immediately. | |
10 | | +----------------------------------------------------------------------+ |
11 | | | Authors: Max Kellermann <max.kellermann@ionos.com> | |
12 | | +----------------------------------------------------------------------+ |
13 | | */ |
14 | | |
15 | | #ifndef ZEND_MMAP_H |
16 | | #define ZEND_MMAP_H |
17 | | |
18 | | #include "zend_portability.h" |
19 | | |
20 | | #ifdef HAVE_PRCTL |
21 | | # include <sys/prctl.h> |
22 | | |
23 | | /* fallback definitions if our libc is older than the kernel */ |
24 | | # ifndef PR_SET_VMA |
25 | 723 | # define PR_SET_VMA 0x53564d41 |
26 | | # endif |
27 | | # ifndef PR_SET_VMA_ANON_NAME |
28 | 723 | # define PR_SET_VMA_ANON_NAME 0 |
29 | | # endif |
30 | | #endif // HAVE_PRCTL |
31 | | |
32 | | /** |
33 | | * Set a name for the specified memory area. |
34 | | * |
35 | | * This feature requires Linux 5.17. |
36 | | */ |
37 | | static zend_always_inline void zend_mmap_set_name(const void *start, size_t len, const char *name) |
38 | 723 | { |
39 | 723 | #ifdef HAVE_PRCTL |
40 | 723 | prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)start, len, (unsigned long)name); |
41 | 723 | #endif |
42 | 723 | } Unexecuted instantiation: zend_alloc.c:zend_mmap_set_name zend_fibers.c:zend_mmap_set_name Line | Count | Source | 38 | 723 | { | 39 | 723 | #ifdef HAVE_PRCTL | 40 | 723 | prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)start, len, (unsigned long)name); | 41 | 723 | #endif | 42 | 723 | } |
|
43 | | |
44 | | #endif /* ZEND_MMAP_H */ |