#ifndef _TCLUNIXPORT
#define _TCLUNIXPORT
#ifndef _TCLINT
# include "tclInt.h"
#endif
#include <errno.h>
#include <fcntl.h>
#ifdef HAVE_NET_ERRNO_H
# include <net/errno.h>
#endif
#include <pwd.h>
#include <signal.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/types.h>
#ifdef USE_DIRENT2_H
# include "../compat/dirent2.h"
#else
#ifdef NO_DIRENT_H
# include "../compat/dirent.h"
#else
# include <dirent.h>
#endif
#endif
#ifdef HAVE_STRUCT_DIRENT64
typedef struct dirent64 Tcl_DirEntry;
# define TclOSreaddir readdir64
# define TclOSreaddir_r readdir64_r
#else
typedef struct dirent Tcl_DirEntry;
# define TclOSreaddir readdir
# define TclOSreaddir_r readdir_r
#endif
#ifdef HAVE_TYPE_OFF64_T
typedef off64_t Tcl_SeekOffset;
# define TclOSseek lseek64
# define TclOSopen open64
#else
typedef off_t Tcl_SeekOffset;
# define TclOSseek lseek
# define TclOSopen open
#endif
#ifdef HAVE_STRUCT_STAT64
# define TclOSstat stat64
# define TclOSlstat lstat64
#else
# define TclOSstat stat
# define TclOSlstat lstat
#endif
#if !HAVE_STRTOLL && defined(TCL_WIDE_INT_TYPE) && !TCL_WIDE_INT_IS_LONG
EXTERN Tcl_WideInt strtoll _ANSI_ARGS_((CONST char *string,
char **endPtr, int base));
EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((CONST char *string,
char **endPtr, int base));
#endif
#include <sys/file.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#include <sys/stat.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
#if HAVE_SYS_TIME_H
# include <sys/time.h>
#else
# include <time.h>
#endif
#endif
#ifndef NO_SYS_WAIT_H
# include <sys/wait.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#else
# include "../compat/unistd.h"
#endif
#ifdef USE_FIONBIO
# ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
# endif
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif
#endif
#include <utime.h>
#include <sys/socket.h>
#ifndef NO_UNAME
# include <sys/utsname.h>
#endif
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#ifndef NO_FLOAT_H
# include <float.h>
#else
#ifndef NO_VALUES_H
# include <values.h>
#endif
#endif
#ifndef FLT_MAX
# ifdef MAXFLOAT
# define FLT_MAX MAXFLOAT
# else
# define FLT_MAX 3.402823466E+38F
# endif
#endif
#ifndef FLT_MIN
# ifdef MINFLOAT
# define FLT_MIN MINFLOAT
# else
# define FLT_MIN 1.175494351E-38F
# endif
#endif
#ifndef O_NONBLOCK
# define O_NONBLOCK 0x80
#endif
#ifdef HPUX
# define NBIO_FLAG O_NONBLOCK
#else
# define NBIO_FLAG O_NDELAY
#endif
#ifdef _AIX
# define WAIT_STATUS_TYPE pid_t
#else
#ifndef NO_UNION_WAIT
# define WAIT_STATUS_TYPE union wait
#else
# define WAIT_STATUS_TYPE int
#endif
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
#ifndef WIFSIGNALED
# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
#endif
#ifndef WTERMSIG
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
#endif
#ifndef WIFSTOPPED
# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
#endif
#ifndef WSTOPSIG
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
#ifndef WNOHANG
# define WNOHANG 1
#endif
#ifndef WUNTRACED
# define WUNTRACED 2
#endif
#ifndef SEEK_SET
# define SEEK_SET 0
#endif
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
#ifndef SEEK_END
# define SEEK_END 2
#endif
#ifdef NO_GETTOD
# include <sys/times.h>
# include <sys/param.h>
# ifndef CLK_TCK
# ifdef HZ
# define CLK_TCK HZ
# else
# define CLK_TCK 60
# endif
# endif
#else
# ifdef HAVE_BSDGETTIMEOFDAY
# define gettimeofday BSDgettimeofday
# endif
#endif
#ifdef GETTOD_NOT_DECLARED
EXTERN int gettimeofday _ANSI_ARGS_((struct timeval *tp,
struct timezone *tzp));
#endif
#ifndef F_OK
# define F_OK 00
#endif
#ifndef X_OK
# define X_OK 01
#endif
#ifndef W_OK
# define W_OK 02
#endif
#ifndef R_OK
# define R_OK 04
#endif
#ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
#endif
#ifndef S_IFLNK
# undef TclOSlstat
# define lstat stat
# define lstat64 stat64
# define TclOSlstat TclOSstat
#endif
#ifndef S_ISREG
# ifdef S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# else
# define S_ISREG(m) 0
# endif
#endif
#ifndef S_ISDIR
# ifdef S_IFDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# else
# define S_ISDIR(m) 0
# endif
#endif
#ifndef S_ISCHR
# ifdef S_IFCHR
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# else
# define S_ISCHR(m) 0
# endif
#endif
#ifndef S_ISBLK
# ifdef S_IFBLK
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
# define S_ISBLK(m) 0
# endif
#endif
#ifndef S_ISFIFO
# ifdef S_IFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# else
# define S_ISFIFO(m) 0
# endif
#endif
#ifndef S_ISLNK
# ifdef S_IFLNK
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# else
# define S_ISLNK(m) 0
# endif
#endif
#ifndef S_ISSOCK
# ifdef S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# else
# define S_ISSOCK(m) 0
# endif
#endif
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else
# define MAXPATHLEN 2048
# endif
#endif
#ifndef L_tmpnam
# define L_tmpnam 100
#endif
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
#else
# ifndef _AIX
typedef long fd_mask;
# endif
# if defined(_IBMR2)
# define SELECT_MASK void
# else
# define SELECT_MASK int
# endif
#endif
#ifndef NBBY
# define NBBY 8
#endif
#ifndef FD_SETSIZE
# ifdef OPEN_MAX
# define FD_SETSIZE OPEN_MAX
# else
# define FD_SETSIZE 256
# endif
#endif
#if !defined(howmany)
# define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#ifndef NFDBITS
# define NFDBITS NBBY*sizeof(fd_mask)
#endif
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
extern int errno;
#ifndef EOVERFLOW
# ifdef EFBIG
# define EOVERFLOW EFBIG
# else
# define EOVERFLOW EINVAL
# endif
#endif
#if defined(_sgi) || defined(__sgi) || (defined(__APPLE__) && defined(__DYNAMIC__))
# define environ _environ
#endif
extern char **environ;
extern double strtod();
#define TclpPanic ((Tcl_PanicProc *) NULL)
#ifdef DJGPP
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
#else
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
#endif
#define TclpGetPid(pid) ((unsigned long) (pid))
#define TclpReleaseFile(file)
#if USE_TCLALLOC
# define TclpSysAlloc(size, isBin) malloc((size_t)size)
# define TclpSysFree(ptr) free((char*)ptr)
# define TclpSysRealloc(ptr, size) realloc((char*)ptr, (size_t)size)
#endif
#define TclpExit exit
#ifdef TCL_THREADS
#include <pthread.h>
typedef pthread_mutex_t TclpMutex;
EXTERN void TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN void TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN void TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN Tcl_DirEntry * TclpReaddir(DIR *);
EXTERN struct tm * TclpLocaltime(time_t *);
EXTERN struct tm * TclpGmtime(time_t *);
EXTERN char * TclpInetNtoa(struct in_addr);
#define readdir(x) TclpReaddir(x)
#define localtime(x) TclpLocaltime(x)
#define gmtime(x) TclpGmtime(x)
#define inet_ntoa(x) TclpInetNtoa(x)
#undef TclOSreaddir
#define TclOSreaddir(x) TclpReaddir(x)
#else
typedef int TclpMutex;
#define TclpMutexInit(a)
#define TclpMutexLock(a)
#define TclpMutexUnlock(a)
#endif
#include "tclPlatDecls.h"
#include "tclIntPlatDecls.h"
#endif