--- a/file.c
+++ b/file.c
@@ -368,6 +368,7 @@
 	return 0;
 }
 
+#ifdef TIOCSTAT
 static int
 cl_status(struct cmdline *cl, int c)
 {
@@ -377,6 +378,7 @@
 
 	return 0;
 }
+#endif
 
 const struct termios *
 setup_tty(int on)
@@ -763,7 +765,9 @@
 		{ cl_literal,	VLNEXT },
 		{ cl_recognize,	VEOL },
 		{ cl_reprint,	VREPRINT },
+#ifdef TIOCSTAT		
 		{ cl_status,	VSTATUS },
+#endif		
 		{ cl_insert,	-1 }
 	};
 	unsigned char		 buf[BUFSIZ];
@@ -784,8 +788,10 @@
 	cl.size = sizeof(buf);
 	if (inputline_size < cl.size)
 		cl.size = inputline_size;
+#ifdef ALTWERASE	
 	if (cl.istty && tio->c_lflag & ALTWERASE)
-		cl.flags |= CL_ALTWERASE;
+	  cl.flags |= CL_ALTWERASE;
+#endif
 	if (needprompt) {
 		needprompt = 0;
 		cl.flags |= CL_PROMPT;
