/* Force-included into every C and C++ translation unit by the custom
 * toolchain. glibc 2.44 removed several transitive includes that
 * MongoDB 8.3.11 relies on; this file restores them. Nothing here
 * declares new code, and every header is libc-namespaced. */

#ifndef AM_OS_PREINCLUDE_H
#define AM_OS_PREINCLUDE_H
/* Command-line -U_GNU_SOURCE (set by
 * src/third_party/libmongocrypt/BUILD.bazel) strips the
 * -D_GNU_SOURCE our toolchain provides. Command-line -U wins over
 * -D regardless of order of appearance vs -include, so we must
 * re-establish _GNU_SOURCE inside this file before any system
 * header, or <features.h> caches without __USE_GNU and the
 * GNU-gated dl* declarations vanish. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif

#include <dlfcn.h>

/* Must come first: glibc gates Dl_info, dlinfo, and RTLD_DI_LINKMAP
 * behind __USE_GNU in <dlfcn.h>. If any header below sets a POSIX
 * feature-test macro, glibc caches <features.h> without __USE_GNU and
 * the GNU-gated declarations disappear for the rest of the unit. */
#include <dlfcn.h>

#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/resource.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/un.h>

#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <time.h>
#include <pwd.h>
#include <grp.h>
#include <poll.h>
#include <dirent.h>
#include <langinfo.h>



#endif