diff --git a/include/my_pthread.h b/include/my_pthread.h
index 0b41dc18fe1a749e5ff447581f24d58aba66ec6d..4247b951d82a4f716e5f97e576e28bbecabc8f8b 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -247,6 +247,11 @@ extern int my_sigwait(const sigset_t *set,int *sig);
 #error Requires at least rev 2 of EMX pthreads library.
 #endif
 
+#ifdef __NETWARE__
+void my_pthread_exit(void *status);
+#define pthread_exit(A) my_pthread_exit(A)
+#endif
+
 extern int my_pthread_getprio(pthread_t thread_id);
 
 #define pthread_key(T,V) pthread_key_t V
diff --git a/mysys/mf_path.c b/mysys/mf_path.c
index 23eadd2acce0295d69e591b6dfe6ac2777095023..1ecd5fbb2b121c9395aeb7611d316b6b60efc3da 100644
--- a/mysys/mf_path.c
+++ b/mysys/mf_path.c
@@ -77,6 +77,9 @@ my_string my_path(my_string to, const char *progname,
 #define F_OK 0
 #define PATH_SEP ';'
 #define PROGRAM_EXTENSION ".exe"
+#elif defined(__NETWARE__)
+#define PATH_SEP ';'
+#define PROGRAM_EXTENSION ".nlm"
 #else
 #define PATH_SEP ':'
 #endif
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index 1eb15d92bc97fcb0885b32978e03065582ebd232..f88a884a1bcd8b5757bd4fe7d29e48ae46318b16 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -90,6 +90,29 @@ void *my_pthread_getspecific_imp(pthread_key_t key)
 }
 #endif
 
+#ifdef __NETWARE__
+/*
+don't kill the LibC Reaper thread or the main thread
+*/
+#include <nks/thread.h>
+void my_pthread_exit(void *status)
+{
+#undef pthread_exit
+  NXThreadId_t tid = NXThreadGetId();
+  NXContext_t ctx;
+  char name[PATH_MAX] = "";
+
+  NXThreadGetContext(tid, &ctx);
+  NXContextGetName(ctx, name, PATH_MAX);
+
+  // "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
+  // with a debug build of LibC the reaper can have different names
+  if (!strindex(name, "\'s"))
+  {
+    pthread_exit(status);
+  }
+}
+#endif
 
 /* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7
    (and DEC OSF/1 3.2 too) */
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 38b3c22b91bb283f9b4815ca8c098c842837a62d..6489685c92375ff5ee884cc510951312868afa56 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -243,7 +243,7 @@ static void mc_free_old_query(MYSQL *mysql)
 static int mc_sock_connect(my_socket s, const struct sockaddr *name,
 			   uint namelen, uint to)
 {
-#if defined(__WIN__) || defined(OS2)
+#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
   return connect(s, (struct sockaddr*) name, namelen);
 #else
   int flags, res, s_err;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 3910bfc880b6b37800dbeb1b171921970e26b919..5529408c8d7e1f368e98629af1fe2fc761fabf1d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -797,9 +797,9 @@ static void __cdecl kill_server(int sig_ptr)
 
 #ifdef __NETWARE__
   pthread_join(select_thread, NULL);		// wait for main thread
-#else
-  pthread_exit(0);				/* purecov: deadcode */
 #endif /* __NETWARE__ */
+  
+  pthread_exit(0);				/* purecov: deadcode */
 
   RETURN_FROM_KILL_SERVER;
 }
@@ -856,13 +856,11 @@ void unireg_end(void)
 {
   clean_up(1);
   my_thread_end();
-#ifndef __NETWARE__
-#ifdef SIGNALS_DONT_BREAK_READ
+#if defined(SIGNALS_DONT_BREAK_READ) && !defined(__NETWARE__)
   exit(0);
 #else
   pthread_exit(0);				// Exit is in main thread
 #endif
-#endif /* __NETWARE__ */
 }
 
 
diff --git a/sql/slave.cc b/sql/slave.cc
index 771317f943144242e7971b88aad5cceed32cebb2..e6215356ad127e22c4967fd8064985c3838292b2 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2355,9 +2355,7 @@ log space");
     goto slave_begin;
 #endif  
   my_thread_end();
-#ifndef __NETWARE__
   pthread_exit(0);
-#endif /* __NETWARE__ */
   DBUG_RETURN(0);				// Can't return anything here
 }
 
@@ -2500,9 +2498,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
     goto slave_begin;
 #endif  
   my_thread_end(); // clean-up before broadcasting termination
-#ifndef __NETWARE__
   pthread_exit(0);
-#endif /* __NETWARE__ */
   DBUG_RETURN(0);				// Can't return anything here
 }
 
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 62ed0fc5bedefdae7e5f1eba2ba4dcfc856de5a8..ee573672c35f34fab74b601ade4165f9b205f5e3 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -179,7 +179,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
     else
     {
       unpack_filename(name,ex->file_name);
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
       MY_STAT stat_info;
       if (!my_stat(name,&stat_info,MYF(MY_WME)))
 	DBUG_RETURN(-1);