Commit 815c2f09 authored by Thomas Munro's avatar Thomas Munro

Add kqueue(2) support to the WaitEventSet API.

Use kevent(2) to wait for events on the BSD family of operating
systems and macOS.  This is similar to the epoll(2) support added
for Linux by commit 98a64d0b.

Author: Thomas Munro
Reviewed-by: Andres Freund, Marko Tiikkaja, Tom Lane
Tested-by: Mateusz Guzik, Matteo Beccati, Keith Fiske, Heikki Linnakangas, Michael Paquier, Peter Eisentraut, Rui DeSousa, Tom Lane, Mark Wong
Discussion: https://postgr.es/m/CAEepm%3D37oF84-iXDTQ9MrGjENwVGds%2B5zTr38ca73kWR7ez_tA%40mail.gmail.com
parent d9fe702a
...@@ -12760,7 +12760,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h ...@@ -12760,7 +12760,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi fi
for ac_header in atomic.h copyfile.h execinfo.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h for ac_header in atomic.h copyfile.h execinfo.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
do : do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
...@@ -14996,7 +14996,7 @@ fi ...@@ -14996,7 +14996,7 @@ fi
LIBS_including_readline="$LIBS" LIBS_including_readline="$LIBS"
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'` LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
for ac_func in backtrace_symbols cbrt clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memset_s memmove poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale utime utimes wcstombs_l for ac_func in backtrace_symbols cbrt clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit kqueue mbstowcs_l memset_s memmove poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale utime utimes wcstombs_l
do : do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
......
...@@ -1288,6 +1288,7 @@ AC_CHECK_HEADERS(m4_normalize([ ...@@ -1288,6 +1288,7 @@ AC_CHECK_HEADERS(m4_normalize([
mbarrier.h mbarrier.h
poll.h poll.h
sys/epoll.h sys/epoll.h
sys/event.h
sys/ipc.h sys/ipc.h
sys/prctl.h sys/prctl.h
sys/procctl.h sys/procctl.h
...@@ -1628,6 +1629,7 @@ AC_CHECK_FUNCS(m4_normalize([ ...@@ -1628,6 +1629,7 @@ AC_CHECK_FUNCS(m4_normalize([
getifaddrs getifaddrs
getpeerucred getpeerucred
getrlimit getrlimit
kqueue
mbstowcs_l mbstowcs_l
memset_s memset_s
memmove memmove
......
This diff is collapsed.
...@@ -331,6 +331,9 @@ ...@@ -331,6 +331,9 @@
/* Define to 1 if __builtin_constant_p(x) implies "i"(x) acceptance. */ /* Define to 1 if __builtin_constant_p(x) implies "i"(x) acceptance. */
#undef HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P #undef HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P
/* Define to 1 if you have the `kqueue' function. */
#undef HAVE_KQUEUE
/* Define to 1 if you have the <langinfo.h> header file. */ /* Define to 1 if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H #undef HAVE_LANGINFO_H
...@@ -614,6 +617,9 @@ ...@@ -614,6 +617,9 @@
/* Define to 1 if you have the <sys/epoll.h> header file. */ /* Define to 1 if you have the <sys/epoll.h> header file. */
#undef HAVE_SYS_EPOLL_H #undef HAVE_SYS_EPOLL_H
/* Define to 1 if you have the <sys/event.h> header file. */
#undef HAVE_SYS_EVENT_H
/* Define to 1 if you have the <sys/ipc.h> header file. */ /* Define to 1 if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H #undef HAVE_SYS_IPC_H
......
...@@ -281,6 +281,7 @@ sub GenerateFiles ...@@ -281,6 +281,7 @@ sub GenerateFiles
HAVE_IPV6 => 1, HAVE_IPV6 => 1,
HAVE_ISINF => 1, HAVE_ISINF => 1,
HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P => undef, HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P => undef,
HAVE_KQUEUE => undef,
HAVE_LANGINFO_H => undef, HAVE_LANGINFO_H => undef,
HAVE_LDAP_H => undef, HAVE_LDAP_H => undef,
HAVE_LDAP_INITIALIZE => undef, HAVE_LDAP_INITIALIZE => undef,
...@@ -374,6 +375,7 @@ sub GenerateFiles ...@@ -374,6 +375,7 @@ sub GenerateFiles
HAVE_SYMLINK => 1, HAVE_SYMLINK => 1,
HAVE_SYSLOG => undef, HAVE_SYSLOG => undef,
HAVE_SYS_EPOLL_H => undef, HAVE_SYS_EPOLL_H => undef,
HAVE_SYS_EVENT_H => undef,
HAVE_SYS_IPC_H => undef, HAVE_SYS_IPC_H => undef,
HAVE_SYS_PRCTL_H => undef, HAVE_SYS_PRCTL_H => undef,
HAVE_SYS_PROCCTL_H => undef, HAVE_SYS_PROCCTL_H => undef,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment