#define _GNU_SOURCE /* activate extra prototypes for glibc */
#include <sys/types.h>
-#include <stdio.h>
+#include <sys/socket.h> /* For CMSG_* */
#ifdef HAVE_LIMITS_H
# include <limits.h> /* For PATH_MAX */
#endif
-#ifdef HAVE_GETOPT_H
-# include <getopt.h>
-#endif
#ifdef HAVE_BSTRING_H
# include <bstring.h>
#endif
#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
- defined(GLOB_HAS_GL_MATCHC)
+ defined(GLOB_HAS_GL_MATCHC) && \
+ defined(HAVE_DECL_GLOB_NOMATCH) && HAVE_DECL_GLOB_NOMATCH != 0 && \
+ !defined(BROKEN_GLOB)
# include <glob.h>
#endif
#ifdef HAVE_ENDIAN_H
#ifdef HAVE_NEXT
# include <libc.h>
#endif
-#ifdef HAVE_PATHS
+#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
#include <sys/ptms.h> /* for grantpt() and friends */
#endif
+#include <netinet/in.h>
#include <netinet/in_systm.h> /* For typedefs */
#ifdef HAVE_RPC_TYPES_H
# include <rpc/types.h> /* For INADDR_LOOPBACK */
# include <sys/syslog.h>
#endif
+#include <errno.h>
+
/*
* On HP-UX 11.11, shadow.h and prot.h provide conflicting declarations
* of getspnam when _INCLUDE__STDC__ is defined, so we unset it here.
#include "defines.h"
+#include "platform.h"
#include "openbsd-compat/openbsd-compat.h"
#include "openbsd-compat/bsd-nextstep.h"