Skip to content

Fix build of zend_shared_alloc.c when HAVE_MPROTECT is not defined #16570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: PHP-8.3
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions ext/opcache/zend_shared_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
+----------------------------------------------------------------------+
*/

#if defined(__linux__) && defined(HAVE_MEMFD_CREATE)
# ifndef _GNU_SOURCE
# define _GNU_SOURCE
# endif
# include <sys/mman.h>
#endif

#include <errno.h>
#include "ZendAccelerator.h"
#include "zend_shared_alloc.h"
Expand All @@ -40,7 +33,7 @@
# include <stdio.h>
#endif

#ifdef HAVE_MPROTECT
#if defined(HAVE_MPROTECT) || defined(HAVE_MEMFD_CREATE)
Copy link
Member

@devnexen devnexen Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was because we did not want to enable memfd_create for FreeBSD.
One possible approach would be to do something like here at configure time.

# include "sys/mman.h"
#endif

Expand Down