diff -Naur ash/README.elks ash-elks/README.elks
--- ash/README.elks	Wed Feb 11 04:36:39 1998
+++ ash-elks/README.elks	Mon Feb 16 01:42:45 1998
@@ -8,3 +8,44 @@
 
 claudio@pos.inf.ufpr.br (Claudio Matsuoka)
 Mon Feb  9 17:40:59 EST 1998
+
+--------------------------------------------------------------
+19980216 Vincent Zweije <zweije@xs4all.nl>
+
+FIXES:
+
+(*) waitpid() does not modify the status parameter.
+    Initialised status to 0 to fake successful command completion.
+
+(*) waitpid() does not obey the WNOHANG flag.
+    Return -1 with EINVAL if WNOHANG requested.
+
+(*) ioctl() does not support the TCGETS operation.
+    Therefore, bcc's libc's isatty() does not work well.
+    Added a substitute eisatty() for an extra check: assume
+        that a character device is a tty (probably okay on elks)
+
+(*) signal() is not supported.
+    Made arrangements for ash not to abort on failed signal setting.
+    Consequently, signals are just left alone if not available.
+
+TODO:
+
+(*) Extend waitpid() (wait4() system call)
+    to handle status and non-blocking.
+    Status is necessary for reliable script programming.
+    Non-blocking is necessary for job control (probably not that
+        important).
+
+(*) Extend ioctl() to handle the TCGETS operation.
+    Possibly temporarily move the eisatty() fix to bcc's libc.
+    Very useful for interactive programs.
+
+(*) Implement signal handling.
+    Necessary for tty signals (^C,^Z) (or the trap builtin).
+
+(*) Implement pipes.
+    Ash handled their lack reasonably gracefully.
+    Very important for some powerful but easy to use IPC.
+
+--------------------------------------------------------------
diff -Naur ash/jobs.c ash-elks/jobs.c
--- ash/jobs.c	Mon Feb  9 03:37:39 1998
+++ ash-elks/jobs.c	Mon Feb 16 01:10:34 1998
@@ -682,7 +682,12 @@
 	struct job *job;
 	{
 	int pid;
-	int status;
+        /*
+         * 19980216 Vincent Zweije <zweije@xs4all.nl>
+         * ELKS does not seem to return statuses through wait4
+         * Initialise to 0 to give semblance of successful exits
+         */
+	int status = 0;
 	struct procstat *sp;
 	struct job *jp;
 	struct job *thisjob;
@@ -833,6 +838,15 @@
 	return wait(status);
 #else
 #if POSIX
+        /*
+         * 19980216 Vincent Zweije <zweije@xs4all.nl>
+         * ELKS does not obey WNOHANG
+         * If requested, return -1 with errno==EINVAL
+         */
+        if (block==0) {
+                errno = EINVAL;
+                return -1;
+        }
 	return waitpid(-1, status, block == 0 ? WNOHANG : 0);
 #else
 	if (block == 0)
diff -Naur ash/miscbltin.c ash-elks/miscbltin.c
--- ash/miscbltin.c	Tue Oct  1 14:00:00 1996
+++ ash-elks/miscbltin.c	Mon Feb 16 00:06:41 1998
@@ -82,7 +82,7 @@
 		else
 			eflag = 1;
 	}
-	if (prompt && isatty(0)) {
+	if (prompt && eisatty(0)) {
 		out2str(prompt);
 		flushall();
 	}
diff -Naur ash/options.c ash-elks/options.c
--- ash/options.c	Tue Oct  1 14:00:00 1996
+++ ash-elks/options.c	Mon Feb 16 00:49:19 1998
@@ -52,6 +52,9 @@
 #include "memalloc.h"
 #include "error.h"
 #include "mystring.h"
+#include <termios.h>
+#include <sys/stat.h>
+#include <errno.h>
 
 char *arg0;			/* value of $0 */
 struct shparam shellparam;	/* current positional parameters */
@@ -72,6 +75,28 @@
 #endif
 
 
+/*
+ * Determine if a file descriptor is connected to a tty
+ *
+ * 19980216 Vincent Zweije <zweije@xs4all.nl>
+ * bcc libc's isatty() is broken in ELKS,
+ * because ELKS does not support the TCGETS ioctl().
+ * Hence this isatty() replacement.
+ */
+
+int eisatty(fd)
+int fd;
+{  struct termios tios;
+   struct stat st;
+   if (ioctl(fd,TCGETS,&tios)==0)       /* The normal way */
+      return 1;
+   else if ((errno==ENOSYS || errno==EINVAL) && fstat(fd,&st)==0)
+                                        /* Guess a character device is ok */
+      return S_ISCHR(st.st_mode);
+   else if (errno==ENOSYS)              /* Last guess */
+      return fd<3;
+}
+
 
 /*
  * Process the shell command line arguments.
@@ -91,7 +116,7 @@
 	options(1);
 	if (*argptr == NULL && minusc == NULL)
 		sflag = 1;
-	editable = (isatty(0) && isatty(1));
+	editable = (eisatty(0) && eisatty(1));
 	if (iflag == 2 && sflag == 1 && editable)
 		iflag = 1;
 	if (jflag == 2)
diff -Naur ash/options.h ash-elks/options.h
--- ash/options.h	Tue Oct  1 14:00:00 1996
+++ ash-elks/options.h	Mon Feb 16 00:06:41 1998
@@ -82,9 +82,11 @@
 void setparam(char **);
 void freeparam(struct shparam *);
 int nextopt(char *);
+int eisatty(int);
 #else
 void procargs();
 void setparam();
 void freeparam();
 int nextopt();
+int eisatty();
 #endif
diff -Naur ash/trap.c ash-elks/trap.c
--- ash/trap.c	Mon Feb  9 03:41:40 1998
+++ ash-elks/trap.c	Mon Feb 16 00:56:45 1998
@@ -53,6 +53,7 @@
 #include "mystring.h"
 #include <sys/types.h>
 #include <signal.h>
+#include <errno.h>
 
 
 /*
@@ -195,8 +196,16 @@
 		 * There is a race condition here if action is not S_IGN.
 		 * A signal can be ignored that shouldn't be.
 		 */
-		if ((int)(sigact = signal(signo, SIG_IGN)) == -1)
-			error("Signal system call failed");
+		/*
+		 * 19980216 Vincent Zweije <zweije@xs4all.nl>
+		 * ELKS does not implement signal()
+		 * If signals not supported, set old value to S_HARD_IGN
+		 */
+		if ((int)(sigact = signal(signo, SIG_IGN)) == SIG_ERR)
+			if (errno==ENOSYS)	/* HACK: man signal(2) does not mention errno */
+				*t = S_HARD_IGN;
+			else
+				error("Signal system call failed with errno %d", errno);
 		if (sigact == SIG_IGN) {
 			*t = S_HARD_IGN;
 		} else {
