From 6a38159c38e06a9ceae166cc223c08d9f4241018 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Wed, 17 Jan 2024 16:02:16 +0200 Subject: [PATCH] Add HAVE_POSIX_SHM and HAVE_POSIX_SEM --- .../autoconf/checks/HAVE_POSIX_SEM.h | 24 ++++++++++++++++++ .../autoconf/checks/HAVE_POSIX_SHM.h | 25 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SEM.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SHM.h diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SEM.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SEM.h new file mode 100644 index 0000000..37e44e7 --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SEM.h @@ -0,0 +1,24 @@ +// HAVE_POSIX_SEM : BUILD2_AUTOCONF_LIBC_VERSION + +/* If HAVE_POSIX_SEM is defined then all of the POSIX semaphore system calls + * such as sem_open(), sem_close(), sem_unlink(), etc. are available. + */ + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif + +#undef HAVE_POSIX_SEM + +/* Since glibc 2.3.3 (when NPTL was added), FreeBSD 3.0, OpenBSD 3.1 (based on + * checking the online manpages by version), and NetBSD 2.0. + * + * Available on all versions of macOS. + */ +#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 4) || \ + BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 0) || \ + BUILD2_AUTOCONF_OPENBSD_PREREQ(200206) || \ + BUILD2_AUTOCONF_NETBSD_PREREQ(2, 0) || \ + defined(BUILD2_AUTOCONF_MACOS) +# define HAVE_POSIX_SEM 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SHM.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SHM.h new file mode 100644 index 0000000..76a151a --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POSIX_SHM.h @@ -0,0 +1,25 @@ +// HAVE_POSIX_SHM : BUILD2_AUTOCONF_LIBC_VERSION + +/* If HAVE_POSIX_SHM is defined then both shm_open() and shm_unlink() are + * available. + */ + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif + +#undef HAVE_POSIX_SHM + +/* Since glibc 2.2, FreeBSD 4.3, and NetBSD 7.0. + * + * Available on all versions of macOS. + * + * Not available on OpenBSD (security concerns). + * + */ +#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 2) || \ + BUILD2_AUTOCONF_FREEBSD_PREREQ(4, 3) || \ + BUILD2_AUTOCONF_NETBSD_PREREQ(7, 0) || \ + defined(BUILD2_AUTOCONF_MACOS) +# define HAVE_POSIX_SHM 1 +#endif