ソースを参照

--- Merging r19351 into '.':
A rtl/openbsd/unxsysc.inc
U rtl/openbsd/Makefile.fpc
U rtl/openbsd/signal.inc
U rtl/openbsd/errnostr.inc
U rtl/openbsd/sysnr.inc
A rtl/openbsd/unxconst.inc
A rtl/openbsd/i386/bsyscall.inc
U rtl/openbsd/i386/sighnd.inc
A rtl/openbsd/osdefs.inc
U rtl/openbsd/ptypes.inc
A rtl/openbsd/unxfunc.inc
U rtl/openbsd/classes.pp
U rtl/openbsd/unixsock.inc
C rtl/openbsd/Makefile
--- Merging r19370 into '.':
U rtl/openbsd/i386/prt0.as
--- Merging r19371 into '.':
U rtl/openbsd/unxsockh.inc
--- Merging r19372 into '.':
U rtl/openbsd/termios.inc
--- Merging r19373 into '.':
G rtl/openbsd/Makefile.fpc
C rtl/openbsd/Makefile
--- Merging r19375 into '.':
U packages/fv/src/platform.inc
--- Merging r19377 into '.':
U compiler/systems/i_bsd.pas
--- Merging r19386 into '.':
G rtl/openbsd/sysnr.inc
--- Merging r19395 into '.':
G rtl/openbsd/Makefile.fpc
C rtl/openbsd/Makefile
--- Merging r19404 into '.':
A rtl/openbsd/check_sys.sh
--- Merging r19405 into '.':
G rtl/openbsd/sysnr.inc
--- Merging r19407 into '.':
G rtl/openbsd/sysnr.inc
--- Merging r19408 into '.':
G rtl/openbsd/sysnr.inc
--- Merging r19421 into '.':
G rtl/openbsd/Makefile.fpc
G rtl/openbsd/Makefile
--- Merging r19423 into '.':
G rtl/openbsd/sysnr.inc
--- Merging r19443 into '.':
U rtl/openbsd/i386/cprt0.as
--- Merging r19446 into '.':
G rtl/openbsd/Makefile.fpc
G rtl/openbsd/Makefile
Summary of conflicts:
Text conflicts: 3

# revisions: 19351,19370,19371,19372,19373,19375,19377,19386,19395,19404,19405,19407,19408,19421,19423,19443,19446
------------------------------------------------------------------------
r19351 | pierre | 2011-10-04 01:24:05 +0200 (Tue, 04 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/Makefile
M /trunk/rtl/openbsd/Makefile.fpc
M /trunk/rtl/openbsd/classes.pp
M /trunk/rtl/openbsd/errnostr.inc
A /trunk/rtl/openbsd/i386/bsyscall.inc
M /trunk/rtl/openbsd/i386/sighnd.inc
A /trunk/rtl/openbsd/osdefs.inc
M /trunk/rtl/openbsd/ptypes.inc
M /trunk/rtl/openbsd/signal.inc
M /trunk/rtl/openbsd/sysnr.inc
M /trunk/rtl/openbsd/unixsock.inc
A /trunk/rtl/openbsd/unxconst.inc
A /trunk/rtl/openbsd/unxfunc.inc
A /trunk/rtl/openbsd/unxsysc.inc

* Try to update i386/openbsd port
------------------------------------------------------------------------
------------------------------------------------------------------------
r19370 | pierre | 2011-10-05 00:21:41 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/i386/prt0.as

* Fix linking problems
------------------------------------------------------------------------
------------------------------------------------------------------------
r19371 | pierre | 2011-10-05 00:23:00 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/unxsockh.inc

* Updated using freebsd version (not verified)
------------------------------------------------------------------------
------------------------------------------------------------------------
r19372 | pierre | 2011-10-05 00:23:19 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/termios.inc

* Updated using freebsd version (not verified)
------------------------------------------------------------------------
------------------------------------------------------------------------
r19373 | pierre | 2011-10-05 00:24:01 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/Makefile
M /trunk/rtl/openbsd/Makefile.fpc

+ All several units also compiled on freebsd
------------------------------------------------------------------------
------------------------------------------------------------------------
r19375 | pierre | 2011-10-05 00:26:04 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/packages/fv/src/platform.inc

+ Add FPC OpenBSD target support
------------------------------------------------------------------------
------------------------------------------------------------------------
r19377 | pierre | 2011-10-05 00:33:13 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/compiler/systems/i_bsd.pas

i386-OpenBSD 4.9 has no underscore prefix
------------------------------------------------------------------------
------------------------------------------------------------------------
r19386 | pierre | 2011-10-05 23:04:26 +0200 (Wed, 05 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/sysnr.inc

* Fix syscall_nr_exit value
------------------------------------------------------------------------
------------------------------------------------------------------------
r19395 | marco | 2011-10-06 20:17:16 +0200 (Thu, 06 Oct 2011) | 2 lines
Changed paths:
M /trunk/rtl/openbsd/Makefile
M /trunk/rtl/openbsd/Makefile.fpc

* include cmem in makefile.

------------------------------------------------------------------------
------------------------------------------------------------------------
r19404 | pierre | 2011-10-07 20:41:35 +0200 (Fri, 07 Oct 2011) | 1 line
Changed paths:
A /trunk/rtl/openbsd/check_sys.sh

* Script to check system call numbers
------------------------------------------------------------------------
------------------------------------------------------------------------
r19405 | pierre | 2011-10-07 20:52:04 +0200 (Fri, 07 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/sysnr.inc

* Fix some syscall_nr with check_sys.sh script
------------------------------------------------------------------------
------------------------------------------------------------------------
r19407 | pierre | 2011-10-07 21:13:19 +0200 (Fri, 07 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/sysnr.inc

* fix stupid mistake
------------------------------------------------------------------------
------------------------------------------------------------------------
r19408 | pierre | 2011-10-07 21:45:27 +0200 (Fri, 07 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/sysnr.inc

* Remove unfound syscalls
------------------------------------------------------------------------
------------------------------------------------------------------------
r19421 | marco | 2011-10-08 21:49:12 +0200 (Sat, 08 Oct 2011) | 2 lines
Changed paths:
M /trunk/rtl/openbsd/Makefile
M /trunk/rtl/openbsd/Makefile.fpc

* units dl and termio added that were implictely built.

------------------------------------------------------------------------
------------------------------------------------------------------------
r19423 | pierre | 2011-10-09 17:34:19 +0200 (Sun, 09 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/sysnr.inc

Use old 3.5 version of getdirentries
------------------------------------------------------------------------
------------------------------------------------------------------------
r19443 | pierre | 2011-10-10 01:16:41 +0200 (Mon, 10 Oct 2011) | 1 line
Changed paths:
M /trunk/rtl/openbsd/i386/cprt0.as

Fix linking problems for programs using C lib
------------------------------------------------------------------------
------------------------------------------------------------------------
r19446 | marco | 2011-10-10 22:35:00 +0200 (Mon, 10 Oct 2011) | 2 lines
Changed paths:
M /trunk/rtl/openbsd/Makefile
M /trunk/rtl/openbsd/Makefile.fpc

* added unit bsd (needed for kevent/lnet). OpenBSD seems to have it.

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@19941 -

marco 13 年 前
コミット
5341b9a47b

+ 6 - 0
.gitattributes

@@ -7795,12 +7795,15 @@ rtl/objpas/varutilh.inc svneol=native#text/plain
 rtl/objpas/varutils.inc svneol=native#text/plain
 rtl/openbsd/Makefile svneol=native#text/plain
 rtl/openbsd/Makefile.fpc svneol=native#text/plain
+rtl/openbsd/check_sys.sh svneol=native#text/plain
 rtl/openbsd/classes.pp svneol=native#text/plain
 rtl/openbsd/errno.inc svneol=native#text/plain
 rtl/openbsd/errnostr.inc svneol=native#text/plain
+rtl/openbsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/openbsd/i386/cprt0.as svneol=native#text/plain
 rtl/openbsd/i386/prt0.as svneol=native#text/plain
 rtl/openbsd/i386/sighnd.inc svneol=native#text/plain
+rtl/openbsd/osdefs.inc svneol=native#text/plain
 rtl/openbsd/pmutext.inc svneol=native#text/plain
 rtl/openbsd/ptypes.inc svneol=native#text/plain
 rtl/openbsd/signal.inc svneol=native#text/plain
@@ -7815,7 +7818,10 @@ rtl/openbsd/termios.inc svneol=native#text/plain
 rtl/openbsd/termiosproc.inc svneol=native#text/plain
 rtl/openbsd/unixsock.inc svneol=native#text/plain
 rtl/openbsd/unixsysc.inc svneol=native#text/plain
+rtl/openbsd/unxconst.inc svneol=native#text/plain
+rtl/openbsd/unxfunc.inc svneol=native#text/plain
 rtl/openbsd/unxsockh.inc svneol=native#text/plain
+rtl/openbsd/unxsysc.inc svneol=native#text/plain
 rtl/os2/Makefile svneol=native#text/plain
 rtl/os2/Makefile.fpc svneol=native#text/plain
 rtl/os2/classes.pp svneol=native#text/plain

+ 1 - 1
compiler/systems/i_bsd.pas

@@ -276,7 +276,7 @@ unit i_bsd;
             sharedClibprefix : 'lib';
             importlibprefix : 'libimp';
             importlibext : '.a';
-            Cprefix      : '_';
+            Cprefix      : '';
             newline      : #10;
             dirsep       : '/';
             assem        : as_gas;

+ 13 - 4
packages/fv/src/platform.inc

@@ -95,6 +95,9 @@
  FREEBSD  OS_FREEBSD  FPC      PPC_FPC      PROC_Protected  BIT_64  ASM_FPC
           OS_UNIX
 
+ OPENBSD  OS_OPENBSD  FPC      PPC_FPC      PROC_Protected  BIT_32  ASM_FPC
+          OS_UNIX
+
  NETBSD   OS_NETBSD   FPC      PPC_FPC      PROC_Protected  BIT_32  ASM_FPC
           OS_UNIX
 
@@ -134,8 +137,9 @@ FOR FPC THESE ARE THE TRANSLATIONS
  WIN32    OS_WINDOWS           FPC     32-bit           AT&T         ----
 
  LINUX    OS_LINUX,OS_UNIX     FPC     32-bit           AT&T         ----
- FREEBSD  OS_NETBSD,OS_UNIX    FPC     32-bit           AT&T         ----
- NETBSD   OS_FREEBSD,OS_UNIX   FPC     32-bit           AT&T         ----
+ FREEBSD  OS_FREEBSD,OS_UNIX   FPC     32-bit           AT&T         ----
+ OPENBSD  OS_OPENBSD,OS_UNIX   FPC     32-bit           AT&T         ----
+ NETBSD   OS_NETBSD,OS_UNIX    FPC     32-bit           AT&T         ----
 
  OS2      OS_OS2               FPC     ?????            AT&T         CPU86
 
@@ -191,8 +195,7 @@ FOR FPC THESE ARE THE TRANSLATIONS
 {$IFDEF LINUX}
   {$UNDEF OS_DOS}
   {$DEFINE OS_LINUX}
-  {$DEFINE OS_UNIX}
-{$ENDIF}
+  {$DEFINE OS_UNIX}{$ENDIF}
 
 {$IFDEF FreeBSD}
   {$UNDEF OS_DOS}
@@ -200,6 +203,12 @@ FOR FPC THESE ARE THE TRANSLATIONS
   {$DEFINE OS_UNIX}
 {$ENDIF}
 
+{$IFDEF OPENBSD}
+  {$UNDEF OS_DOS}
+  {$DEFINE OS_OPENBSD}
+  {$DEFINE OS_UNIX}
+{$ENDIF}
+
 {$IFDEF NETBSD}
   {$UNDEF OS_DOS}
   {$DEFINE OS_NETBSD}

+ 159 - 137
rtl/openbsd/Makefile

@@ -296,7 +296,7 @@ BSDINC=$(RTL)/bsd
 BSDPROCINC=$(BSDINC)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
 UNITPREFIX=rtl
-TARGETPROCINC=$(RTL)/netbsd/$(CPU_TARGET)
+TARGETPROCINC=$(RTL)/openbsd/$(CPU_TARGET)
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 SYSTEMUNIT=system
 LINUXUNIT=
@@ -316,193 +316,193 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres    mmx cpu
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio    mmx cpu
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unix initc systhrds dos crt objects printer matrix sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets gpm ipc terminfo video mouse keyboard  serial variants types systhrds sysctl sysconst fpintres
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc dos crt objects printer matrix rtlconsts sysutils fgl classes fmtbcd typinfo math varutils charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets ipc terminfo dateutils strutils video mouse keyboard  serial variants types sysctl sysconst fpintres convutils stdconvs dynlibs cwstring cmem dl termio
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_IMPLICITUNITS+=exeinfo
@@ -883,193 +883,193 @@ ifeq ($(FULL_TARGET),mipsel-linux)
 override TARGET_LOADERS+=prt0 cprt0
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_RSTS+=math varutils typinfo variants classes sysconst
+override TARGET_RSTS+=math varutils typinfo variants classes sysconst dateutils
 endif
 override INSTALL_FPCPACKAGE=y y
 ifeq ($(FULL_TARGET),i386-linux)
@@ -2601,17 +2601,21 @@ $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc systypes.inc sy
 	$(COMPILER) -Us -Sg $(BSDINC)/$(SYSTEMUNIT).pp
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
 		   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
 		   $(SYSTEMUNIT)$(PPUEXT)
-baseunix$(PPUEXT) : errno.inc $(BSDINC)/bunxtype.inc ptypes.inc $(BSDINC)/ctypes.inc \
-  signal.inc $(UNIXINC)/bunxh.inc $(BSDINC)/bunxmain.inc $(BSDINC)/ostypes.inc \
-  $(BSDINC)/bunxfunc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
-  $(BSDINC)/ostypes.inc $(BSDINC)/ossysch.inc $(BSDINC)/bunxmacr.inc $(UNIXINC)/gensigset.inc \
-  $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
+unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
+baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
+  signal.inc $(UNIXINC)/bunxh.inc \
+  $(BSDINC)/bunxsysc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
+  $(BSDINC)/ostypes.inc $(BSDINC)/osmacro.inc $(UNIXINC)/gensigset.inc \
+  $(UNIXINC)/genfuncs.inc sysctl$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
-		 syscalls.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc \
-		 unixsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+		 unxconst.inc $(UNIXINC)/timezone.inc \
+		 unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
 	       unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
@@ -2625,6 +2629,8 @@ classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
 	$(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
 fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/fgl.pp
+rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
+	$(COMPILER) $(OBJPASDIR)/rtlconsts.pp
 typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
 	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
 math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
@@ -2634,10 +2640,24 @@ gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
 varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
 		    $(OBJPASDIR)/varutilh.inc varutils.pp
 	$(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
+strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/strutils.pp
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+	$(COMPILER) -Fi$(INC) $(INC)/variants.pp
 fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/fmtbcd.pp
 types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/types.pp
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/convutils.pp
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/stdconvs.pp
+dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)
 macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 	$(COMPILER) $(INC)/macpas.pp $(REDIR)
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
@@ -2655,10 +2675,12 @@ errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 ipc$(PPUEXT) : $(UNIXINC)/ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
 callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
-sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT)
+sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT) syscall$(PPUEXT) unixtype$(PPUEXT)
 syscall$(PPUEXT) : $(UNIXINC)/syscall.pp
 sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/sysconst.pp
-cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp systhrds$(PPUEXT)
+cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp
 rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
-	$(COMPILER): $(OBJPASDIR)/rtlconst.pp
+	$(COMPILER) $(OBJPASDIR)/rtlconst.pp
+mouse$(PPUEXT) : $(UNIXINC)/mouse.pp
+	$(COMPILER) -dNOMOUSE $(UNIXINC)/mouse.pp

+ 53 - 19
rtl/openbsd/Makefile.fpc

@@ -11,15 +11,16 @@ fpcpackage=y
 [target]
 loaders=prt0 cprt0
 units=$(SYSTEMUNIT) objpas macpas iso7185 strings syscall baseunix \
-      $(LINUXUNIT) unix initc systhrds \
-      dos crt objects printer matrix \
+      $(LINUXUNIT) unixtype unixutil unix ctypes bsd initc \
+      dos crt objects printer matrix rtlconsts \
       sysutils fgl classes fmtbcd typinfo math varutils \
-       charset ucomplex getopts heaptrc lineinfo lnfodwrf \
-      errors sockets gpm ipc terminfo \
-      video mouse keyboard  serial variants types systhrds sysctl sysconst \
-      fpintres
+      charset ucomplex getopts heaptrc lineinfo lnfodwrf \
+      errors sockets ipc terminfo dateutils strutils \
+      video mouse keyboard  serial variants types sysctl sysconst \
+      fpintres convutils stdconvs dynlibs cwstring cmem dl termio
+
 units_netbsd_i386=mmx cpu
-rsts=math varutils typinfo variants classes sysconst
+rsts=math varutils typinfo variants classes sysconst dateutils
 implicitunits=exeinfo
 
 [require]
@@ -55,7 +56,7 @@ BSDINC=$(RTL)/bsd
 BSDPROCINC=$(BSDINC)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
 UNITPREFIX=rtl
-TARGETPROCINC=$(RTL)/netbsd/$(CPU_TARGET)
+TARGETPROCINC=$(RTL)/openbsd/$(CPU_TARGET)
 
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 SYSTEMUNIT=system
@@ -127,6 +128,9 @@ $(SYSTEMUNIT)$(PPUEXT) : $(BSDINC)/$(SYSTEMUNIT).pp sysconst.inc systypes.inc sy
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
+
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
                    $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
                    $(SYSTEMUNIT)$(PPUEXT)
@@ -135,17 +139,20 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
 # System Dependent Units
 #
 
-baseunix$(PPUEXT) : errno.inc $(BSDINC)/bunxtype.inc ptypes.inc $(BSDINC)/ctypes.inc \
-  signal.inc $(UNIXINC)/bunxh.inc $(BSDINC)/bunxmain.inc $(BSDINC)/ostypes.inc \
-  $(BSDINC)/bunxfunc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
-  $(BSDINC)/ostypes.inc $(BSDINC)/ossysch.inc $(BSDINC)/bunxmacr.inc $(UNIXINC)/gensigset.inc \
-  $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
+unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
+
+baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
+  signal.inc $(UNIXINC)/bunxh.inc \
+  $(BSDINC)/bunxsysc.inc $(BSDPROCINC)/syscallh.inc sysnr.inc \
+  $(BSDINC)/ostypes.inc $(BSDINC)/osmacro.inc $(UNIXINC)/gensigset.inc \
+  $(UNIXINC)/genfuncs.inc sysctl$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
 
 unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
-                 syscalls.inc systypes.inc sysconst.inc $(UNIXINC)/timezone.inc \
-                 unixsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+                 unxconst.inc $(UNIXINC)/timezone.inc \
+                 unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
+linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
 #
 # TP7 Compatible RTL Units
@@ -179,6 +186,9 @@ classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
 fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/fgl.pp
 
+rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
+	$(COMPILER) $(OBJPASDIR)/rtlconsts.pp
+
 typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
         $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
 
@@ -192,12 +202,34 @@ varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
                     $(OBJPASDIR)/varutilh.inc varutils.pp
         $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
 
+strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/strutils.pp
+
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+        $(COMPILER) -Fi$(INC) $(INC)/variants.pp
+
 fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/fmtbcd.pp
-        
+
 types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/types.pp
 
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+
+convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/convutils.pp
+
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/stdconvs.pp
+
+dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)
+
+
 #
 # Mac Pascal Model
 #
@@ -241,15 +273,17 @@ terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
 
 callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
 
-sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT)
+sysctl$(PPUEXT) : $(BSDINC)/sysctl.pp $(SYSTEMUNIT)$(PPUEXT) syscall$(PPUEXT) unixtype$(PPUEXT)
 
 syscall$(PPUEXT) : $(UNIXINC)/syscall.pp
 
 sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/sysconst.pp
 
-cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp systhrds$(PPUEXT)
+cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp
 
 rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
-        $(COMPILER): $(OBJPASDIR)/rtlconst.pp
+        $(COMPILER) $(OBJPASDIR)/rtlconst.pp
 
+mouse$(PPUEXT) : $(UNIXINC)/mouse.pp
+	$(COMPILER) -dNOMOUSE $(UNIXINC)/mouse.pp

+ 48 - 0
rtl/openbsd/check_sys.sh

@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+# Script to test fpc to system syscall numbers
+
+# Location of syscall header in system
+
+syscall_header=/usr/include/sys/syscall.h
+
+verbose=0
+
+# Sustitution made to pass from fpc syscall number
+# to system define 
+fpc_syscall_prefix=syscall_nr_
+syscall_prefix=SYS_
+
+# You should only need to change the varaibles above
+
+sed -n "s:${fpc_syscall_prefix}\\([_a-zA-Z0-9]*\\)[ \t]*=[ \t]*\\([0-9]*\\).*:check_syscall_number ${syscall_prefix}\1 \2:p" sysnr.inc > check_sys_list.sh
+
+function check_syscall_number ()
+{
+  sys=$1
+  value=$2
+  if [ $verbose -ne 0 ] ; then
+    echo Testing $sys value $value
+  fi
+  found=`sed -n "/#define.*${sys}[^A-Za-z0-9_]/p" ${syscall_header}`
+  val=`sed -n "s:#define.*${sys}[^A-Za-z0-9_]*\([0-9]*\).*:\1:p" ${syscall_header}`
+  if [ $verbose -ne 0 ] ; then
+    echo Test for $sys found \"${found}\" \"${value}\" \"${val}\"
+  fi
+  if [ "${val}" == "${value}" ] ; then
+    if [ $verbose -ne 0 ] ; then
+      echo ${sys} value ${val} is correct
+    fi
+  else
+    if [ "${val}" == "" ] ; then
+      found=`sed -n "/#define.*[^A-Za-z0-9_]${value}$/p" ${syscall_header}`
+      if [ "${found}" == "" ] ; then
+        found=`sed -n "s|/\\*.* ${value} is compat|${value} is compat|p" ${syscall_header}`
+      fi
+    fi
+    echo problem for ${sys} expected ${value} line is \"${found}\"
+  fi
+}
+
+source ./check_sys_list.sh
+

+ 1 - 2
rtl/openbsd/classes.pp

@@ -36,8 +36,7 @@ uses
 implementation
 
 uses
-  baseunix,unix,Systhrds
-  ;
+  baseunix,unix;
 
 { OS - independent class implementations are in /inc directory. }
 {$i classes.inc}

+ 2 - 2
rtl/openbsd/errnostr.inc

@@ -114,6 +114,6 @@ const
         'Operation canceled',                  { ECANCELED }
         'Identifier removed',                  { EIDRM }
         'No message of desired type',          { ENOMSG }
-	'Not supported',                       { ENOTSUP }
-//	'Must be equal to largest errno'       { ELAST }
+	'Not supported'                        { ENOTSUP }
+//      'Must be equal to largest errno'       { ELAST }
 );

+ 14 - 0
rtl/openbsd/i386/bsyscall.inc

@@ -0,0 +1,14 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Michael Van Canneyt,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+

+ 6 - 2
rtl/openbsd/i386/cprt0.as

@@ -108,7 +108,7 @@ ___start:
 #	pushl 8(%ebp)
 	finit
 	fwait
-	fldcw __fpucw
+	fldcw ___fpucw
 	xorl  %ebp,%ebp
 	call main
 	pushl %eax
@@ -119,7 +119,7 @@ ___start:
 .type _haltproc,@function
 
 _haltproc:
-           mov $1,%eax 
+           mov $1,%eax
            movzwl U_SYSTEM_EXITCODE,%ebx
            pushl %ebx
            call .Lactualsyscall
@@ -168,3 +168,7 @@ _strrchr:
 	.size	_strrchr , . - _strrchr
 	.comm	environ,4,4
 	.comm	__progname_storage,256,32
+        .comm   operatingsystem_parameter_envp,4,4
+        .comm   operatingsystem_parameter_argc,4,4
+        .comm   operatingsystem_parameter_argv,4,4
+

+ 6 - 2
rtl/openbsd/i386/prt0.as

@@ -108,7 +108,7 @@ ___start:
 #	pushl 8(%ebp)
 	finit
 	fwait
-	fldcw __fpucw
+	fldcw ___fpucw
 	xorl  %ebp,%ebp
 	call main
 #	pushl %eax
@@ -120,7 +120,7 @@ ___start:
 .type _haltproc,@function
 
 _haltproc:
-           mov $1,%eax 
+           mov $1,%eax
            movzwl U_SYSTEM_EXITCODE,%ebx
            pushl %ebx
            call .Lactualsyscall
@@ -169,3 +169,7 @@ _strrchr:
 	.size	_strrchr , . - _strrchr
 	.comm	environ,4,4
 	.comm	__progname_storage,256,32
+        .comm   operatingsystem_parameter_envp,4,4
+        .comm   operatingsystem_parameter_argc,4,4
+        .comm   operatingsystem_parameter_argv,4,4
+

+ 6 - 5
rtl/openbsd/i386/sighnd.inc

@@ -15,11 +15,12 @@
 
 CONST FPU_ALL=$7F;
 
-function getfpustate(const Sigcontext:sigcontextRec):longint; {inline;}
+function getfpustate(sininfo:psiginfo):longint; {inline;}
 begin
-  getfpustate:=0;
+  getfpustate:=sininfo^.si_code;
 end;
-procedure SignalToRunerror(Sig: longint;code:longint; var SigContext: SigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
+
+procedure SignalToRunerror(Sig: longint;sininfo:psiginfo; SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
 
 var
   res,fpustate : word;
@@ -39,7 +40,7 @@ begin
     { this is not allways necessary but I don't know yet
       how to tell if it is or not PM }
           res:=200;
-          fpustate:=GetFPUState(SigContext);
+          fpustate:=GetFPUState(sininfo);
 
           if (FpuState and FPU_All) <> 0 then
             begin
@@ -75,7 +76,7 @@ begin
   if res<>0 then
    begin
 {$ifdef cpui386}
-      HandleErrorAddrFrame(res,pointer(SigContext.sc_eip),pointer(SigContext.sc_ebp));
+      HandleErrorAddrFrame(res,pointer(SigContext^.sc_eip),pointer(SigContext^.sc_ebp));
 {$endif}
    end;
 end;

+ 29 - 0
rtl/openbsd/osdefs.inc

@@ -0,0 +1,29 @@
+{
+    Copyright (c) 2000-2002 by Marco van de Voort
+
+    Target dependent defines used when compiling the baseunix unit
+    Copied over to opensd directory because of
+    missing SigTimedWait syscall
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************}
+
+{$define usedomain}             // Allow uname with "domain" entry.
+                                // (which is a GNU extension)
+{$define hassysctl}             // Use sysctl unit
+
+{ SigTimedWait syscal does not seem to exist for OpenBSD OS }
+{$define FPC_SYS_SIGTIMEDWAIT_UNAVAILABLE}

+ 5 - 4
rtl/openbsd/ptypes.inc

@@ -56,6 +56,7 @@ type
     size_t   = cuint32;         { as definied in the C standard}
     TSize    = size_t;
     pSize    = ^size_t;
+    pSize_t  = ^size_t;
 
     ssize_t  = cint32;          { used by function for returning number of bytes }
     TsSize   = ssize_t;
@@ -154,7 +155,7 @@ type
   ufs_args_rec		= record end;
   mfs_args_rec		= record end;
   nfs_args_rec		= record end;
-  iso_args_rec		= record end;
+  isofs_args_rec       	= record end;
   procfs_args_rec	= record end;
   msdosfs_args_rec	= record end;
   ntfs_args_rec		= record end;
@@ -163,12 +164,12 @@ type
       case byte of
         0: (ufs_args:     ^ufs_args_rec);
         1: (mfs_args:     ^mfs_args_rec);
-	2: (ntfs_args:    ^nfsfs_args_rec);
+	2: (nfs_args:     ^nfs_args_rec);
 	3: (isofs_args:   ^isofs_args_rec);
 	4: (procfs_args:  ^procfs_args_rec);
 	5: (msdosfs_args: ^msdosfs_args_rec);
 	6: (ntfs_args:    ^ntfs_args_rec);
-	7: (__align: array[0..159] of char { 64-bit alignment and room to grow }
+	7: (__align: array[0..159] of char); { 64-bit alignment and room to grow }
     end;
 
 // kernel statfs from mount.h
@@ -226,7 +227,7 @@ const
     SYS_NMLN = 256;                {BSD utsname struct limit}
 
     SIG_MAXSIG      = 33;      	   // highest signal version
-    wordsinsigset   = 4;           // words in sigset_t
+    // set in ostypes.inc wordsinsigset   = 4;           // words in sigset_t
 
   { For getting/setting priority }
    Prio_Process = 0;

+ 40 - 3
rtl/openbsd/signal.inc

@@ -79,6 +79,7 @@ const
 type sigset_t = array[0..3] of cardinal;
 
     PSigContextRec = ^SigContextRec;
+    psigcontext = ^sigcontextrec;
     SigContextRec = record
        sc_mask      : sigset_t;          { signal mask to restore }
        sc_onstack   : longint;              { sigstack state to restore }
@@ -120,10 +121,46 @@ type sigset_t = array[0..3] of cardinal;
        fpr_pad      : array[0..63] of char;
        end;
 
+
+  Sigval = Record
+            Case Boolean OF
+        { Members as suggested by Annex C of POSIX 1003.1b. }
+                false : (sigval_int : Longint);
+                True  : (sigval_ptr : Pointer);
+            End;
+
+
+  PSigInfo   = ^SigInfo_t;
+  PSigInfo_t = ^SigInfo_t;
+  SigInfo_t = record
+                si_signo,                       { signal number }
+                si_errno,                       { errno association }
+        {
+         * Cause of signal, one of the SI_ macros or signal-specific
+         * values, i.e. one of the FPE_... values for SIGFPE. This
+         * value is equivalent to the second argument to an old-style
+         * FreeBSD signal handler.
+         }
+                si_code,                        { signal code }
+                si_pid          : Longint;      { sending process }
+                si_uid          : Cardinal;     { sender's ruid }
+                si_status       : Longint;      { exit value }
+                si_addr         : Pointer;      { faulting instruction }
+                si_value        : SigVal;       { signal value }
+                si_band         : Cardinal;     { band event for SIGPOLL }
+                __spare         : array[0..6] of Longint; { gimme some slack }
+                end;
+  TSigInfo = SigInfo_t;
+  TSigInfo_t = TSigInfo;
+
+
   SignalHandler   = Procedure(Sig : Longint);cdecl;
   PSignalHandler  = ^SignalHandler;
   SignalRestorer  = Procedure;cdecl;
   PSignalRestorer = ^SignalRestorer;
+  sigActionHandler = procedure(Sig: Longint; sininfo:psiginfo; SigContext: PSigContext);cdecl;
+
+
 
 {$ifdef powerpc}
   TSigaction=  procedure(Sig: Longint); cdecl;
@@ -140,9 +177,11 @@ type sigset_t = array[0..3] of cardinal;
   TSigset=sigset_t;
   PSigSet = ^SigSet;
 
+  PSigActionRec = ^SigActionRec;
   SigActionRec = packed record
 //    Handler  : record
-    sa_handler : TSigAction;
+    sa_handler  : sigActionHandler;
+//    sa_handler : TSigAction;
 //      case byte of
 //        0: (Sh: SignalHandler);
 //        1: (Sa: TSigAction);
@@ -151,8 +190,6 @@ type sigset_t = array[0..3] of cardinal;
     Sa_Mask     : SigSet;
   end;
 
-  PSigActionRec = ^SigActionRec;
-
 {
   Change action of process upon receipt of a signal.
   Signum specifies the signal (all except SigKill and SigStop).

+ 51 - 30
rtl/openbsd/sysnr.inc

@@ -15,9 +15,13 @@
 {
  * System call numbers.
  *
- * created from; OpenBSD: syscalls.master,v 1.104 2010/10/28 15:02:41 millert Exp 
+ * created from; OpenBSD: syscalls.master,v 1.104 2010/10/28 15:02:41 millert Exp
  *  (OpenBSD/i386 4.9 release)
 }
+
+{ Append 35 suffix to system call numbers
+  for compatibility to 3.5 versions }
+
 Const
         syscall_nr_syscall      = 0  ;
         syscall_nr_exit         = 1  ;
@@ -27,7 +31,7 @@ Const
         syscall_nr_open         = 5  ;
         syscall_nr_close        = 6  ;
         syscall_nr_wait4        = 7  ;
-        syscall_nr_waitpid      = 8  ;  // added: ease of notation purposes
+        { 8 is marked as compta 43 ocreat  }
         syscall_nr_link         = 9  ;
         syscall_nr_unlink       = 10 ;
         syscall_nr_chdir        = 12 ;
@@ -79,7 +83,7 @@ Const
         syscall_nr_vfork        = 66 ;
         syscall_nr_sbrk         = 69 ;
         syscall_nr_sstk         = 70 ;
-        syscall_nr_vadvise      = 72 ;
+        // syscall nr_vadvise      = 72 ; Seems netbsd specific
         syscall_nr_munmap       = 73 ;
         syscall_nr_mprotect     = 74 ;
         syscall_nr_madvise      = 75 ;
@@ -128,6 +132,16 @@ Const
         syscall_nr_nfssvc       = 155;
         syscall_nr_getfh        = 161;
         syscall_nr_sysarch      = 165;
+        { if defined(SYSVSEM) && !defined(__LP64__)
+          "compat_10_osemsys", }
+        syscall_nr_semsys       = 169;
+        { if defined(SYSVMSG) && !defined(__LP64__)
+          "compat_10_omsgsys", }
+        syscall_nr_msgsys       = 170;
+        { if defined(SYSVSHM) && !defined(__LP64__)
+          "compat_10_oshmsys", }
+        syscall_nr_shmsys       = 170;
+
         syscall_nr_pread        = 173;
         syscall_nr_pwrite       = 174;
         syscall_nr_setgid       = 181;
@@ -137,15 +151,15 @@ Const
         syscall_nr_lfs_markv    = 185;
         syscall_nr_lfs_segclean = 186;
         syscall_nr_lfs_segwait  = 187;
-        syscall_nr_stat         = 188;
-        syscall_nr_fstat        = 189;
-        syscall_nr_lstat        = 190;
+        syscall_nr_stat35       = 188;
+        syscall_nr_fstat35      = 189;
+        syscall_nr_lstat35      = 190;
         syscall_nr_pathconf     = 191;
         syscall_nr_fpathconf    = 192;
         syscall_nr_swapctl      = 193;
         syscall_nr_getrlimit    = 194;
         syscall_nr_setrlimit    = 195;
-        syscall_nr_getdirentries= 196;
+        syscall_nr_getdirentries35 = 196;
         syscall_nr_mmap         = 197;
         syscall_nr___syscall    = 198;
         syscall_nr_lseek        = 199;
@@ -154,18 +168,18 @@ Const
         syscall_nr___sysctl     = 202;
         syscall_nr_mlock        = 203;
         syscall_nr_munlock      = 204;
-        syscall_nr_undelete     = 205;
+        // syscall nr_undelete     = 205; Seems netbsd specific
         syscall_nr_futimes      = 206;
         syscall_nr_getpgid      = 207;
         syscall_nr_xfspioctl    = 208;
         syscall_nr_semget       = 221;
-        syscall_nr_semop        = 222;
+        syscall_nr_semop35      = 222;
         syscall_nr_msgget       = 225;
         syscall_nr_msgsnd       = 226;
         syscall_nr_msgrcv       = 227;
         syscall_nr_shmat        = 228;
         syscall_nr_shmdt        = 230;
-        syscall_nr_shmget       = 231;
+        syscall_nr_shmget35     = 231;
         syscall_nr_clock_gettime= 232;
         syscall_nr_clock_settime= 233;
         syscall_nr_clock_getres = 234;
@@ -177,16 +191,16 @@ Const
         syscall_nr_lchown       = 254;
         syscall_nr_getsid       = 255;
         syscall_nr_msync        = 256;
-        syscall_nr___semctl     = 257;
-        syscall_nr_shmctl       = 258;
-        syscall_nr_msgctl       = 259;
-        syscall_nr_getfsstat    = 260;
-        syscall_nr_statfs       = 261;
-        syscall_nr_fstatfs      = 262;
+        syscall_nr___semctl35   = 257;
+        syscall_nr_shmctl35     = 258;
+        syscall_nr_msgctl35     = 259;
+        // syscall nr_getfsstat35  = 260;
+        // syscall nr_statfs35     = 261;
+        // syscall nr_fstatfs35    = 262;
         syscall_nr_pipe         = 263;
         syscall_nr_fhopen       = 264;
-        syscall_nr_fhstat       = 265;
-        syscall_nr_fhstatfs     = 266;
+        // syscall nr_fhstat35     = 265;
+        // syscall nr_fhstatfs35   = 266;
         syscall_nr_preadv       = 267;
         syscall_nr_pwritev      = 268;
         syscall_nr_kqueue       = 269;
@@ -194,13 +208,14 @@ Const
         syscall_nr_mlockall     = 271;
         syscall_nr_munlockall   = 272;
         syscall_nr_getpeereid   = 273;
-        syscall_nr_extattrctl   = 274;
-        syscall_nr_extattr_set_file     = 275;
-        syscall_nr_extattr_get_file     = 276;
-        syscall_nr_extattr_delete_file  = 277;
-        syscall_nr_extattr_set_fd       = 278;
-        syscall_nr_extattr_get_fd       = 279;
-        syscall_nr_extattr_delete_fd    = 280;
+        // syscall nr_extattrctl   = 274;
+        (* This whole group seems NetBSD specific
+        syscall nr_extattr_set_file     = 275;
+        syscall nr_extattr_get_file     = 276;
+        syscall nr_extattr_delete_file  = 277;
+        syscall nr_extattr_set_fd       = 278;
+        syscall nr_extattr_get_fd       = 279;
+        syscall nr_extattr_delete_fd    = 280; *)
         syscall_nr_getresuid    = 281;
         syscall_nr_setresuid    = 282;
         syscall_nr_getresgid    = 283;
@@ -214,14 +229,14 @@ Const
         syscall_nr_fstat        = 292;
         syscall_nr_lstat        = 293;
         syscall_nr_fhstat       = 294;
-        syscall_nr___semctl     = 294;
-        syscall_nr_shmctl       = 295;
-        syscall_nr_msgctl       = 296;
+        syscall_nr___semctl     = 295;
+        syscall_nr_shmctl       = 296;
+        syscall_nr_msgctl       = 297;
         syscall_nr_sched_yield  = 298;
         syscall_nr_getthrid     = 299;
         syscall_nr_thrsleep     = 300;
         syscall_nr_thrwakeup    = 301;
-        syscall_nr_exit         = 302;
+        syscall_nr_threxit      = 302;
         syscall_nr_thrsigdivert = 303;
         syscall_nr___getcwd     = 304;
         syscall_nr_adjfreq      = 305;
@@ -231,5 +246,11 @@ Const
         syscall_nr_fhstatfs     = 309;
         syscall_nr_setrtable    = 310;
         syscall_nr_getrtable    = 311;
-        syscall_nr_getdirentries        = 312;
+        syscall_nr_getdirentriesi49        = 312;
         syscall_nr_MAXSYSCALL   = 313;
+
+{ Aliases }
+        syscall_nr_getdirentries = syscall_nr_getdirentries35;
+        syscall_nr_waitpid      = syscall_nr_wait4;  // 7, added: ease of notation purposes
+        syscall_nr_getdents = syscall_nr_getdirentries;
+

+ 15 - 6
rtl/openbsd/termios.inc

@@ -60,7 +60,7 @@ type
     c_oflag,
     c_cflag,
     c_lflag  : longint;
-    c_line   : char;
+//    c_line   : char;
     c_cc     : array[0..NCCS-1] of byte;
    {$IFDEF BSD}
     c_ispeed,
@@ -309,11 +309,20 @@ struct winsize {
         TIOCSDRAINWAIT   =IOCTLWRITE+$47400+ 87;        { set ttywait timeout }
         TIOCGDRAINWAIT   =IOCTLREAD+$47400+ 86; { get ttywait timeout }
 
-        TTYDISC          =0;            { termios tty line discipline }
-        SLIPDISC         =4;            { serial IP discipline }
-        PPPDISC          =5;            { PPP discipline }
-        NETGRAPHDISC     =6;            { Netgraph tty node discipline }
-
+        TTYDISC          = 0;            { termios tty line discipline }
+        SLIPDISC         = 4;            { serial IP discipline }
+        PPPDISC          = 5;            { PPP discipline }
+        NETGRAPHDISC     = 6;            { Netgraph tty node discipline }
+
+	FIOCLEX          = IOCTLVOID +$6600+ 1;        { set close on exec on fd }
+ 	FIONCLEX         = IOCTLVOID +$6600+ 2;        { remove close on exec }
+ 	FIONREAD         = IOCTLREAD +$46600+127;     { get # bytes to read }
+ 	FIONBIO          = IOCTLWRITE+$46600+126;     { set/clear non-blocking i/o }
+ 	FIOASYNC         = IOCTLWRITE+$46600+125;     { set/clear async i/o }
+ 	FIOSETOWN        = IOCTLWRITE+$46600+124;     { set owner }
+ 	FIOGETOWN        = IOCTLREAD +$46600+123;     { get owner }  
+ 	FIODTYPE         = IOCTLREAD +$46600+122;     { get d_flags type part }         
+ 	FIOGETLBA        = IOCTLREAD +$46600+121;     { get start blk # }                 
 
 {
  * Defaults on "first" open.

+ 97 - 0
rtl/openbsd/unixsock.inc

@@ -18,6 +18,102 @@
                           Basic Socket Functions
 ******************************************************************************}
 
+function  fpsocket (domain:cint; xtype:cint; protocol: cint):cint;
+Begin
+  fpSocket:=Do_Syscall(syscall_nr_socket,Domain,xtype,Protocol);
+  internal_socketerror:=fpgeterrno;
+End;
+
+function  fpsend (s:cint; msg:pointer; len:size_t; flags:cint):ssize_t;
+begin
+  fpSend:=do_syscall(syscall_nr_sendto,S,TSysParam(msg),Len,Flags,0,0);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpsendto (s:cint; msg:pointer; len:size_t; flags:cint; tox :psockaddr; tolen: tsocklen):ssize_t;
+begin
+  fpSendto:=do_syscall(syscall_nr_sendto,S,TSysParam(msg),Len,Flags,TSysParam(tox),tolen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fprecv (s:cint; buf: pointer; len: size_t; flags:cint):ssize_t;
+begin
+  fpRecv:=do_syscall(syscall_nr_Recvfrom,S,tsysparam(buf),len,flags,0,0);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fprecvfrom (s:cint; buf: pointer; len: size_t; flags: cint; from : psockaddr; fromlen : psocklen):ssize_t;
+begin
+  fpRecvFrom:=do_syscall(syscall_nr_Recvfrom,S,TSysParam(buf),len,flags,TSysParam(from),TSysParam(fromlen));
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpbind (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;
+begin
+  fpBind:=do_syscall(syscall_nr_Bind,S,TSysParam(addrx),addrlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fplisten (s:cint; backlog : cint):cint;
+begin
+  fpListen:=do_syscall(syscall_nr_Listen,S,backlog);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpaccept (s:cint; addrx : psockaddr; addrlen : psocklen):cint;
+begin
+  fpAccept:=do_syscall(syscall_nr_accept,S,TSysParam(addrx),TSysParam(addrlen));
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpconnect (s:cint; name  : psockaddr; namelen : tsocklen):cint;
+begin
+  fpConnect:=do_syscall(syscall_nr_connect,S,TSysParam(name),namelen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpshutdown (s:cint; how:cint):cint;
+begin
+  fpShutDown:=do_syscall(syscall_nr_shutdown,S,how);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpgetsockname (s:cint; name  : psockaddr; namelen : psocklen):cint;
+begin
+  fpGetSockName:=do_syscall(syscall_nr_GetSockName,S,TSysParam(name),TSysParam(namelen));
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpgetpeername (s:cint; name  : psockaddr; namelen : psocklen):cint;
+begin
+  fpGetPeerName:=do_syscall(syscall_nr_GetPeerName,S,TSysParam(name),TSysParam(namelen));
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpsetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen : tsocklen):cint;
+begin
+  fpSetSockOpt:=do_syscall(syscall_nr_SetSockOpt,S,level,optname,TSysParam(optval),optlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpgetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen : psocklen):cint;
+begin
+  fpGetSockOpt:=do_syscall(syscall_nr_GetSockOpt,S,level,TSysParam(optname),TSysParam(optval),TSysParam(optlen));
+  internal_socketerror:=fpgeterrno;
+end;
+
+function  fpsocketpair (d:cint; xtype:cint; protocol:cint; sv:pcint):cint;
+
+begin
+  fpSocketPair:=do_syscall(syscall_nr_SocketPair,d,xtype,protocol,TSysParam(sv));
+  internal_socketerror:=fpgeterrno;
+end;
+
+(*
+{******************************************************************************
+                          Basic Socket Functions
+******************************************************************************}
+
 Function socket(Domain,SocketType,Protocol:Longint):Longint;
 begin
   Socket:=Do_Syscall(syscall_nr_socket,Domain,SocketType,Protocol);
@@ -209,3 +305,4 @@ begin
      Sock2File(Sock,SockIn,SockOut);
 end;
 
+  *)

+ 121 - 0
rtl/openbsd/unxconst.inc

@@ -0,0 +1,121 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Michael Van Canneyt,
+    member of the Free Pascal development team.
+
+    Constants for Unix unit.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+ {
+   Copied from freebsd directory 2011-09-09
+ }
+
+const
+
+  { Things for LSEEK call, OK:OpenBSD sys/unistd.h 4.9 }
+  Seek_set = 0;
+  Seek_Cur = 1;
+  Seek_End = 2;
+
+  { Things for OPEN call - after include/sys/fcntl.h,
+   OK:OpenBSD sys/fcntl.h 4.9
+   BSD specifies these constants in hex }
+  Open_Accmode  = 3;
+  Open_RdOnly   = 0;
+  Open_WrOnly   = 1;
+  Open_RdWr     = 2;
+  Open_NonBlock = 4;
+  Open_Append   = 8;
+  Open_ShLock   = $10;
+  Open_ExLock   = $20;
+  Open_ASync    = $40;
+  Open_FSync    = $80;
+  Open_NoFollow = $100;
+  Open_Create   = $200;       {BSD convention}
+  Open_Creat    = $200;       {Linux convention}
+  Open_Trunc    = $400;
+  Open_Excl     = $800;
+  Open_NoCTTY   = $8000;
+
+  { The waitpid uses the following options:
+   OK:OpenBSD sys/wait.h 4.9 }
+  Wait_NoHang   = 1;
+  Wait_UnTraced = 2;
+  Wait_Any      = -1;
+  Wait_MyPGRP   = 0;
+
+
+  { Constants to check stat.mode -  checked all STAT constants with BSD
+   OK:OpenBSD sys/stat.h 4.9 }
+  STAT_IFMT   = $f000; {00170000 }
+  STAT_IFSOCK = $c000; {0140000 }
+  STAT_IFLNK  = $a000; {0120000 }
+  STAT_IFREG  = $8000; {0100000 }
+  STAT_IFBLK  = $6000; {0060000 }
+  STAT_IFDIR  = $4000; {0040000 }
+  STAT_IFCHR  = $2000; {0020000 }
+  STAT_IFIFO  = $1000; {0010000 }
+  STAT_ISUID  = $0800; {0004000 }
+  STAT_ISGID  = $0400; {0002000 }
+  STAT_ISVTX  = $0200; {0001000}
+  { Constants to check permissions all }
+  STAT_IRWXO = $7;
+  STAT_IROTH = $4;
+  STAT_IWOTH = $2;
+  STAT_IXOTH = $1;
+
+  STAT_IRWXG = STAT_IRWXO shl 3;
+  STAT_IRGRP = STAT_IROTH shl 3;
+  STAT_IWGRP = STAT_IWOTH shl 3;
+  STAT_IXGRP = STAT_IXOTH shl 3;
+
+  STAT_IRWXU = STAT_IRWXO shl 6;
+  STAT_IRUSR = STAT_IROTH shl 6;
+  STAT_IWUSR = STAT_IWOTH shl 6;
+  STAT_IXUSR = STAT_IXOTH shl 6;
+
+  { Not checked below for OpenBSD 4.9 }
+
+  { Constants to test the type of filesystem }
+  fs_old_ext2 = $ef51;
+  fs_ext2     = $ef53;
+  fs_ext      = $137d;
+  fs_iso      = $9660;
+  fs_minix    = $137f;
+  fs_minix_30 = $138f;
+  fs_minux_V2 = $2468;
+  fs_msdos    = $4d44;
+  fs_nfs      = $6969;
+  fs_proc     = $9fa0;
+  fs_xia      = $012FD16D;
+
+  {Constansts Termios/Ioctl (used in Do_IsDevice) }
+  IOCtl_TCGETS= $40000000+$2C7400+ 19; // TCGETS is also in termios.inc, but the sysunix needs only this
+
+  ITimer_Real    =0;
+  ITimer_Virtual =1;
+  ITimer_Prof    =2;
+
+{
+  {Checked for BSD using Linuxthreads port}
+  { cloning flags }
+  CSIGNAL       = $000000ff; // signal mask to be sent at exit
+  CLONE_VM      = $00000100; // set if VM shared between processes
+  CLONE_FS      = $00000200; // set if fs info shared between processes
+  CLONE_FILES   = $00000400; // set if open files shared between processes
+  CLONE_SIGHAND = $00000800; // set if signal handlers shared
+  CLONE_PID     = $00001000; // set if pid shared
+
+type
+ TCloneFunc=function(args:pointer):longint;cdecl;
+}
+

+ 57 - 0
rtl/openbsd/unxfunc.inc

@@ -0,0 +1,57 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2000 by Marco van de Voort
+     member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+{$ifndef HAS_LIBC_PIPING}
+Function PClose(Var F:file) : cint;
+var
+  pl : ^cint;
+  res : cint;
+
+begin
+  fpclose(filerec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(filerec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
+
+Function PClose(Var F:text) :cint;
+var
+  pl  : ^longint;
+  res : longint;
+
+begin
+  fpclose(Textrec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(textrec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
+{$ENDIF}
+
+
+Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_ASSIGNPIPE'];
+{
+  Sets up a pair of file variables, which act as a pipe. The first one can
+  be read from, the second one can be written to.
+  If the operation was unsuccesful, errno is set.
+}
+var
+  pip  : tfildes;
+begin
+  assignPipe:=fppipe(pip);
+  pipe_in:=pip[0];
+  pipe_out:=pip[1];
+end;
+

+ 321 - 110
rtl/openbsd/unxsockh.inc

@@ -1,83 +1,72 @@
+{
+   This file is part of the Free Pascal run time library.
+   (c) 2000-2003 by Marco van de Voort
+   member of the Free Pascal development team.
 
-const
-  {
-   * Address families.
-    }
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
-  { unspecified  }
-     AF_UNSPEC = 0;
-  { local to host (pipes, portals)  }
-     AF_LOCAL = 1;
-  { backward compatibility  }
-     AF_UNIX = AF_LOCAL;
-  { internetwork: UDP, TCP, etc.  }
-     AF_INET = 2;
-  { arpanet imp addresses  }
-     AF_IMPLINK = 3;
-  { pup protocols: e.g. BSP  }
-     AF_PUP = 4;
-  { mit CHAOS protocols  }
-     AF_CHAOS = 5;
-  { XEROX NS protocols  }
-     AF_NS = 6;
-  { ISO protocols  }
-     AF_ISO = 7;
-     AF_OSI = AF_ISO;
-  { european computer manufacturers  }
-     AF_ECMA = 8;
-  { datakit protocols  }
-     AF_DATAKIT = 9;
-  { CCITT protocols, X.25 etc  }
-     AF_CCITT = 10;
-  { IBM SNA  }
-     AF_SNA = 11;
-  { DECnet  }
-     AF_DECnet = 12;
-  { DEC Direct data link interface  }
-     AF_DLI = 13;
-  { LAT  }
-     AF_LAT = 14;
-  { NSC Hyperchannel  }
-     AF_HYLINK = 15;
-  { Apple Talk  }
-     AF_APPLETALK = 16;
-  { Internal Routing Protocol  }
-     AF_ROUTE = 17;
-  { Link layer interface  }
-     AF_LINK = 18;
-  { eXpress Transfer Protocol (no AF)  }
-     pseudo_AF_XTP = 19;
-  { connection-oriented IP, aka ST II  }
-     AF_COIP = 20;
-  { Computer Network Technology  }
-     AF_CNT = 21;
-  { Help Identify RTIP packets  }
-     pseudo_AF_RTIP = 22;
-  { Novell Internet Protocol  }
-     AF_IPX = 23;
-  { IPv6  }
-     AF_INET6 = 24;
-  { Help Identify PIP packets  }
-     pseudo_AF_PIP = 25;
-  { Integrated Services Digital Network }
-     AF_ISDN = 26;
-  { CCITT E.164 recommendation  }
-     AF_E164 = AF_ISDN;
-  { native ATM access  }
-     AF_NATM = 27;
-     AF_ENCAP = 28;
-  { Simple Internet Protocol  }
-     AF_SIP = 29;
-     AF_KEY = 30;
-  { Used by BPF to not rewrite headers
-  					   in interface output routine  }
-     pseudo_AF_HDRCMPLT = 31;
-  { Bluetooth  }
-     AF_BLUETOOTH = 32;
-     AF_MAX = 33;
+   OS dependant part of the header.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+Const
+{*
+ * Address families.
+ *}
+  AF_UNSPEC        = 0;		{ unspecified }
+  AF_UNIX          = 1;		{ standardized name for AF_LOCAL }
+  AF_LOCAL         = AF_UNIX;	{ local to host (pipes, portals) }
+  AF_INET          = 2;		{ internetwork: UDP, TCP, etc. }
+  AF_IMPLINK       = 3;		{ arpanet imp addresses }
+  AF_PUP           = 4;		{ pup protocols: e.g. BSP }
+  AF_CHAOS         = 5;		{ mit CHAOS protocols }
+  AF_NETBIOS       = 6;		{ SMB protocols }
+  AF_ISO           = 7;		{ ISO protocols }
+  AF_OSI           = AF_ISO;
+  AF_ECMA          = 8;		{ European computer manufacturers }
+  AF_DATAKIT       = 9;		{ datakit protocols }
+  AF_CCITT         = 10;	{ CCITT protocols, X.25 etc }
+  AF_SNA           = 11;	{ IBM SNA }
+  AF_DECnet        = 12;	{ DECnet }
+  AF_DLI           = 13;	{ DEC Direct data link interface }
+  AF_LAT           = 14;	{ LAT }
+  AF_HYLINK        = 15;	{ NSC Hyperchannel }
+  AF_APPLETALK     = 16;	{ Apple Talk }
+  AF_ROUTE         = 17;	{ Internal Routing Protocol }
+  AF_LINK          = 18;	{ Link layer interface }
+  pseudo_AF_XTP    = 19;	{ eXpress Transfer Protocol (no AF) }
+  AF_COIP          = 20;	{ connection-oriented IP, aka ST II }
+  AF_CNT           = 21;	{ Computer Network Technology }
+  pseudo_AF_RTIP   = 22;	{ Help Identify RTIP packets }
+  AF_IPX           = 23;	{ Novell Internet Protocol }
+  AF_SIP           = 24;	{ Simple Internet Protocol }
+  pseudo_AF_PIP    = 25;	{ Help Identify PIP packets }
+  AF_ISDN          = 26;	{ Integrated Services Digital Network}
+  AF_E164          = AF_ISDN;	{ CCITT E.164 recommendation }
+  pseudo_AF_KEY    = 27;	{ Internal key-management function }
+  AF_INET6         = 28;	{ IPv6 }
+  AF_NATM          = 29;	{ native ATM access }
+  AF_ATM           = 30;	{ ATM }
+  pseudo_AF_HDRCMPLT = 31;	{ Used by BPF to not rewrite headers
+					 * in interface output routine
+                                         }
+  AF_NETGRAPH      = 32;	{ Netgraph sockets }
+  AF_SLOW          = 33;	{ 802.3ad slow protocol }
+  AF_SCLUSTER      = 34;	{ Sitara cluster protocol }
+  AF_ARP           = 35;
+  AF_BLUETOOTH     = 36;	{ Bluetooth sockets }
+  AF_IEEE80211     = 37;	{ IEEE 802.11 protocol }
+  AF_MAX           = 38;
+  
   {
    * Protocol families, same as address families for now.
     }
+
+  const
      PF_UNSPEC = AF_UNSPEC;
      PF_LOCAL = AF_LOCAL;
   { backward compatibility  }
@@ -86,7 +75,7 @@ const
      PF_IMPLINK = AF_IMPLINK;
      PF_PUP = AF_PUP;
      PF_CHAOS = AF_CHAOS;
-     PF_NS = AF_NS;
+     PF_NETBIOS = AF_NETBIOS;
      PF_ISO = AF_ISO;
      PF_OSI = AF_ISO;
      PF_ECMA = AF_ECMA;
@@ -104,51 +93,273 @@ const
      PF_XTP = pseudo_AF_XTP;
      PF_COIP = AF_COIP;
      PF_CNT = AF_CNT;
-  { same format as AF_NS  }
+     PF_SIP = AF_SIP;
      PF_IPX = AF_IPX;
-     PF_INET6 = AF_INET6;
   { same format as AF_INET  }
      PF_RTIP = pseudo_AF_RTIP;
      PF_PIP = pseudo_AF_PIP;
      PF_ISDN = AF_ISDN;
+     PF_KEY = pseudo_AF_KEY;
+     PF_INET6 = AF_INET6;
      PF_NATM = AF_NATM;
-     PF_ENCAP = AF_ENCAP;
-     PF_SIP = AF_SIP;
-     PF_KEY = AF_KEY;
-     PF_BPF = pseudo_AF_HDRCMPLT;
+     PF_ATM = AF_ATM;
+     PF_NETGRAPH = AF_NETGRAPH;
+     PF_SLOW = AF_SLOW;
+     PF_SCLUSTER = AF_SCLUSTER;
+     PF_ARP = AF_ARP;
      PF_BLUETOOTH = AF_BLUETOOTH;
      PF_MAX = AF_MAX;
-     
-     MSG_OOB = $1;
-  { peek at incoming message  }
-     MSG_PEEK = $2;
-  { send without using routing tables  }
-     MSG_DONTROUTE = $4;
-  { data completes record  }
-     MSG_EOR = $8;
-  { data discarded before delivery  }
-     MSG_TRUNC = $10;
-  { control data lost before delivery  }
-     MSG_CTRUNC = $20;
-  { wait for full request or error  }
-     MSG_WAITALL = $40;
-  { this message should be nonblocking  }
-     MSG_DONTWAIT = $80;
-  { this message rec'd as broadcast  }
-     MSG_BCAST = $100;
-  { this message rec'd as multicast  }
-     MSG_MCAST = $200;
-     
-     TCP_NODELAY = $01;
-  { set maximum segment size  }
-     TCP_MAXSEG = $02;
-  { enable TCP MD5 signature option  }
-     TCP_MD5SIG = $04;
-  { enable SACKs (if disabled by def.)  }
-     TCP_SACK_ENABLE = $08;
+
+
+  SOCK_PACKET     = 10;
+
+
+{ Maximum queue length specifiable by listen.  }
+  SOMAXCONN     = 128;
+
+        SOL_SOCKET 	 = $FFFF;
+        SO_DEBUG         = $0001;        { turn on debugging info recording }
+        SO_ACCEPTCONN    = $0002;        { socket has had listen() }
+        SO_REUSEADDR     = $0004;        { allow local address reuse }
+        SO_KEEPALIVE     = $0008;        { keep connections alive }
+        SO_DONTROUTE     = $0010;        { just use interface addresses }
+        SO_BROADCAST     = $0020;        { permit sending of broadcast msgs }
+        SO_USELOOPBACK   = $0040;        { bypass hardware when possible }
+        SO_LINGER        = $0080;        { linger on close if data present }
+        SO_OOBINLINE     = $0100;        { leave received OOB data in line }
+        SO_REUSEPORT     = $0200;        { allow local address & port reuse }
+        SO_TIMESTAMP     = $0400;        { timestamp received dgram traffic }
+
+{
+ * Additional options, not kept in so_options.
+ }
+        SO_SNDBUF        =$1001;        { send buffer size }
+        SO_RCVBUF        =$1002;        { receive buffer size }
+        SO_SNDLOWAT      =$1003;        { send low-water mark }
+        SO_RCVLOWAT      =$1004;        { receive low-water mark }
+        SO_SNDTIMEO      =$1005;        { send timeout }
+        SO_RCVTIMEO      =$1006;        { receive timeout }
+        SO_ERROR         =$1007;        { get error status and clear }
+        SO_TYPE          =$1008;        { get socket type }
+
 
         SHUT_RD         =0;             { shut down the reading side }
         SHUT_WR         =1;             { shut down the writing side }
         SHUT_RDWR       =2;             { shut down both sides }
 
+	IPPROTO_IP              = 0;               { dummy for IP }
+	IPPROTO_ICMP            = 1;               { control message protocol }
+	IPPROTO_TCP             = 6;               { tcp }
+	IPPROTO_UDP             = 17;              { user datagram protocol }
+
+
+	IPPROTO_HOPOPTS		= 0 ; 		{ IP6 hop-by-hop options }
+	IPPROTO_IGMP		= 2 ; 		{ group mgmt protocol }
+	IPPROTO_GGP		= 3 ; 		{ gateway^2 (deprecated) }
+	IPPROTO_IPV4		= 4 ; 		{ IPv4 encapsulation }
+	IPPROTO_IPIP		= IPPROTO_IPV4;	{ for compatibility }
+	IPPROTO_ST		= 7 ; 		{ Stream protocol II }
+	IPPROTO_EGP		= 8 ; 		{ exterior gateway protocol }
+	IPPROTO_PIGP		= 9 ; 		{ private interior gateway }
+	IPPROTO_RCCMON		= 10; 		{ BBN RCC Monitoring }
+	IPPROTO_NVPII		= 11; 		{ network voice protocol}
+	IPPROTO_PUP		= 12; 		{ pup }
+	IPPROTO_ARGUS		= 13; 		{ Argus }
+	IPPROTO_EMCON		= 14; 		{ EMCON }
+	IPPROTO_XNET		= 15; 		{ Cross Net Debugger }
+	IPPROTO_CHAOS		= 16; 		{ Chaos}
+	IPPROTO_MUX		= 18; 		{ Multiplexing }
+	IPPROTO_MEAS		= 19; 		{ DCN Measurement Subsystems }
+	IPPROTO_HMP		= 20; 		{ Host Monitoring }
+	IPPROTO_PRM		= 21; 		{ Packet Radio Measurement }
+	IPPROTO_IDP		= 22; 		{ xns idp }
+	IPPROTO_TRUNK1		= 23; 		{ Trunk-1 }
+	IPPROTO_TRUNK2		= 24; 		{ Trunk-2 }
+	IPPROTO_LEAF1		= 25; 		{ Leaf-1 }
+	IPPROTO_LEAF2		= 26; 		{ Leaf-2 }
+	IPPROTO_RDP		= 27; 		{ Reliable Data }
+	IPPROTO_IRTP		= 28; 		{ Reliable Transaction }
+	IPPROTO_TP		= 29; 		{ tp-4 w/ class negotiation }
+	IPPROTO_BLT		= 30; 		{ Bulk Data Transfer }
+	IPPROTO_NSP		= 31; 		{ Network Services }
+	IPPROTO_INP		= 32; 		{ Merit Internodal }
+	IPPROTO_SEP		= 33; 		{ Sequential Exchange }
+	IPPROTO_3PC		= 34; 		{ Third Party Connect }
+	IPPROTO_IDPR		= 35; 		{ InterDomain Policy Routing }
+	IPPROTO_XTP		= 36; 		{ XTP }
+	IPPROTO_DDP		= 37; 		{ Datagram Delivery }
+	IPPROTO_CMTP		= 38; 		{ Control Message Transport }
+	IPPROTO_TPXX		= 39; 		{ TP++ Transport }
+	IPPROTO_IL		= 40; 		{ IL transport protocol }
+	IPPROTO_IPV6		= 41; 		{ IP6 header }
+	IPPROTO_SDRP		= 42; 		{ Source Demand Routing }
+	IPPROTO_ROUTING		= 43; 		{ IP6 routing header }
+	IPPROTO_FRAGMENT	= 44; 		{ IP6 fragmentation header }
+	IPPROTO_IDRP		= 45; 		{ InterDomain Routing}
+	IPPROTO_RSVP		= 46; 		{ resource reservation }
+	IPPROTO_GRE		= 47; 		{ General Routing Encap. }
+	IPPROTO_MHRP		= 48; 		{ Mobile Host Routing }
+	IPPROTO_BHA		= 49; 		{ BHA }
+	IPPROTO_ESP		= 50; 		{ IP6 Encap Sec. Payload }
+	IPPROTO_AH		= 51; 		{ IP6 Auth Header }
+	IPPROTO_INLSP		= 52; 		{ Integ. Net Layer Security }
+	IPPROTO_SWIPE		= 53; 		{ IP with encryption }
+	IPPROTO_NHRP		= 54; 		{ Next Hop Resolution }
+	IPPROTO_MOBILE		= 55; 		{ IP Mobility }
+	IPPROTO_TLSP		= 56; 		{ Transport Layer Security }
+	IPPROTO_SKIP		= 57; 		{ SKIP }
+	IPPROTO_ICMPV6		= 58; 		{ ICMP6 }
+	IPPROTO_NONE		= 59; 		{ IP6 no next header }
+	IPPROTO_DSTOPTS		= 60; 		{ IP6 destination option }
+	IPPROTO_AHIP		= 61; 		{ any host internal protocol }
+	IPPROTO_CFTP		= 62; 		{ CFTP }
+	IPPROTO_HELLO		= 63; 		{ "hello" routing protocol }
+	IPPROTO_SATEXPAK	= 64; 		{ SATNET/Backroom EXPAK }
+	IPPROTO_KRYPTOLAN	= 65; 		{ Kryptolan }
+	IPPROTO_RVD		= 66; 		{ Remote Virtual Disk }
+	IPPROTO_IPPC		= 67; 		{ Pluribus Packet Core }
+	IPPROTO_ADFS		= 68; 		{ Any distributed FS }
+	IPPROTO_SATMON		= 69; 		{ Satnet Monitoring }
+	IPPROTO_VISA		= 70; 		{ VISA Protocol }
+	IPPROTO_IPCV		= 71; 		{ Packet Core Utility }
+	IPPROTO_CPNX		= 72; 		{ Comp. Prot. Net. Executive }
+	IPPROTO_CPHB		= 73; 		{ Comp. Prot. HeartBeat }
+	IPPROTO_WSN		= 74; 		{ Wang Span Network }
+	IPPROTO_PVP		= 75; 		{ Packet Video Protocol }
+	IPPROTO_BRSATMON	= 76; 		{ BackRoom SATNET Monitoring }
+	IPPROTO_ND		= 77; 		{ Sun net disk proto (temp.) }
+	IPPROTO_WBMON		= 78; 		{ WIDEBAND Monitoring }
+	IPPROTO_WBEXPAK		= 79; 		{ WIDEBAND EXPAK }
+	IPPROTO_EON		= 80; 		{ ISO cnlp }
+	IPPROTO_VMTP		= 81; 		{ VMTP }
+	IPPROTO_SVMTP		= 82; 		{ Secure VMTP }
+	IPPROTO_VINES		= 83; 		{ Banyon VINES }
+	IPPROTO_TTP		= 84; 		{ TTP }
+	IPPROTO_IGP		= 85; 		{ NSFNET-IGP }
+	IPPROTO_DGP		= 86; 		{ dissimilar gateway prot. }
+	IPPROTO_TCF		= 87; 		{ TCF }
+	IPPROTO_IGRP		= 88; 		{ Cisco/GXS IGRP }
+	IPPROTO_OSPFIGP		= 89; 		{ OSPFIGP }
+	IPPROTO_SRPC		= 90; 		{ Strite RPC protocol }
+	IPPROTO_LARP		= 91; 		{ Locus Address Resoloution }
+	IPPROTO_MTP		= 92; 		{ Multicast Transport }
+	IPPROTO_AX25		= 93; 		{ AX.25 Frames }
+	IPPROTO_IPEIP		= 94; 		{ IP encapsulated in IP }
+	IPPROTO_MICP		= 95; 		{ Mobile Int.ing control }
+	IPPROTO_SCCSP		= 96; 		{ Semaphore Comm. security }
+	IPPROTO_ETHERIP		= 97; 		{ Ethernet IP encapsulation }
+	IPPROTO_ENCAP		= 98; 		{ encapsulation header }
+	IPPROTO_APES		= 99; 		{ any private encr. scheme }
+	IPPROTO_GMTP		= 100;		{ GMTP}
+	IPPROTO_IPCOMP		= 108;		{ payload compression (IPComp) }
+{ 101-254: Partly Unassigned }
+	IPPROTO_PIM		= 103;		{ Protocol Independent Mcast }
+	IPPROTO_CARP		= 112;		{ CARP }
+	IPPROTO_PGM		= 113;		{ PGM }
+	IPPROTO_PFSYNC		= 240;		{ PFSYNC }
+
+{ last return value of *_input(), meaning "all job for this pkt is done".  }
+	IPPROTO_RAW             = 255;
+	IPPROTO_MAX		= 256;
+	IPPROTO_DONE		= 257;
+
+{
+ * Options for use with [gs]etsockopt at the IP level.
+ * First word of comment is data type; bool is stored in int.
+ }
+	IP_OPTIONS		= 1 ;   { buf/ip_opts; set/get IP options }
+	IP_HDRINCL		= 2 ;   { int; header is included with data }
+	IP_TOS			= 3 ;   { int; IP type of service and preced. }
+	IP_TTL			= 4 ;   { int; IP time to live }
+	IP_RECVOPTS		= 5 ;   { bool; receive all IP opts w/dgram }
+	IP_RECVRETOPTS		= 6 ;   { bool; receive IP opts for response }
+	IP_RECVDSTADDR		= 7 ;   { bool; receive IP dst addr w/dgram }
+	IP_SENDSRCADDR		= IP_RECVDSTADDR; { cmsg_type to set src addr }
+	IP_RETOPTS		= 8 ;   { ip_opts; set/get IP options }
+	IP_MULTICAST_IF		= 9 ;   { u_char; set/get IP multicast i/f  }
+	IP_MULTICAST_TTL	= 10;   { u_char; set/get IP multicast ttl }
+	IP_MULTICAST_LOOP	= 11;   { u_char; set/get IP multicast loopback }
+	IP_ADD_MEMBERSHIP	= 12;   { ip_mreq; add an IP group membership }
+	IP_DROP_MEMBERSHIP	= 13;   { ip_mreq; drop an IP group membership }
+	IP_MULTICAST_VIF	= 14;   { set/get IP mcast virt. iface }
+	IP_RSVP_ON		= 15;   { enable RSVP in kernel }
+	IP_RSVP_OFF		= 16;   { disable RSVP in kernel }
+	IP_RSVP_VIF_ON		= 17;   { set RSVP per-vif socket }
+	IP_RSVP_VIF_OFF		= 18;   { unset RSVP per-vif socket }
+	IP_PORTRANGE		= 19;   { int; range to choose for unspec port }
+	IP_RECVIF		= 20;   { bool; receive reception if w/dgram }
+
+{ for IPSEC }
+	IP_IPSEC_POLICY		= 21;   { int; set/get security policy }
+	IP_FAITH		= 22;   { bool; accept FAITH'ed connections }
+
+	IP_ONESBCAST		= 23;   { bool: send all-ones broadcast }
+                                
+	IP_FW_TABLE_ADD		= 40;   { add entry }
+	IP_FW_TABLE_DEL		= 41;   { delete entry }
+	IP_FW_TABLE_FLUSH	= 42;   { flush table }
+	IP_FW_TABLE_GETSIZE	= 43;   { get table size }
+	IP_FW_TABLE_LIST	= 44;   { list table contents }
+
+	IP_FW_ADD		= 50;   { add a firewall rule to chain }
+	IP_FW_DEL		= 51;   { delete a firewall rule from chain }
+	IP_FW_FLUSH		= 52;   { flush firewall rule chain }
+	IP_FW_ZERO		= 53;   { clear single/all firewall counter(s) }
+	IP_FW_GET		= 54;   { get entire firewall rule chain }
+	IP_FW_RESETLOG		= 55;   { reset logging counters }
+
+	IP_DUMMYNET_CONFIGURE	= 60;   { add/configure a dummynet pipe }
+	IP_DUMMYNET_DEL		= 61;   { delete a dummynet pipe from chain }
+	IP_DUMMYNET_FLUSH	= 62;   { flush dummynet }
+	IP_DUMMYNET_GET		= 64;   { get entire dummynet pipes }
+
+	IP_RECVTTL		= 65;   { bool; receive IP TTL w/dgram }
+
+	IPV6_SOCKOPT_RESERVED1	= 3 ; { reserved for future use }
+	IPV6_UNICAST_HOPS	= 4 ; { int; IP6 hops }
+	IPV6_MULTICAST_IF	= 9 ; { u_int; setget IP6 multicast if  }
+	IPV6_MULTICAST_HOPS	= 10; { int; setget IP6 multicast hops }
+	IPV6_MULTICAST_LOOP	= 11; { u_int; setget IP6 multicast loopback }
+	IPV6_JOIN_GROUP		= 12; { ip6_mreq; join a group membership }
+	IPV6_LEAVE_GROUP	= 13; { ip6_mreq; leave a group membership }
+	IPV6_PORTRANGE		= 14; { int; range to choose for unspec port }
+
+	IPV6_PKTINFO            = 46; { in6_pktinfo; send if, src addr }	
+ 	IPV6_HOPLIMIT           = 47; { int; send hop limit }
+ 	IPV6_NEXTHOP            = 48; { sockaddr; next hop addr }
+ 	IPV6_HOPOPTS            = 49; { ip6_hbh; send hop-by-hop option }
+ 	IPV6_DSTOPTS            = 50; { ip6_dest; send dst option befor rthdr }
+ 	IPV6_RTHDR              = 51; { ip6_rthdr; send routing header }
+ 	IPV6_PKTOPTIONS         = 52; { buf/cmsghdr; set/get IPv6 options }
+  
+  { Flags for send, recv etc. }
+  MSG_OOB       = $0001;              { Process out-of-band data}
+  MSG_PEEK      = $0002;              { Peek at incoming messages }
+  MSG_DONTROUTE = $0004;              { Don't use local routing }
+  MSG_EOR       = $0008;              { End of record }
+  MSG_TRUNC     = $0010;
+  MSG_CTRUNC    = $0020;              { Control data lost before delivery }
+  MSG_WAITALL   = $0040;              { Wait for a full request }
+  MSG_DONTWAIT  = $0080;              { Non-blocking I/O }
+  MSG_EOF       = $0100;
+  MSG_NBIO      = $4000;
+  MSG_COMPAT    = $8000;
+  MSG_SOCALLBCK = $10000;
+  MSG_NOSIGNAL  = $20000;              { Do not generate SIGPIPE }
+  
+  INVALID_SOCKET = -1;
+  SOCKET_ERROR = -1;
+  
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { don't push last block of write  }
+     TCP_NOPUSH = $04;
+  { don't use TCP options  }
+     TCP_NOOPT = $08;
+  { use MD5 digests (RFC2385)  }
+     TCP_MD5SIG = $10;
+  { retrieve tcp_info structure  }
+     TCP_INFO = $20;
+
 

+ 91 - 0
rtl/openbsd/unxsysc.inc

@@ -0,0 +1,91 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2003 Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+(*
+function clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint;
+{NOT IMPLEMENTED YET UNDER BSD}
+begin // perhaps it is better to implement the hack from solaris then this msg
+ HALT;
+END;
+
+  if (pointer(func)=nil) or (sp=nil) then
+   begin
+     Lfpseterrno(EsysEInval);
+     exit(-1);
+   end;
+  asm
+        { Insert the argument onto the new stack. }
+        movl    sp,%ecx
+        subl    $8,%ecx
+        movl    args,%eax
+        movl    %eax,4(%ecx)
+
+        { Save the function pointer as the zeroth argument.
+          It will be popped off in the child in the ebx frobbing below. }
+        movl    func,%eax
+        movl    %eax,0(%ecx)
+
+        { Do the system call }
+        pushl   %ebx
+        pushl   %ebx
+      //  movl    flags,%ebx
+        movl    $251,%eax
+        int     $0x80
+        popl    %ebx
+        popl    %ebx
+        test    %eax,%eax
+        jnz     .Lclone_end
+
+        { We're in the new thread }
+        subl    %ebp,%ebp       { terminate the stack frame }
+        call    *%ebx
+        { exit process }
+        movl    %eax,%ebx
+        movl    $1,%eax
+        int     $0x80
+
+.Lclone_end:
+        movl    %eax,__RESULT
+  end;
+end;
+*)
+
+Function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
+begin
+  fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
+end;
+
+Function  fpStatFS  (Path:pchar; Info:pstatfs):cint;
+
+begin
+  fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
+end;
+
+Function  fpfsync (fd : cint) : cint;
+
+begin
+  fpfsync:=do_SysCall(syscall_nr_fsync, fd);
+end;
+
+Function  fpFlock (fd,mode : longint) : cint;
+
+begin
+ fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
+end;
+
+function MUnMap (P : Pointer; Size : size_t) : cint;
+begin
+  MUnMap:=do_syscall(syscall_nr_munmap,TSysParam(P),Size);
+end;
+