#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>
#include <sys/param.h>
#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
#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 <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
#define TclpAlloc(size) malloc(size)
#define TclpFree(ptr) free(ptr)
#define TclpRealloc(ptr, size) realloc(ptr, size)
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
extern int errno;
#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
#define TclpStat stat
#define TclpAccess access
#ifndef S_IFLNK
# define lstat stat
#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)
#define TclPlatformExit(status) exit(status)
#define TclHasSockets(interp) (TCL_OK)
#if defined(_sgi) || defined(__sgi)
#define environ _environ
#endif
extern char **environ;
extern double strtod();
#define TclpGetDate(t,u) ((u) ? gmtime((t)) : localtime((t)))
#define TclStrftime(s,m,f,t) (strftime((s),(m),(f),(t)))
#define TclpGetPid(pid) ((unsigned long) (pid))
#define TclpReleaseFile(file)
#define TclpFinalize()
EXTERN int TclUnixWaitForFile _ANSI_ARGS_((int fd, int mask,
int timeout));
#endif