  # endif /* MICRO */
 diff -Naur nethack-3.4.3-orig/include/unixconf.h nethack-3.4.3/include/unixconf.h
 --- nethack-3.4.3-orig/include/unixconf.h	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/unixconf.h	2011-08-05 15:25:18.000000000 -0700
++++ nethack-3.4.3/include/unixconf.h	2011-09-27 13:38:17.000000000 -0700
 @@ -34,7 +34,7 @@
  /* define any of the following that are appropriate */
  #define SVR4		/* use in addition to SYSV for System V Release 4 */

 #LINK=g++
 #	For cross-compiling, eg. with gcc on Linux (see also CC further up):
 #CXX=arm-linux-g++
@@ -171,8 +204,10 @@
 #
 # files for a straight tty port using no native windowing system
 WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \

-LFLAGS = 
+CFLAGS := -O -I../include
+LFLAGS =
+ifneq ($(NACL_GLIBC), 1)
+  LFLAGS += -Xlinker --wrap -Xlinker open
+  LFLAGS += -Xlinker --wrap -Xlinker close
+  LFLAGS += -Xlinker --wrap -Xlinker read
+  LFLAGS += -Xlinker --wrap -Xlinker write
+  LFLAGS += -Xlinker --wrap -Xlinker lseek
+  LFLAGS += -Xlinker --wrap -Xlinker tell
+  LFLAGS += -Xlinker --wrap -Xlinker mkdir
+  LFLAGS += -Xlinker --wrap -Xlinker rmdir
+  LFLAGS += -Xlinker --wrap -Xlinker remove
+  LFLAGS += -Xlinker --wrap -Xlinker getcwd
+  LFLAGS += -Xlinker --wrap -Xlinker getwd
+  LFLAGS += -Xlinker --wrap -Xlinker chdir
+  LFLAGS += -Xlinker --wrap -Xlinker isatty
+  LFLAGS += -Xlinker --wrap -Xlinker stat
+  LFLAGS += -Xlinker --wrap -Xlinker fstat
+  LFLAGS += -Xlinker --wrap -Xlinker access
+  LFLAGS += -Xlinker --wrap -Xlinker getuid
+  LFLAGS += -Xlinker --wrap -Xlinker setuid
+  LFLAGS += -Xlinker --wrap -Xlinker getgid
+  LFLAGS += -Xlinker --wrap -Xlinker setgid
+  LFLAGS += -Xlinker --wrap -Xlinker getlogin
+  LFLAGS += -Xlinker --wrap -Xlinker getpwnam
+  LFLAGS += -Xlinker --wrap -Xlinker getpwuid
+  LFLAGS += -Xlinker --wrap -Xlinker umask
+  LFLAGS += -Xlinker --wrap -Xlinker chmod
+  LFLAGS += -Xlinker --wrap -Xlinker ioctl
+  LFLAGS += -Xlinker --wrap -Xlinker link
+  LFLAGS += -Xlinker --wrap -Xlinker unlink
+  LFLAGS += -Xlinker --wrap -Xlinker kill
+  LFLAGS += -Xlinker --wrap -Xlinker __srget_r
+  LFLAGS += -Xlinker --wrap -Xlinker tgetch
+  LFLAGS += -Xlinker --wrap -Xlinker mount
+  LFLAGS += -Xlinker --wrap -Xlinker umount -Xlinker --wrap -Xlinker signal
+endif
 
 # The Qt and Be window systems are written in C++, while the rest of
 # NetHack is standard C.  If using Qt, uncomment the LINK line here to get
