  #if !TRY_ABORT
  		release_sem(character_wanted);
  #endif
-@@ -183,7 +189,7 @@
+@@ -183,7 +195,7 @@
  	    if (acquired == B_TIMED_OUT)
  		acquire_sem(character_present);
  	    if (charcount > 0) {

diff -Naur vim72/src/os_unix.c vim72.haiku/src/os_unix.c
--- vim72/src/os_unix.c	2009-04-19 20:53:35.000000000 +0000
+++ vim72.haiku/src/os_unix.c	2009-04-26 20:57:12.000000000 +0000
@@ -51,7 +51,7 @@
  */
 #ifndef __TANDEM
 # undef select
-# ifdef __BEOS__
+# if defined(__BEOS__) || defined(__HAIKU__)
 #  define select	beos_select
 # endif
 #endif
@@ -155,7 +155,7 @@
 static void may_core_dump __ARGS((void));
 
 static int  WaitForChar __ARGS((long));
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
 int  RealWaitForChar __ARGS((int, long, int *));
 #else
 static int  RealWaitForChar __ARGS((int, long, int *));
@@ -1094,7 +1094,7 @@
 mch_suspend()
 {

 	release_sem(character_present);
     }
 
@@ -70,13 +71,18 @@
 
 #endif
 
+#ifdef __BEOS__ 
+
 /*
  * select() emulation. Hopefully, in DR9 there will be something
  * useful supplied by the system. ... Alas, not. Not in AAPR, nor
  * in PR or even PR2... R3 then maybe? I don't think so!
  */
 
-    int
+/* sz: Haiku has finally select() support 
+ *		and not require this emulation, I hope! */
+
+	int
 beos_select(int nbits,
        struct fd_set *rbits,
        struct fd_set *wbits,
@@ -84,7 +90,11 @@
        struct timeval *timeout)
 {
     bigtime_t tmo;
-
+// TODO !!!!
+#ifdef FEAT_GUI_BEOS 
+ 	if(gui.in_use)
+	return select(nbits, rbits, wbits, ebits, timeout);
+#endif
     if (nbits == 0) {
 	/* select is purely being used for delay */
 	snooze(timeout->tv_sec * 1e6 + timeout->tv_usec);
@@ -153,13 +163,15 @@
 	    acquired = acquire_sem(character_present);
 	if (acquired == B_NO_ERROR) {
 	    if (charcount > 0) {
