__noinference__{
#ifndef _SYS_TIME_H_
#define _SYS_TIME_H_
#ifndef _time_t_def_
#define _time_t_def_
typedef long time_t;
#endif
#ifndef _fd_mask_def_
#define _fd_mask_def_
typedef long fd_mask;
#endif
#ifndef __types_fd_set_def_
#define __types_fd_set_def_
typedef struct _types_fd_set{
  fd_mask fds_bits[(64U + (sizeof(fd_mask) * 8U - 1U)) / (sizeof(fd_mask) * 8U)];
} _types_fd_set;
#endif
#ifndef _suseconds_t_def_
#define _suseconds_t_def_
typedef long suseconds_t;
#endif
#ifndef _timeval_def_
#define _timeval_def_
struct timeval{
  time_t tv_sec;
  suseconds_t tv_usec;
};
#endif
#ifndef _timezone_def_
#define _timezone_def_
struct timezone{
  int tz_minuteswest;
  int tz_dsttime;
};
#endif
#ifndef _timezone_def_
#define _timezone_def_
extern long timezone__asm__("__timezone");
#endif
#ifndef _itimerval_def_
#define _itimerval_def_
struct itimerval{
  struct timeval it_interval;
  struct timeval it_value;
};
#endif
#ifndef ITIMER_VIRTUAL
#define ITIMER_VIRTUAL 1
#endif
#ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif
#ifndef ITIMER_PROF
#define ITIMER_PROF 2
#endif
#ifndef ITIMER_REAL
#define ITIMER_REAL 0
#endif
#ifndef fd_set
#define fd_set _types_fd_set
#endif

  /* FIX: Cygwin defines a struct _types_fd_set and then a typedef with the
     same name.  Our current scheme for omitting repeated declarations does
     not use separate namespaces for structs and typedefs, so the typedef
     is omitted by mistake.  This ugly hack fixes it in Cygwin for now. */
  /* JGM: had to comment this out for now
  #ifdef __types_fd_set_def_
  #ifndef __cygwin_fd_set_hack
  #define __cygwin_fd_set_hack
  typedef struct _types_fd_set _types_fd_set;
  #endif
  #endif
  */

  /* FIX: OpenBSD defines a struct fd_set and then a typedef
     with the same name.  Our current scheme for omitting repeated
     declarations does not use separate namespaces for structs and
     typedefs, so the typedef is omitted by mistake.  This ugly hack
     fixes it for now. */
  #ifndef __fd_set_hack
  #define __fd_set_hack
  #ifdef __OpenBSD__
  typedef struct fd_set fd_set;
  #endif
  #endif

  extern "C" int getitimer(int, struct itimerval @);

  /* The second arg here looks like it is a legacy feature.  The POSIX
     docs say that if it is non-NULL, then the behavior is undefined.
     Therefore, we have a stub that forces the argument to be NULL. */
  extern int gettimeofday(struct timeval @, struct timezone *);

  /* Stubs for these are defined by sys/select.h */
  extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
  extern void FD_CLR(int, fd_set @);
  extern int FD_ISSET(int, fd_set @);
  extern void FD_SET(int, fd_set @);
  extern void FD_ZERO(fd_set @);

  extern "C" int setitimer(int, const struct itimerval @, struct itimerval *);

  extern "C" int utimes(const char @, const struct timeval *{2}); // LEGACY
#endif
}
