Detect accept4() on various platforms for versions

This commit is contained in:
Andy Pan 2024-03-27 13:59:56 +08:00
parent 0b34396924
commit 1a44867caa
1 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,8 @@
#ifndef __CONFIG_H
#define __CONFIG_H
#include <sys/param.h>
#ifdef __APPLE__
#include <fcntl.h> // for fcntl(fd, F_FULLFSYNC)
#include <AvailabilityMacros.h>
@ -75,7 +77,9 @@
#endif
/* Test for accept4() */
#if defined(__linux__) || defined(OpenBSD5_7) || \
#if defined(__linux__) || \
defined(OpenBSD5_7) || \
__DragonFly_version >= 400305 || \
(__FreeBSD__ >= 10 || __FreeBSD_version >= 1000000) || \
(defined(NetBSD8_0) || __NetBSD_Version__ >= 800000000)
#define HAVE_ACCEPT4 1