Project

General

Profile

Feature #3128 » 0001-server.core-files-support-on-FreeBSD-proposal.patch

devnexen, 2022-01-01 20:56

View differences:

configure.ac
sys/mman.h \
sys/poll.h \
sys/prctl.h \
sys/procctl.h \
sys/resource.h \
sys/select.h \
sys/sendfile.h \
src/CMakeLists.txt
check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H)
check_include_files(sys/poll.h HAVE_SYS_POLL_H)
check_include_files(sys/prctl.h HAVE_SYS_PRCTL_H)
check_include_files(sys/procctl.h HAVE_SYS_PROCCTL_H)
check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_files(sys/sendfile.h HAVE_SYS_SENDFILE_H)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
......
check_function_exists(poll HAVE_POLL)
check_function_exists(port_create HAVE_PORT_CREATE)
check_function_exists(prctl HAVE_PRCTL)
check_function_exists(procctl HAVE_PROCCTL)
check_function_exists(pread HAVE_PREAD)
check_function_exists(preadv HAVE_PREADV)
check_function_exists(pwrite HAVE_PWRITE)
src/config.h.cmake
#cmakedefine HAVE_SYS_MMAN_H
#cmakedefine HAVE_SYS_POLL_H
#cmakedefine HAVE_SYS_PRCTL_H
#cmakedefine HAVE_SYS_PROCCTL_H
#cmakedefine HAVE_SYS_RESOURCE_H
#cmakedefine HAVE_SYS_SENDFILE_H
#cmakedefine HAVE_SYS_SELECT_H
......
#cmakedefine HAVE_POLL
#cmakedefine HAVE_PORT_CREATE
#cmakedefine HAVE_PRCTL
#cmakedefine HAVE_PROCCTL
#cmakedefine HAVE_PREAD
#cmakedefine HAVE_PREADV
#cmakedefine HAVE_PWRITE
src/meson.build
conf_data.set('HAVE_SYS_MMAN_H', compiler.has_header('sys/mman.h'))
conf_data.set('HAVE_SYS_POLL_H', compiler.has_header('sys/poll.h'))
conf_data.set('HAVE_SYS_PRCTL_H', compiler.has_header('sys/prctl.h'))
conf_data.set('HAVE_SYS_PROCCTL_H', compiler.has_header('sys/procctl.h'))
conf_data.set('HAVE_SYS_RESOURCE_H', compiler.has_header('sys/resource.h'))
conf_data.set('HAVE_SYS_SENDFILE_H', compiler.has_header('sys/sendfile.h'))
conf_data.set('HAVE_SYS_SELECT_H', compiler.has_header('sys/select.h'))
......
conf_data.set('HAVE_PORT_CREATE', compiler.has_function('port_create', args: defs))
conf_data.set('HAVE_POSIX_FADVISE', compiler.has_function('posix_fadvise', args: defs))
conf_data.set('HAVE_PRCTL', compiler.has_function('prctl', args: defs))
conf_data.set('HAVE_PROCCTL', compiler.has_function('procctl', args: defs))
conf_data.set('HAVE_PREAD', compiler.has_function('pread', args: defs))
conf_data.set('HAVE_PREADV', compiler.has_function('preadv', args: defs))
conf_data.set('HAVE_PWRITE', compiler.has_function('pwrite', args: defs))
src/mod_webdav.c
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
/* due to C99, FreeBSD hides copy_file_range */
#ifdef __FreeBSD__
#ifndef __BSD_VISIBLE
#define __BSD_VISIBLE 1
#endif
#endif
#include "first.h" /* first */
#include "sys-mmap.h"
src/server.c
# include <sys/prctl.h>
#endif
#ifdef HAVE_SYS_PROCCTL_H
# include <sys/procctl.h>
#endif
#ifdef HAVE_MALLOC_H
#ifndef LIGHTTPD_STATIC
#ifdef HAVE_DLFCN_H
......
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
}
#endif
#if defined(HAVE_SYS_PROCCTL_H) && defined(PROC_TRACE_CTL_ENABLE)
/**
* DragonFlyBSD also have procctl but a more limited subset only
*/
if (srv->srvconf.enable_cores) {
int dumpable = PROC_TRACE_CTL_ENABLE;
procctl(P_PID, 0, PROC_TRACE_CTL, &dumpable);
}
#endif
}
#ifdef HAVE_FORK
(3-3/3)