__noinference__{
#ifndef _UNISTD_H_
#define _UNISTD_H_
#ifndef __off64_t_def_
#define __off64_t_def_
typedef long long _off64_t;
#endif
#ifndef __ssize_t_def_
#define __ssize_t_def_
typedef int _ssize_t;
#endif
#ifndef _size_t_def_
#define _size_t_def_
typedef unsigned int size_t;
#endif
#ifndef _pid_t_def_
#define _pid_t_def_
typedef int pid_t;
#endif
#ifndef _ssize_t_def_
#define _ssize_t_def_
typedef _ssize_t ssize_t;
#endif
#ifndef _useconds_t_def_
#define _useconds_t_def_
typedef unsigned long useconds_t;
#endif
#ifndef _off_t_def_
#define _off_t_def_
typedef _off64_t off_t;
#endif
#ifndef ___uid32_t_def_
#define ___uid32_t_def_
typedef unsigned long __uid32_t;
#endif
#ifndef _uid_t_def_
#define _uid_t_def_
typedef __uid32_t uid_t;
#endif
#ifndef ___gid32_t_def_
#define ___gid32_t_def_
typedef unsigned long __gid32_t;
#endif
#ifndef _gid_t_def_
#define _gid_t_def_
typedef __gid32_t gid_t;
#endif
#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
#define _POSIX_THREAD_PRIORITY_SCHEDULING 1
#endif
#ifndef _PC_ASYNC_IO
#define _PC_ASYNC_IO 9
#endif
#ifndef _PC_PRIO_IO
#define _PC_PRIO_IO 10
#endif
#ifndef _PC_MAX_INPUT
#define _PC_MAX_INPUT 2
#endif
#ifndef F_OK
#define F_OK 0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif
#ifndef _PC_CHOWN_RESTRICTED
#define _PC_CHOWN_RESTRICTED 6
#endif
#ifndef _POSIX_TIMERS
#define _POSIX_TIMERS 1
#endif
#ifndef _PC_VDISABLE
#define _PC_VDISABLE 8
#endif
#ifndef _PC_LINK_MAX
#define _PC_LINK_MAX 0
#endif
#ifndef _POSIX_JOB_CONTROL
#define _POSIX_JOB_CONTROL 1
#endif
#ifndef _POSIX_THREAD_ATTR_STACKSIZE
#define _POSIX_THREAD_ATTR_STACKSIZE 1
#endif
#ifndef _PC_NAME_MAX
#define _PC_NAME_MAX 3
#endif
#ifndef _PC_MAX_CANON
#define _PC_MAX_CANON 1
#endif
#ifndef _PC_NO_TRUNC
#define _PC_NO_TRUNC 7
#endif
#ifndef _POSIX_VERSION
#define _POSIX_VERSION 199009L
#endif
#ifndef _POSIX_THREAD_PROCESS_SHARED
#define _POSIX_THREAD_PROCESS_SHARED 1
#endif
#ifndef _PC_PATH_MAX
#define _PC_PATH_MAX 4
#endif
#ifndef _POSIX_THREADS
#define _POSIX_THREADS 1
#endif
#ifndef _PC_PIPE_BUF
#define _PC_PIPE_BUF 5
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifndef W_OK
#define W_OK 2
#endif
#ifndef _PC_SYNC_IO
#define _PC_SYNC_IO 11
#endif
#ifndef _POSIX_MEMLOCK_RANGE
#define _POSIX_MEMLOCK_RANGE 1
#endif
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
#ifndef _POSIX_SEMAPHORES
#define _POSIX_SEMAPHORES 1
#endif
#ifndef SEEK_END
#define SEEK_END 2
#endif
#ifndef R_OK
#define R_OK 4
#endif
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 1
#endif
#ifndef _POSIX_SAVED_IDS
#define _POSIX_SAVED_IDS 0
#endif
#ifndef X_OK
#define X_OK 1
#endif

  // EXTREMELY irritating: under Linux, useconds_t is not defined
  // in sys/wait.h, CONTRARY to the posix spec.  Instead __useconds_t
  // is defined.  So we include __useconds_t above and do the following:
  #if defined(___useconds_t_def_) && !defined(_useconds_t_def_)
  #define _useconds_t_def_
  typedef __useconds_t useconds_t;
  #endif

  /* Cygwin does not define this type so we take a guess :-( */
  /* FIX: make this specific to cygwin ?? */
  #ifndef _useconds_t_def_
  #define _useconds_t_def_
  typedef unsigned int useconds_t;
  #endif

  // We'd like to do
  // include {
  // _SC_2_C_BIND
  // _SC_2_C_DEV
  // _SC_2_C_VERSION
  // _SC_2_CHAR_TERM
  // _SC_2_FORT_DEV
  // _SC_2_FORT_RUN
  // _SC_2_LOCALEDEF
  // _SC_2_PBS
  // _SC_2_PBS_ACCOUNTING
  // _SC_2_PBS_CHECKPOINT
  // _SC_2_PBS_LOCATE
  // _SC_2_PBS_MESSAGE
  // _SC_2_PBS_TRACK
  // _SC_2_SW_DEV
  // _SC_2_UPE
  // _SC_2_VERSION
  // _SC_ADVISORY_INFO
  // _SC_ARG_MAX
  // _SC_AIO_LISTIO_MAX
  // _SC_AIO_MAX
  // _SC_AIO_PRIO_DELTA_MAX
  // _SC_ASYNCHRONOUS_IO
  // _SC_ATEXIT_MAX
  // _SC_BARRIERS
  // _SC_BC_BASE_MAX
  // _SC_BC_DIM_MAX
  // _SC_BC_SCALE_MAX
  // _SC_BC_STRING_MAX
  // _SC_CHILD_MAX
  // _SC_CLK_TCK
  // _SC_CLOCK_SELECTION
  // _SC_COLL_WEIGHTS_MAX
  // _SC_CPUTIME
  // _SC_DELAYTIMER_MAX
  // _SC_EXPR_NEST_MAX
  // _SC_FILE_LOCKING
  // _SC_FSYNC
  // _SC_GETGR_R_SIZE_MAX
  // _SC_GETPW_R_SIZE_MAX
  // _SC_HOST_NAME_MAX
  // _SC_IOV_MAX
  // _SC_JOB_CONTROL
  // _SC_LINE_MAX
  // _SC_LOGIN_NAME_MAX
  // _SC_MAPPED_FILES
  // _SC_MEMLOCK
  // _SC_MEMLOCK_RANGE
  // _SC_MEMORY_PROTECTION
  // _SC_MESSAGE_PASSING
  // _SC_MONOTONIC_CLOCK
  // _SC_MQ_OPEN_MAX
  // _SC_MQ_PRIO_MAX
  // _SC_NGROUPS_MAX
  // _SC_OPEN_MAX
  // _SC_PAGE_SIZE
  // _SC_PAGESIZE
  // _SC_PRIORITIZED_IO
  // _SC_PRIORITY_SCHEDULING
  // _SC_RE_DUP_MAX
  // _SC_READER_WRITER_LOCKS
  // _SC_REALTIME_SIGNALS
  // _SC_REGEXP
  // _SC_RTSIG_MAX
  // _SC_SAVED_IDS
  // _SC_SEMAPHORES
  // _SC_SEM_NSEMS_MAX
  // _SC_SEM_VALUE_MAX
  // _SC_SHARED_MEMORY_OBJECTS
  // _SC_SHELL
  // _SC_SIGQUEUE_MAX
  // _SC_SPAWN
  // _SC_SPIN_LOCKS
  // _SC_SPORADIC_SERVER
  // _SC_STREAM_MAX
  // _SC_SYNCHRONIZED_IO
  // _SC_THREAD_ATTR_STACKADDR
  // _SC_THREAD_ATTR_STACKSIZE
  // _SC_THREAD_CPUTIME
  // _SC_THREAD_DESTRUCTOR_ITERATIONS
  // _SC_THREAD_KEYS_MAX
  // _SC_THREAD_PRIO_INHERIT
  // _SC_THREAD_PRIO_PROTECT
  // _SC_THREAD_PRIORITY_SCHEDULING
  // _SC_THREAD_PROCESS_SHARED
  // _SC_THREAD_SAFE_FUNCTIONS
  // _SC_THREAD_SPORADIC_SERVER
  // _SC_THREAD_STACK_MIN
  // _SC_THREAD_THREADS_MAX
  // _SC_TIMEOUTS
  // _SC_THREADS
  // _SC_TIMER_MAX
  // _SC_TIMERS
  // _SC_TRACE
  // _SC_TRACE_EVENT_FILTER
  // _SC_TRACE_INHERIT
  // _SC_TRACE_LOG
  // _SC_TTY_NAME_MAX
  // _SC_TYPED_MEMORY_OBJECTS
  // _SC_TZNAME_MAX
  // _SC_V6_ILP32_OFF32
  // _SC_V6_ILP32_OFFBIG
  // _SC_V6_LP64_OFF64
  // _SC_V6_LPBIG_OFFBIG
  // _SC_VERSION
  // _SC_XBS5_ILP32_OFF32
  // _SC_XBS5_ILP32_OFFBIG
  // _SC_XBS5_LP64_OFF64
  // _SC_XBS5_LPBIG_OFFBIG
  // _SC_XOPEN_CRYPT
  // _SC_XOPEN_ENH_I18N
  // _SC_XOPEN_LEGACY
  // _SC_XOPEN_REALTIME
  // _SC_XOPEN_REALTIME_THREADS
  // _SC_XOPEN_SHM
  // _SC_XOPEN_STREAMS
  // _SC_XOPEN_UNIX
  // _SC_XOPEN_VERSION
  // _SC_XOPEN_XCU_VERSION
  // }
  // but we can't because under linux this pulls in some code like
  //   enum { foo, bar = foo };
  // and cyclone complains that the expression (foo) of field bar is not
  // a constant.

// Need to #include our getopt.h file to grab getopt and friends
  #include <getopt.h>

// Under Linux, crypt doesn't always get included here for some reason
  // Hmmmm... same for Cygwin
#if defined(__linux__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
  extern "C" char *crypt (const char @__key, const char @__salt);
#endif

  extern "C" int access(const char @,int);

  extern "C" unsigned alarm(unsigned);

  extern "C" int chdir(const char @);

  extern "C" int chown(const char @,uid_t,gid_t);

  extern "C" int chroot(const char @);

  extern "C" int close(int);

  // Not supported yet
  // extern char *ctermid(char *);

  extern "C" int dup(int);

  extern "C" int dup2(int, int);

  //  extern int execl(const char ?, const char ?, ... const char ?);

  // Not supported yet
  // extern int execle(const char *, const char *, ...);

  extern int execlp(const char @, const char @`r, ... const char *`r);

  // Not supported yet
  // extern int execv(const char *, char *const []);

  // FIX: what did I lose by removing the const from this spec?
  //  extern int execve(const char ?, const char ? const ?, const char ? const ?);
    extern "C" int execve(const char @ path, 
			  char *@aqual(`q\T) `r::E* @zeroterm argv, char *@aqual(`q2\T) `r2::E* @zeroterm envp);
    //    extern int execve(const char ?, char ? const ?, char ? const ?);

  extern "C" int execvp(const char @ file, const char ** @zeroterm argv);

  extern "C" void _exit(int);

  extern "C" int fchown(int, uid_t, gid_t);

  extern "C" int fchdir(int);

  extern "C" int fdatasync(int);

  extern "C" pid_t fork(void);

  extern "C" long fpathconf(int, int);

  extern "C" int fsync(int);

  extern "C" int ftruncate(int, off_t);

  extern char ?`r getcwd(char ?`r buf, size_t size);

  extern "C" gid_t getegid(void);

  extern "C" uid_t geteuid(void);

  extern "C" gid_t getgid(void);

  // Not supported yet
  // extern int getgroups(int, gid_t []);

  extern "C" long gethostid(void);

  extern int gethostname(char ? @nozeroterm, size_t);

  // Not supported yet
  // extern char *getlogin(void);

  // Not supported yet
  // extern int getlogin_r(char *, size_t);

  // Not supported yet
  // extern int getopt(int, char * const [], const char *);

  /* Note, getpass is not required by POSIX */
  extern "C" char * getpass(const char @);

  extern "C" pid_t getpgid(pid_t);

  extern "C" pid_t getpgrp(void);

  extern "C" pid_t getpid(void);

  extern "C" pid_t getppid(void);

  extern "C" pid_t getsid(pid_t);

  extern "C" uid_t getuid(void);

  // Not supported yet
  // extern char *getwd(char *); (LEGACY)

  extern "C" int isatty(int);

  // Not supported yet
  // extern int lchown(const char *, uid_t, gid_t);

  extern "C" int link(const char @,const char @);

  extern "C" off_t lseek(int, off_t, int);

  extern "C" int nice(int);

  // Not supported yet
  // extern long pathconf(const char *, int);

  extern "C" int pause(void);

  extern "C" int pipe(int @{2});

  // Not supported yet
  // extern ssize_t pread(int, void *, size_t, off_t);

  // Not supported yet
  // extern ssize_t pwrite(int, const void *, size_t, off_t);

  extern ssize_t read(int, char ? @nozeroterm, size_t);

  // Not supported yet
  // extern ssize_t readlink(const char *restrict, char *restrict, size_t);

  extern "C" int rmdir(const char @);

  extern "C" int setegid(gid_t);

  extern "C" int seteuid(uid_t);

  extern "C" int setgid(gid_t);

  extern "C" int setpgid(pid_t, pid_t);

  extern "C" pid_t setpgrp(void);

  extern "C" int setregid(gid_t, gid_t);

  extern "C" int setreuid(uid_t, uid_t);

  extern "C" pid_t setsid(void);

  extern "C" int setuid(uid_t);

  extern "C" unsigned sleep(unsigned);

  // Not supported yet
  // extern void swab(const void *restrict, void *restrict, ssize_t);

  extern "C" int symlink(const char @ path1, const char @ path2);

  extern "C" void sync(void);

  extern "C" long sysconf(int);

  extern "C" pid_t tcgetpgrp(int);

  extern "C" int tcsetpgrp(int, pid_t);

  extern int truncate(const char @, off_t);

  // Not supported yet
  // extern char *ttyname(int);

  // Not supported yet
  // extern int ttyname_r(int, char *, size_t);

  extern "C" useconds_t ualarm(useconds_t, useconds_t);

  extern "C" int unlink(const char @ pathname);

  extern "C" int usleep(useconds_t);

  extern "C" pid_t vfork(void);

  extern ssize_t write(int, const char ? @nozeroterm, size_t);

  /* intptr_t is omitted */
  /* optarg is omitted */

// Conflict with hand-coded getopt.h so not supported yet
//  extern "C" int optind;

// Conflict with hand-coded getopt.h so not supported yet
//  extern "C" int opterr;

// Conflict with hand-coded getopt.h so not supported yet
//  extern "C" int optopt;
#endif
}
