diff --git a/xtrn/sdk/xsdkwrap.c b/xtrn/sdk/xsdkwrap.c
index 2703c814dbb56a9e51102aaa07a102bca2eb7103..9c14cd116500dd2281e1f843f36e30a92813ffd3 100644
--- a/xtrn/sdk/xsdkwrap.c
+++ b/xtrn/sdk/xsdkwrap.c
@@ -57,6 +57,7 @@
 	#include <sys/time.h>
 	#include <sys/types.h>
 	#include <signal.h>
+	#include <errno.h>
 
 #endif
 
@@ -354,9 +355,9 @@ long filelength(int fd)
 
 /* Sets a lock on a portion of a file */
 #ifdef __QNX__
-int DLLCALL lock(int fd, long pos, long len)
+int lock(int fd, long pos, long len)
 #else	/* Not QNX */
-int DLLCALL lock(int fd, long pos, int len)
+int lock(int fd, long pos, int len)
 #endif
 {
 	#if defined(F_SANERDLCKNO) || !defined(BSD)
@@ -393,9 +394,9 @@ int DLLCALL lock(int fd, long pos, int len)
 
 /* Removes a lock from a file record */
 #ifdef __QNX__
-int DLLCALL unlock(int fd, long pos, long len)
+int unlock(int fd, long pos, long len)
 #else
-int DLLCALL unlock(int fd, long pos, int len)
+int unlock(int fd, long pos, int len)
 #endif
 {
 
@@ -424,14 +425,14 @@ int DLLCALL unlock(int fd, long pos, int len)
 
 /* Opens a file in specified sharing (file-locking) mode */
 #ifdef __QNX__
-int DLLCALL qnx_sopen(char *fn, int access, int share)
+int qnx_sopen(char *fn, int access, int share)
 {
 #undef sopen		/* Stupid macro trick */
 	return(sopen(fn, access, share, S_IREAD|S_IWRITE));
 #define sopen(x,y,z)	qnx_sopen(x,y,z)
 }
 #else
-int DLLCALL sopen(char *fn, int access, int share)
+int sopen(char *fn, int access, int share)
 {
 	int fd;
 #ifndef F_SANEWRLCKNO
diff --git a/xtrn/sdk/xsdkwrap.h b/xtrn/sdk/xsdkwrap.h
index 1bf4e44b5b7e1759d115968b76b0b896aafe30bd..7123aeda4e08ac3f3fd08f0bd8d24c79375f93ca 100644
--- a/xtrn/sdk/xsdkwrap.h
+++ b/xtrn/sdk/xsdkwrap.h
@@ -140,9 +140,11 @@
 	#define O_BINARY	0		/* all files in binary mode on Unix */
 	#define O_DENYNONE  (1<<31)	/* req'd for Baja/nopen compatibility */
 
+#ifndef __QNX__
 	#define SH_DENYNO	2          // no locks
 	#define SH_DENYRW	F_WRLCK	   // exclusive lock
 	#define SH_DENYWR   F_RDLCK    // shareable lock
+#endif
 
 	#define stricmp(x,y)		strcasecmp(x,y)
 	#define strnicmp(x,y,z)		strncasecmp(x,y,z)
@@ -203,8 +205,10 @@
 	#define tell(fd)			lseek(fd,0,SEEK_CUR)
 
 #ifdef __QNX__
+	#include <share.h>
 	int		qnx_sopen(char *fn, int access, int share);
 	#define sopen(x,y,z)	qnx_sopen(x,y,z)
+	#define L_SET			SEEK_SET
 #else
 	int		sopen(char *fn, int access, int share);
 #endif