Coverage Report

Created: 2026-06-02 06:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/php-src/Zend/zend_mmap.h
Line
Count
Source
1
/*
2
   +----------------------------------------------------------------------+
3
   | Zend Engine                                                          |
4
   +----------------------------------------------------------------------+
5
   | Copyright © Zend Technologies Ltd., a subsidiary company of          |
6
   |     Perforce Software, Inc., and Contributors.                       |
7
   +----------------------------------------------------------------------+
8
   | This source file is subject to the Modified BSD License that is      |
9
   | bundled with this package in the file LICENSE, and is available      |
10
   | through the World Wide Web at <https://www.php.net/license/>.        |
11
   |                                                                      |
12
   | SPDX-License-Identifier: BSD-3-Clause                                |
13
   +----------------------------------------------------------------------+
14
   | Authors: Max Kellermann <max.kellermann@ionos.com>                   |
15
   +----------------------------------------------------------------------+
16
*/
17
18
#ifndef ZEND_MMAP_H
19
#define ZEND_MMAP_H
20
21
#include "zend_portability.h"
22
23
#ifdef HAVE_PRCTL
24
# include <sys/prctl.h>
25
26
/* fallback definitions if our libc is older than the kernel */
27
# ifndef PR_SET_VMA
28
453
#  define PR_SET_VMA 0x53564d41
29
# endif
30
# ifndef PR_SET_VMA_ANON_NAME
31
453
#  define PR_SET_VMA_ANON_NAME 0
32
# endif
33
#endif // HAVE_PRCTL
34
35
/**
36
 * Set a name for the specified memory area.
37
 *
38
 * This feature requires Linux 5.17.
39
 */
40
static zend_always_inline void zend_mmap_set_name(const void *start, size_t len, const char *name)
41
453
{
42
453
#ifdef HAVE_PRCTL
43
453
  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)start, len, (unsigned long)name);
44
453
#endif
45
453
}
Unexecuted instantiation: ZendAccelerator.c:zend_mmap_set_name
Unexecuted instantiation: zend_alloc.c:zend_mmap_set_name
zend_fibers.c:zend_mmap_set_name
Line
Count
Source
41
453
{
42
453
#ifdef HAVE_PRCTL
43
453
  prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)start, len, (unsigned long)name);
44
453
#endif
45
453
}
46
47
#endif /* ZEND_MMAP_H */