Index: trunk/src/emx/include/io.h
===================================================================
--- trunk/src/emx/include/io.h	(revision 2214)
+++ trunk/src/emx/include/io.h	(revision 2215)
@@ -77,5 +77,5 @@
 ssize_t read (int, void *, size_t);
 int select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *);
-int setmode (int, int);
+/* int setmode (int, int); - non standard, should not be in this namespace. besides it conflicts with BSD setmode/getmode. */
 int sopen (__const__ char *, int, int, ...);
 int stat (__const__ char *, struct stat *);
Index: trunk/src/emx/src/lib/bsd/db/btree/bt_open.c
===================================================================
--- trunk/src/emx/src/lib/bsd/db/btree/bt_open.c	(revision 2214)
+++ trunk/src/emx/src/lib/bsd/db/btree/bt_open.c	(revision 2215)
@@ -227,5 +227,5 @@
 		if ((t->bt_fd = mkstemp (namestr)) == -1)
 			goto err;
-		setmode (t->bt_fd, O_BINARY);
+		_setmode (t->bt_fd, O_BINARY);
 		if (_abspath (absname, namestr, sizeof (absname)) == 0)
 			t->tempname = strdup (absname);
Index: trunk/src/emx/src/lib/bsd/db/hash/hash_page.c
===================================================================
--- trunk/src/emx/src/lib/bsd/db/hash/hash_page.c	(revision 2214)
+++ trunk/src/emx/src/lib/bsd/db/hash/hash_page.c	(revision 2215)
@@ -883,5 +883,5 @@
 #ifdef __EMX__
 		char absname[_MAX_PATH];
-		setmode (hashp->fp, O_BINARY);
+		_setmode (hashp->fp, O_BINARY);
 		if (_abspath (absname, namestr, sizeof (absname)) == 0)
 			hashp->tempname = strdup (absname);
Index: trunk/src/emx/src/lib/io/_fsetmod.c
===================================================================
--- trunk/src/emx/src/lib/io/_fsetmod.c	(revision 2214)
+++ trunk/src/emx/src/lib/io/_fsetmod.c	(revision 2215)
@@ -20,5 +20,5 @@
       return -1;
     }
-  if (setmode (stream->_handle, i) == -1)
+  if (_setmode (stream->_handle, i) == -1)
     return -1;
   return 0;
Index: trunk/src/emx/src/lib/io/_setmode.c
===================================================================
--- trunk/src/emx/src/lib/io/_setmode.c	(revision 2215)
+++ trunk/src/emx/src/lib/io/_setmode.c	(revision 2215)
@@ -0,0 +1,39 @@
+/* setmode.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes
+                       -- Copyright (c) 2003 by Knut St. Osmunden */
+
+#include "libc-alias.h"
+#include <io.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <emx/io.h>
+
+int _setmode (int handle, int mode)
+{
+    PLIBCFH pFH;
+    int     old_mode;
+
+    /*
+     * Get filehandle.
+     */
+    pFH = __libc_FH(handle);
+    if (!pFH)
+    {
+        errno = EBADF;
+        return -1;
+    }
+
+    /*
+     * O_BINARY isn't normally stored in the fFlags member.
+     */
+    old_mode = (pFH->fFlags & O_TEXT) ? O_TEXT : O_BINARY;
+    if (mode == O_BINARY)
+        pFH->fFlags &= ~O_TEXT;
+    else if (mode == O_TEXT)
+        pFH->fFlags = (pFH->fFlags & ~O_BINARY) | O_TEXT; /* paranoia */
+    else
+    {
+        errno = EINVAL;
+        return -1;
+    }
+    return old_mode;
+}
Index: trunk/src/emx/src/lib/io/fdopen.c
===================================================================
--- trunk/src/emx/src/lib/io/fdopen.c	(revision 2214)
+++ trunk/src/emx/src/lib/io/fdopen.c	(revision 2215)
@@ -92,5 +92,5 @@
     }
   if (bt)
-    setmode (handle, omode);
+    _setmode (handle, omode);
   dst->_handle = handle;
   dst->_flags |= _IOOPEN | _IOBUFNONE;
Index: trunk/src/emx/src/lib/io/setmode.c
===================================================================
--- trunk/src/emx/src/lib/io/setmode.c	(revision 2214)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/* setmode.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes
-                       -- Copyright (c) 2003 by Knut St. Osmunden */
-
-#include "libc-alias.h"
-#include <io.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <emx/io.h>
-
-int _STD(setmode) (int handle, int mode)
-{
-    PLIBCFH pFH;
-    int     old_mode;
-
-    /*
-     * Get filehandle.
-     */
-    pFH = __libc_FH(handle);
-    if (!pFH)
-    {
-        errno = EBADF;
-        return -1;
-    }
-
-    /*
-     * O_BINARY isn't normally stored in the fFlags member.
-     */
-    old_mode = (pFH->fFlags & O_TEXT) ? O_TEXT : O_BINARY;
-    if (mode == O_BINARY)
-        pFH->fFlags &= ~O_TEXT;
-    else if (mode == O_TEXT)
-        pFH->fFlags = (pFH->fFlags & ~O_BINARY) | O_TEXT; /* paranoia */
-    else
-    {
-        errno = EINVAL;
-        return -1;
-    }
-    return old_mode;
-}
