Index: /trunk/src/ash/Makefile.kmk
===================================================================
--- /trunk/src/ash/Makefile.kmk	(revision 631)
+++ /trunk/src/ash/Makefile.kmk	(revision 632)
@@ -17,9 +17,10 @@
 kmk_ash_DEFS.linux = BSD
 kmk_ash_DEFS.win = \
-	PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
+	BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
 kmk_ash_DEFS.os2 = \
 	HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME \
 	EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
 kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
+kmk_ash_INCS.win = win
 kmk_ash_SOURCES = \
 	alias.c \
@@ -57,4 +58,7 @@
 	strlcpy.c \
 	setmode.c
+#kmk_ash_SOURCES.win = \
+#	win/mscfakes.c
+
 kmk_ash_DEPS = \
 	$(PATH_TARGET)/arith.h \
@@ -75,4 +79,27 @@
 #ash.man_SYMLINKS = \
 #	ash.1.gz=>sh.1
+
+
+
+ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
+
+#
+# Use the pregenerated code.
+#
+kmk_ash_DEPS :=
+
+define def_copy_generated
+$(PATH_TARGET)/$(src): generated/$(src)
+	$$(RM) -f $$@
+	$$(CP) -f $$^ $$@
+kmk_ash_DEPS += $(PATH_TARGET)/$(src)
+endef
+
+$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
+$(eval $(def_copy_generated)))
+
+include $(PATH_KBUILD)/footer.kmk
+
+else
 
 include $(PATH_KBUILD)/footer.kmk
@@ -112,2 +139,3 @@
 	$(MV) init.c $@
 
+endif
Index: /trunk/src/ash/bltin/kill.c
===================================================================
--- /trunk/src/ash/bltin/kill.c	(revision 631)
+++ /trunk/src/ash/bltin/kill.c	(revision 632)
@@ -224,5 +224,7 @@
 	}
 #else
+#ifndef _MSC_VER
 #warning TIOCGWINSZ is not present.
+#endif 
 #endif
 #ifndef HAVE_SYS_SIGNAME
Index: /trunk/src/ash/bltin/test.c
===================================================================
--- /trunk/src/ash/bltin/test.c	(revision 631)
+++ /trunk/src/ash/bltin/test.c	(revision 632)
@@ -361,11 +361,27 @@
 		return S_ISDIR(s.st_mode);
 	case FILCDEV:
+#ifdef S_ISCHR
 		return S_ISCHR(s.st_mode);
+#else
+        return 0;
+#endif 
 	case FILBDEV:
+#ifdef S_ISBLK
 		return S_ISBLK(s.st_mode);
+#else
+        return 0;
+#endif 
 	case FILFIFO:
+#ifdef S_ISFIFO
 		return S_ISFIFO(s.st_mode);
+#else
+        return 0;
+#endif 
 	case FILSOCK:
+#ifdef S_ISSOCK
 		return S_ISSOCK(s.st_mode);
+#else
+        return 0;
+#endif 
 	case FILSYM:
 		return S_ISLNK(s.st_mode);
@@ -375,5 +391,9 @@
 		return (s.st_mode & S_ISGID) != 0;
 	case FILSTCK:
+#ifdef S_ISVTX
 		return (s.st_mode & S_ISVTX) != 0;
+#else
+        return 0;
+#endif 
 	case FILGZ:
 		return s.st_size > (off_t)0;
Index: /trunk/src/ash/error.c
===================================================================
--- /trunk/src/ash/error.c	(revision 631)
+++ /trunk/src/ash/error.c	(revision 632)
@@ -315,5 +315,7 @@
 	{ ENXIO,	ALL,	"no such device or address" },
 	{ EROFS,	ALL,	"read-only file system" },
+#ifdef ETXTBSY
 	{ ETXTBSY,	ALL,	"text busy" },
+#endif
 #ifdef EAGAIN
 	{ EAGAIN,	E_EXEC,	"not enough memory" },
Index: /trunk/src/ash/error.h
===================================================================
--- /trunk/src/ash/error.h	(revision 631)
+++ /trunk/src/ash/error.h	(revision 632)
@@ -112,5 +112,5 @@
  */
 
-#if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__)
+#if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__) && !defined(_MSC_VER)
 #define setjmp(jmploc)	_setjmp(jmploc)
 #define longjmp(jmploc, val)	_longjmp(jmploc, val)
Index: /trunk/src/ash/win/err.c
===================================================================
--- /trunk/src/ash/win/err.c	(revision 632)
+++ /trunk/src/ash/win/err.c	(revision 632)
@@ -0,0 +1,85 @@
+/* $Id$ */
+/** @file
+ *
+ * Override err.h so we get the program name right.
+ *
+ * Copyright (c) 2005 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with This program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include "err.h"
+
+
+/** The current program name. */
+const char *g_progname = "kmk"; 
+
+
+int err(int eval, const char *fmt, ...)
+{
+    va_list args;
+    int error = errno;
+    fprintf(stderr, "%s: ", g_progname);
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+    fprintf(stderr, ": %s\n", strerror(error));
+
+    return eval;
+}
+
+
+int errx(int eval, const char *fmt, ...)
+{
+    va_list args;
+    fprintf(stderr, "%s: ", g_progname);
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+    fprintf(stderr, "\n");
+
+    return eval;
+}
+
+void warn(const char *fmt, ...)
+{
+    int error = errno;
+    va_list args;
+    fprintf(stderr, "%s: ", g_progname);
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+    fprintf(stderr, ": %s\n", strerror(error));
+}
+
+void warnx(const char *fmt, ...)
+{
+    int err = errno;
+    va_list args;
+    fprintf(stderr, "%s: ", g_progname);
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+    fprintf(stderr, "\n");
+}
+
Index: /trunk/src/ash/win/err.h
===================================================================
--- /trunk/src/ash/win/err.h	(revision 632)
+++ /trunk/src/ash/win/err.h	(revision 632)
@@ -0,0 +1,35 @@
+/* $Id$ */
+/** @file
+ *
+ * Override err.h stuff so we get the program names right.
+ *
+ * Copyright (c) 2005 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with This program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef __err_h__
+#define __err_h__
+
+extern const char *g_progname;
+int err(int eval, const char *fmt, ...);
+int errx(int eval, const char *fmt, ...);
+void warn(const char *fmt, ...);
+void warnx(const char *fmt, ...);
+
+#endif
+
Index: /trunk/src/ash/win/getopt.h
===================================================================
--- /trunk/src/ash/win/getopt.h	(revision 632)
+++ /trunk/src/ash/win/getopt.h	(revision 632)
@@ -0,0 +1,133 @@
+/* Declarations for getopt.
+Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to bug-glibc@gnu.org.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; see the file COPYING.  If not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+   When `getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when `ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to `getopt'.
+
+   On entry to `getopt', zero means this is the first call; initialize.
+
+   When `getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, `optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of `struct option' terminated by an element containing a name which is
+   zero.
+
+   The field `has_arg' is:
+   no_argument		(or 0) if the option does not take an argument,
+   required_argument	(or 1) if the option requires an argument,
+   optional_argument 	(or 2) if the option takes an optional argument.
+
+   If the field `flag' is not NULL, it points to a variable that is set
+   to the value given in the field `val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an `int' to
+   a compiled-in constant, such as set a value from `optarg', set the
+   option's `flag' field to zero and its `val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero `flag' field, `getopt'
+   returns the contents of the `val' field.  */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+  const char *name;
+#else
+  char *name;
+#endif
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'.  */
+
+#define	no_argument		0
+#define required_argument	1
+#define optional_argument	2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+   differences in the consts, in stdlib.h.  To avoid compilation
+   errors, only prototype getopt for the GNU C library.  */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+		        const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+			     const char *shortopts,
+		             const struct option *longopts, int *longind);
+
+/* Internal only.  Users should not call this directly.  */
+extern int _getopt_internal (int argc, char *const *argv,
+			     const char *shortopts,
+		             const struct option *longopts, int *longind,
+			     int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* getopt.h */
Index: /trunk/src/ash/win/mscfakes.c
===================================================================
--- /trunk/src/ash/win/mscfakes.c	(revision 632)
+++ /trunk/src/ash/win/mscfakes.c	(revision 632)
@@ -0,0 +1,152 @@
+/* $Id$ */
+/** @file
+ *
+ * Fake Unix stuff for MSC.
+ *
+ * Copyright (c) 2005 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with This program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <io.h>
+#include <fcntl.h>
+#include "err.h"
+#include "mscfakes.h"
+#undef mkdir
+
+
+char *dirname(char *path)
+{         
+    /** @todo later */
+    return path;
+}
+
+
+int link(const char *pszDst, const char *pszLink)
+{
+    errno = ENOSYS;
+    err(1, "link() is not implemented on windows!");
+    return -1;
+}
+
+
+int mkdir_msc(const char *path, mode_t mode)
+{
+    int rc = mkdir(path);
+    if (rc)
+    {
+        int len = strlen(path);
+        if (len > 0 && (path[len - 1] == '/' || path[len - 1] == '\\'))
+        {
+            char *str = strdup(path);
+            while (len > 0 && (str[len - 1] == '/' || str[len - 1] == '\\'))
+                str[--len] = '\0';
+            rc = mkdir(str);
+            free(str);
+        }
+    }
+    return rc;
+}
+
+
+static int doname(char *pszX, char *pszEnd)
+{
+    static char s_szChars[] = "Xabcdefghijklmnopqrstuwvxyz1234567890";
+    int rc = 0;
+    do
+    {
+        char ch;
+
+        pszEnd++;
+        ch = *(strchr(s_szChars, *pszEnd) + 1);
+        if (ch)
+        {
+            *pszEnd = ch;
+            return 0;
+        }
+        *pszEnd = 'a';
+    } while (pszEnd != pszX);
+    return 1;
+}
+
+
+int mkstemp(char *temp)
+{
+    char *pszX = strchr(temp, 'X');
+    char *pszEnd = strchr(pszX, '\0');
+    int cTries = 1000;
+    while (--cTries > 0)
+    {
+        int fd;
+        if (doname(pszX, pszEnd))
+            return -1;
+        fd = open(temp, _O_EXCL | _O_CREAT | _O_BINARY | _O_RDWR, 0777);
+        if (fd >= 0)
+            return fd;
+    }
+    return -1;
+}
+
+
+int symlink(const char *pszDst, const char *pszLink)
+{
+    errno = ENOSYS;
+    err(1, "symlink() is not implemented on windows!");
+    return -1;
+}
+
+
+#if _MSC_VER < 1400
+int snprintf(char *buf, size_t size, const char *fmt, ...)
+{
+    int cch;
+    va_list args;
+    va_start(args, fmt);
+    cch = vsprintf(buf, fmt, args);
+    va_end(args);
+    return cch;
+}
+#endif 
+
+
+int utimes(const char *pszPath, const struct timeval *paTimes)
+{
+    /** @todo implement me! */
+    return 0;
+}
+
+
+int writev(int fd, const struct iovec *vector, int count)
+{
+    int size = 0;
+    int i;
+    for (i = 0; i < count; i++)
+    {
+        int cb = write(fd, vector[i].iov_base, vector[i].iov_len);
+        if (cb < 0)
+            return -1;
+        size += cb;
+    }
+    return size;
+}
+
Index: /trunk/src/ash/win/mscfakes.h
===================================================================
--- /trunk/src/ash/win/mscfakes.h	(revision 632)
+++ /trunk/src/ash/win/mscfakes.h	(revision 632)
@@ -0,0 +1,185 @@
+/* $Id$ */
+/** @file
+ *
+ * Unix fakes for MSC.
+ *
+ * Copyright (c) 2005 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with This program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef __mscfakes_h__
+#define __mscfakes_h__
+#ifdef _MSC_VER
+
+#define setmode setmode_msc
+#include <io.h>
+#include <direct.h>
+#include <time.h>
+#include <fcntl.h>
+#include <limits.h>
+#undef setmode
+//#include "getopt.h"
+
+#if !defined(__GNUC__) && !defined(__attribute__)
+#define __attribute__(a)
+#endif 
+
+typedef int pid_t;
+
+#define S_ISDIR(m)  (((m) & _S_IFMT) == _S_IFDIR)
+#define S_ISREG(m)  (((m) & _S_IFMT) == _S_IFREG)
+#define S_ISLNK(m)  0
+#define	S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
+#define	S_IXUSR _S_IEXEC
+#define	S_IWUSR _S_IWRITE
+#define	S_IRUSR _S_IREAD
+#define S_IRWXG 0000070
+#define S_IRGRP	0000040
+#define S_IWGRP	0000020
+#define S_IXGRP 0000010
+#define S_IRWXO 0000007
+#define S_IROTH	0000004
+#define S_IWOTH	0000002
+#define S_IXOTH 0000001
+#define	S_ISUID 0004000
+#define	S_ISGID 0002000
+#define ALLPERMS 0000777
+
+#define PATH_MAX _MAX_PATH
+#define MAXPATHLEN _MAX_PATH
+
+#define EX_OK 0
+#define EX_OSERR 1
+#define EX_NOUSER 1
+#define EX_USAGE 1
+
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+#define F_OK 0
+#define X_OK 1
+#define W_OK 2
+#define R_OK 4
+
+#define EFTYPE EINVAL
+
+#define _PATH_DEVNULL "/dev/null"
+
+#define MAX(a,b) ((a) >= (b) ? (a) : (b))
+
+typedef int mode_t;
+typedef unsigned short nlink_t;
+typedef unsigned short uid_t;
+typedef unsigned short gid_t;
+typedef long ssize_t;
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+
+#ifndef timerisset
+struct timeval 
+{
+    long tv_sec;
+    long tv_usec;
+};
+#endif 
+
+struct iovec 
+{
+    char *iov_base;
+    size_t iov_len;
+};
+
+
+#define chown(path, uid, gid) 0         /** @todo implement fchmod! */
+char *dirname(char *path);
+#define fsync(fd)  0
+#define fchown(fd,uid,gid) 0
+#define fchmod(fd, mode) 0              /** @todo implement fchmod! */
+#define geteuid()  0
+#define lstat(path, s) stat(path, s)
+#define lchmod(path, mod) chmod(path, mod)
+#define lchown(path, uid, gid) chown(path, uid, gid)
+#define lutimes(path, tvs) utimes(path, tvs)
+int link(const char *pszDst, const char *pszLink);
+int mkdir_msc(const char *path, mode_t mode);
+#define mkdir(path, mode) mkdir_msc(path, mode)
+#define mkfifo(path, mode) -1
+#define mknod(path, mode, devno) -1
+#define pipe(v) _pipe(v,0,0)
+int mkstemp(char *temp);
+#define readlink(link, buf, size) -1
+#define reallocf(old, size) realloc(old, size)
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+#if _MSC_VER < 1400
+int snprintf(char *buf, size_t size, const char *fmt, ...);
+#else
+#define snprintf _snprintf
+#endif 
+size_t strlcpy(char *, const char *, size_t);
+int symlink(const char *pszDst, const char *pszLink);
+int utimes(const char *pszPath, const struct timeval *paTimes);
+int writev(int fd, const struct iovec *vector, int count);
+#define	F_DUPFD	0
+#define F_GETFD 1
+#define F_SETFD 2
+#define F_GETFL 3
+#define F_SETFL 4
+#define	FD_CLOEXEC 1
+#define O_NONBLOCK 0 /// @todo
+#define EWOULDBLOCK 512
+int fcntl (int, int, ...);
+
+/* signal hacks */
+typedef struct sigset 
+{   
+    unsigned long __bitmap[1]; 
+} sigset_t;
+int	sigprocmask(int, const sigset_t *, sigset_t *);
+#define SIG_BLOCK           1
+#define SIG_UNBLOCK         2
+#define SIG_SETMASK         3
+
+#define SIGTTIN 0
+#define SIGTSTP 0
+#define SIGTTOU 0
+#define SIGCONT 0
+#define SIGPIPE 0
+#define SIGQUIT 0
+#define SIGHUP 0
+#ifndef NSIG
+#define NSIG 32
+#endif 
+extern const char *const sys_siglist[NSIG];
+
+int	kill(pid_t, int);
+int	sigaction(int, const struct sigaction *, struct sigaction *);
+//int	sigaddset(sigset_t *, int);
+//int	sigdelset(sigset_t *, int);
+int	sigemptyset(sigset_t *);
+//int	sigfillset(sigset_t *);
+//int	sigismember(const sigset_t *, int);
+//int	sigpending(sigset_t *);
+//int	sigsuspend(const sigset_t *);
+//int	sigwait(const sigset_t *, int *);
+
+#endif /* _MSC_VER */
+#endif 
+
Index: /trunk/src/ash/win/paths.h
===================================================================
--- /trunk/src/ash/win/paths.h	(revision 632)
+++ /trunk/src/ash/win/paths.h	(revision 632)
@@ -0,0 +1,2 @@
+#include "mscfakes.h"
+#define _PATH_DEFPATH ""
Index: /trunk/src/ash/win/pwd.h
===================================================================
--- /trunk/src/ash/win/pwd.h	(revision 632)
+++ /trunk/src/ash/win/pwd.h	(revision 632)
@@ -0,0 +1,23 @@
+#ifndef __pwd_h__
+#define __pwd_h__
+#include <time.h>
+
+struct passwd {
+	char	*pw_name;		/* user name */
+	char	*pw_passwd;		/* encrypted password */
+	int	pw_uid;			/* user uid */
+	int	pw_gid;			/* user gid */
+	time_t	pw_change;		/* password change time */
+	char	*pw_class;		/* user access class */
+	char	*pw_gecos;		/* Honeywell login info */
+	char	*pw_dir;		/* home directory */
+	char	*pw_shell;		/* default shell */
+	time_t	pw_expire;		/* account expiration */
+	int	pw_fields;		/* internal: fields filled in */
+};
+
+struct passwd	*getpwnam(const char *);
+struct passwd	*getpwuid(int);
+
+
+#endif
Index: /trunk/src/ash/win/strings.h
===================================================================
--- /trunk/src/ash/win/strings.h	(revision 632)
+++ /trunk/src/ash/win/strings.h	(revision 632)
@@ -0,0 +1,3 @@
+#include <string.h>
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
Index: /trunk/src/ash/win/sys/cdefs.h
===================================================================
--- /trunk/src/ash/win/sys/cdefs.h	(revision 632)
+++ /trunk/src/ash/win/sys/cdefs.h	(revision 632)
@@ -0,0 +1,6 @@
+#ifndef __sys_cdefs_h__
+#define __sys_cdefs_h__
+
+#define __attribute__(a)
+
+#endif
Index: /trunk/src/ash/win/sys/fcntl.h
===================================================================
--- /trunk/src/ash/win/sys/fcntl.h	(revision 632)
+++ /trunk/src/ash/win/sys/fcntl.h	(revision 632)
@@ -0,0 +1,1 @@
+#include "../mscfakes.h"
Index: /trunk/src/ash/win/sys/ioctl.h
===================================================================
--- /trunk/src/ash/win/sys/ioctl.h	(revision 632)
+++ /trunk/src/ash/win/sys/ioctl.h	(revision 632)
@@ -0,0 +1,1 @@
+/* */
Index: /trunk/src/ash/win/sys/param.h
===================================================================
--- /trunk/src/ash/win/sys/param.h	(revision 632)
+++ /trunk/src/ash/win/sys/param.h	(revision 632)
@@ -0,0 +1,2 @@
+#include <limits.h>
+
Index: /trunk/src/ash/win/sys/resource.h
===================================================================
--- /trunk/src/ash/win/sys/resource.h	(revision 632)
+++ /trunk/src/ash/win/sys/resource.h	(revision 632)
@@ -0,0 +1,1 @@
+/* */
Index: /trunk/src/ash/win/sys/time.h
===================================================================
--- /trunk/src/ash/win/sys/time.h	(revision 632)
+++ /trunk/src/ash/win/sys/time.h	(revision 632)
@@ -0,0 +1,1 @@
+#include <time.h>
Index: /trunk/src/ash/win/sys/times.h
===================================================================
--- /trunk/src/ash/win/sys/times.h	(revision 632)
+++ /trunk/src/ash/win/sys/times.h	(revision 632)
@@ -0,0 +1,15 @@
+#ifndef __sys_times_h__
+#define __sys_times_h__
+#include <time.h>
+
+struct tms
+{
+    clock_t tms_utime;      /**< User mode CPU time. */
+    clock_t tms_stime;      /**< Kernel mode CPU time. */
+    clock_t tms_cutime;     /**< User mode CPU time for waited for children. */
+    clock_t tms_cstime;     /**< Kernel mode CPU time for waited for children. */
+};
+
+clock_t times(struct tms *);
+
+#endif 
Index: /trunk/src/ash/win/sys/wait.h
===================================================================
--- /trunk/src/ash/win/sys/wait.h	(revision 632)
+++ /trunk/src/ash/win/sys/wait.h	(revision 632)
@@ -0,0 +1,25 @@
+#ifndef __sys_wait_h__
+#define __sys_wait_h__
+
+#include "mscfakes.h"
+
+#define	WNOHANG		1	/* Don't hang in wait. */
+#define	WUNTRACED	2	/* Tell about stopped, untraced children. */
+#define	WCONTINUED	4	/* Report a job control continued process. */
+#define	_W_INT(w)	(*(int *)&(w))	/* Convert union wait to int. */
+#define	WCOREFLAG	0200
+
+#define	_WSTATUS(x)	(_W_INT(x) & 0177)
+#define	_WSTOPPED	0177		/* _WSTATUS if process is stopped */
+#define	WIFSTOPPED(x)	(_WSTATUS(x) == _WSTOPPED)
+#define	WSTOPSIG(x)	(_W_INT(x) >> 8)
+#define	WIFSIGNALED(x)	(_WSTATUS(x) != 0 && !WIFSTOPPED(x) && !WIFCONTINUED(x)) /* bird: made GLIBC tests happy. */
+#define	WTERMSIG(x)	(_WSTATUS(x))
+#define	WIFEXITED(x)	(_WSTATUS(x) == 0)
+#define	WEXITSTATUS(x)	(_W_INT(x) >> 8)
+#define	WIFCONTINUED(x)	(x == 0x13)	/* 0x13 == SIGCONT */
+#define	WCOREDUMP(x)	(_W_INT(x) & WCOREFLAG)
+#define	W_EXITCODE(ret, sig)	((ret) << 8 | (sig))
+#define	W_STOPCODE(sig)		((sig) << 8 | _WSTOPPED)
+
+#endif 
Index: /trunk/src/ash/win/termios.h
===================================================================
--- /trunk/src/ash/win/termios.h	(revision 632)
+++ /trunk/src/ash/win/termios.h	(revision 632)
@@ -0,0 +1,1 @@
+/* */
Index: /trunk/src/ash/win/unistd.h
===================================================================
--- /trunk/src/ash/win/unistd.h	(revision 632)
+++ /trunk/src/ash/win/unistd.h	(revision 632)
@@ -0,0 +1,5 @@
+#include "mscfakes.h"
+#include "getopt.h"
+
+#define _SC_CLK_TCK 0x101
+long _sysconf(int);
