DEADSOFTWARE

synchronized with https://github.com/aixp/BlackBox
authorAlexander Shiryaev <aixp@mail.ru>
Mon, 14 Nov 2016 03:40:35 +0000 (06:40 +0300)
committerAlexander Shiryaev <aixp@mail.ru>
Mon, 14 Nov 2016 03:40:35 +0000 (06:40 +0300)
131 files changed:
BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc [new file with mode: 0644]
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ [moved from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ with 55% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ [moved from BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Rsrc/Mod/gen-Libc/Libc.txt.templ with 94% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ [new file with mode: 0644]
BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c [new file with mode: 0644]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Build-Tool.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Build-Tool.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Docu/ObjectHierarchy.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Keysyms.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Gtk2/Mod/Util.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Gtk2/Mod/Util.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/CFrames.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/CFrames.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Clipboard.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Clipboard.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Cmds.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Cmds.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Dialog.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Dialog.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Fonts.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Fonts.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Mechanisms.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Menus.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Menus.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Ports.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Ports.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Registry.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Registry.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/TabFrames.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/TabFrames.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/Host/Mod/Windows.odc [moved from BlackBox/_LinuxOpenBSD_GUI/Host/Mod/Windows.odc with 100% similarity]
BlackBox/_FreeBSDLinuxOpenBSD_GUI/build [moved from BlackBox/_LinuxOpenBSD_GUI/build with 100% similarity]
BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc [deleted file]
BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile [moved from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile with 65% similarity]
BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c [moved from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/mkioctl.c with 100% similarity]
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GLib.odc [moved from BlackBox/_OpenBSD_GUI/Gtk2/Mod/GLib.odc with 100% similarity]
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/GObject.odc [moved from BlackBox/_OpenBSD_GUI/Gtk2/Mod/GObject.odc with 100% similarity]
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gdk.odc [moved from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gdk.odc with 100% similarity]
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Gtk.odc [moved from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Gtk.odc with 100% similarity]
BlackBox/_FreeBSDOpenBSD_GUI/Gtk2/Mod/Pango.odc [moved from BlackBox/_OpenBSD_GUI/Gtk2/Mod/Pango.odc with 100% similarity]
BlackBox/_FreeBSD_/BlackBox1.run [new file with mode: 0755]
BlackBox/_FreeBSD_/Comm/Mod/TCP.odc [new file with mode: 0644]
BlackBox/_FreeBSD_/Host/Mod/Files.odc
BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/Libc.txt
BlackBox/_FreeBSD_/Lin/Mod/Net.txt [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py [new symlink]
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py [new symlink]
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/Makefile
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/custom
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/osname
BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/sizeofs.c
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py [new symlink]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname [new file with mode: 0644]
BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py [new symlink]
BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader
BlackBox/_FreeBSD_/System/Mod/Kernel.odc
BlackBox/_FreeBSD_/libBB.so
BlackBox/_FreeBSD_/libBB0.so
BlackBox/_Linux_/Comm/Mod/TCP.odc
BlackBox/_Linux_/Lin/Mod/Ioctl.txt
BlackBox/_Linux_/Lin/Mod/Libc.odc
BlackBox/_Linux_/Lin/Mod/Libc.txt
BlackBox/_Linux_/Lin/Mod/Net.txt
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/Makefile
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/Makefile
BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ [deleted file]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb [deleted file]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-proto [moved from BlackBox/_Linux_/Lin/Mod/gen-Net/defs-in with 100% similarity]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/defs-sock
BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c [deleted symlink]
BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/libver [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/machine [new file with mode: 0644]
BlackBox/_Linux_/Lin/Mod/gen-Net/osname [new file with mode: 0644]
BlackBox/_OpenBSD_/BlackBox1.run [new file with mode: 0755]
BlackBox/_OpenBSD_/Comm/Mod/TCP.odc
BlackBox/_OpenBSD_/Host/Mod/Console.odc [deleted file]
BlackBox/_OpenBSD_/Lin/Mod/Dl.txt
BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt
BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt
BlackBox/_OpenBSD_/Lin/Mod/Libc.txt
BlackBox/_OpenBSD_/Lin/Mod/Net.txt
BlackBox/_OpenBSD_/Lin/Mod/Termios.txt
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-dirent
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-sigaction
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-siginfo
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stack
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-stat
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-timespec
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-tm
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/fields-ucontext
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname
BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Makefile
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ [deleted file]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c [deleted file]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname [new file with mode: 0644]
BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ
BlackBox/_OpenBSD_/Lin/Rsrc/loader/Makefile
BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader
BlackBox/_OpenBSD_/System/Mod/Kernel.odc
BlackBox/_OpenBSD_/libBB.so
BlackBox/_OpenBSD_/libBB0.so

diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc b/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc
new file mode 100644 (file)
index 0000000..5509e60
Binary files /dev/null and b/BlackBox/_FreeBSDLinuxOpenBSD_/Host/Mod/Console.odc differ
similarity index 55%
rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ
rename to BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Ioctl/Ioctl.txt.templ
index 23a920289a3e73b964c56fbc582ddf4a398385c3..266d5c20f2b94116e26f3c7fa10c5e348762ca7f 100644 (file)
@@ -1,17 +1,14 @@
-MODULE LinIoctl ["libc.so.70.0"];
+MODULE LinIoctl ["libc.so%%libver%%"];
 
        (*
-               A. V. Shiryaev, 2012.11, 2013.08
-
-               OpenBSD 5.4
-               32-bit
+               %%osname%%
+               %%machine%%
        *)
 
        CONST
-               (* /usr/include/sys/ttycom.h *)
-%%defs-ttycom%%
+%%defs-tiocm%%
 %%defs-ioctl%%
        PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
        PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
 
-END LinIoctl.
+END LinIoctl.
\ No newline at end of file
similarity index 94%
rename from BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Rsrc/Mod/gen-Libc/Libc.txt.templ
rename to BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ
index a0b6d6b10305714aa566c0ecde4f64d2e232ee7c..b367b0bbea6d16fdc12af2fc2041b35a03372504 100644 (file)
@@ -49,11 +49,17 @@ MODULE LinLibc ["libc.so%%libver%%"];
                SEEK_CUR* = 1;
                SEEK_END* = 2;
 
+               STDIN_FILENO* = 0;
+               STDOUT_FILENO* = 1;
+               STDERR_FILENO* = 2;
+
                P_tmpdir* = "/tmp";
 
                (* O_RDWR, O_NONBLOCK (intFlags) *)
 %%defs-fcntlo%%
 
+%%defs-clockid%%
+
        TYPE
                StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
                PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
@@ -115,6 +121,10 @@ MODULE LinLibc ["libc.so%%libver%%"];
 %%fields-dirent%%
                END;
 
+               timespec_t* = RECORD [untagged]
+%%fields-timespec%%
+               END;
+
 (*
        VAR
                stdin*: INTEGER;
@@ -132,6 +142,9 @@ MODULE LinLibc ["libc.so%%libver%%"];
        (* ANSI C 89 *)
                PROCEDURE [ccall] clock* (): clock_t;
 
+       (* POSIX.1 *)
+               PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
+
        PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
        (* BSD *)
                PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
@@ -170,6 +183,7 @@ MODULE LinLibc ["libc.so%%libver%%"];
 
        (* ANSI C 89 *)
                PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
+               PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
                PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
                PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
                PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/Net.txt.templ
new file mode 100644 (file)
index 0000000..eb80349
--- /dev/null
@@ -0,0 +1,138 @@
+MODULE LinNet ["libc.so%%libver%%"];
+
+       (*
+               %%osname%%
+               %%machine%%
+       *)
+
+       CONST
+               NULL* = 0H;
+
+               SOCKET_ERROR* = -1;
+               INVALID_SOCKET* = -1;
+
+               INADDR_NONE* = -1;
+               INADDR_ANY* = 0;
+
+               (* socket domains *)
+%%defs-af%%
+               (* socket types *)
+%%defs-sock%%
+               (* socket protocols *)
+%%defs-proto%%
+               (* socket options *)
+%%defs-so%%
+%%defs-shut%%
+%%defs-sol%%
+%%defs-msg%%
+%%defs-somaxconn%%
+               (* addrinfo.ai_flags *)
+%%defs-ai%%
+               (* getaddrinfo/getnameinfo/gai_strerror error codes *)
+%%defs-eai%%
+%%defs-fd_set-const%%
+       TYPE
+               u_int8_t = SHORTCHAR;
+               int8_t = SHORTCHAR;
+               uint16_t = SHORTINT;
+               (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
+%%defs-basictypes%%
+               PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
+
+               SOCKET* = int;
+
+(*
+               in_addr* = RECORD [untagged]
+                       s_addr*: in_addr_t;
+               END;
+*)
+               in_addr* = RECORD [untagged]
+                       S_un*: RECORD [union]
+                               S_un_b*: RECORD [untagged]
+                                       s_b1*: SHORTCHAR;
+                                       s_b2*: SHORTCHAR;
+                                       s_b3*: SHORTCHAR;
+                                       s_b4*: SHORTCHAR;
+                               END;
+                               S_un_w*: RECORD [untagged]
+                                       s_w1*: SHORTINT;
+                                       s_w2*: SHORTINT;
+                               END;
+                               S_addr*: in_addr_t;
+                       END;
+               END;
+
+               Ptrsockaddr* = POINTER [untagged] TO sockaddr;
+               sockaddr* = RECORD [untagged]
+%%fields-sockaddr%%
+               END;
+
+               Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
+               sockaddr_storage* = RECORD [untagged]
+%%fields-sockaddr_storage%%
+               END;
+
+               Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
+               sockaddr_in* = RECORD [untagged]
+%%fields-sockaddr_in%%
+               END;
+
+               Ptraddrinfo* = POINTER [untagged] TO addrinfo;
+               addrinfo* = RECORD [untagged]
+%%fields-addrinfo%%
+               END;
+
+               timeval* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_usec*: suseconds_t; (* and microseconds *)
+               END;
+
+               pollfd* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               fd*: int;
+                               events*: short;
+                               revents*: short;
+               END;
+
+%%defs-fd_set-type%%
+       (* POSIX.1 *)
+               PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
+               PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
+               PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
+               PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
+               PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
+               PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
+               PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
+
+               PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
+               PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
+
+               PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
+
+               PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
+
+(*
+       PROCEDURE FD_ZERO (VAR set: Net.fd_set);
+               VAR i: INTEGER;
+       BEGIN
+               i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
+       END FD_ZERO;
+
+       PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
+       BEGIN
+               INCL(set[fd DIV 32], fd MOD 32)
+       END FD_SET;
+*)
+
+       (* POSIX.1g *)
+               PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
+               PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
+
+               PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
+
+END LinNet.
\ No newline at end of file
diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Net/sizeofs.c
new file mode 100644 (file)
index 0000000..808e5e2
--- /dev/null
@@ -0,0 +1,71 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <poll.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+
+#define TABS "\t\t"
+
+#define FALSE (0)
+#define TRUE (1)
+
+static void D (const char *s, int sz, int set, int export)
+{
+       int res;
+
+       res = printf("%s%s", TABS, s);
+       if (export) {
+               res = printf("*");
+       }
+       res = printf(" = ");
+       if (sz == 1) {
+               res = printf("SHORTCHAR");
+       } else if (sz == 2) {
+               res = printf("SHORTINT");
+       } else if (sz == 4) {
+               if (set) {
+                       res = printf("SET");
+               } else {
+                       res = printf("INTEGER");
+               }
+       } else if (sz == 8) {
+               if (set) {
+                       res = printf("ARRAY [untagged] 2 OF SET");
+               } else {
+                       res = printf("LONGINT");
+               }
+       } else {
+               res = printf("ARRAY [untagged] ");
+               if (sz % 4 == 0) {
+                       if (set) {
+                               res = printf("%d OF SET", sz / 4);
+                       } else {
+                               res = printf("%d OF INTEGER", sz / 4);
+                       }
+               } else {
+                       res = printf("%d OF SHORTCHAR", sz);
+               }
+       }
+       res = printf(";\n");
+}
+
+int main ()
+{\
+       D("PtrVoid", sizeof(void *), FALSE, TRUE);
+       D("short", sizeof(short), FALSE, TRUE);
+       D("int", sizeof(int), FALSE, TRUE);
+       D("intFlags", sizeof(int), TRUE, TRUE);
+       D("size_t", sizeof(size_t), FALSE, TRUE);
+       D("ssize_t", sizeof(ssize_t), FALSE, TRUE);
+       D("time_t", sizeof(time_t), FALSE, TRUE);
+       D("suseconds_t", sizeof(suseconds_t), FALSE, TRUE);
+       D("socklen_t", sizeof(socklen_t), FALSE, TRUE);
+       D("in_addr_t", sizeof(in_addr_t), FALSE, TRUE);
+       D("in_port_t", sizeof(in_port_t), FALSE, TRUE);
+       D("nfds_t", sizeof(nfds_t), FALSE, TRUE);
+       D("sa_family_t", sizeof(sa_family_t), FALSE, TRUE);
+
+       return 0;
+}
diff --git a/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc b/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc
deleted file mode 100644 (file)
index 7453f8f..0000000
Binary files a/BlackBox/_FreeBSDLinux_/Host/Mod/Console.odc and /dev/null differ
similarity index 65%
rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/Makefile
rename to BlackBox/_FreeBSDOpenBSD_/Lin/Mod/gen-Ioctl/Makefile
index 6696eb9001ff17dc3e02a4cfb93515d1f4fc267e..989404843ea4b2fdb01c7a49af92c7aa059388c7 100644 (file)
@@ -9,16 +9,16 @@ INCDIR ?= /usr/include
 all: mkioctl Ioctl.txt
 
 PY = python2.7
-DEFS = defs-ttycom defs-ioctl
+DEFS = defs-tiocm defs-ioctl
 
 defs-ioctl: mkioctl
        ./mkioctl > ${.TARGET}
 
-Ioctl.txt: Ioctl.txt.templ ${DEFS}
+Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine
        ${PY} ./untempl.py Ioctl.txt.templ ${.TARGET}
 
-defs-ttycom:
-       ./dumpdefs.py 3 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET}
+defs-tiocm:
+       ./dumpdefs.py 2 1 s ${INCDIR}/sys/ttycom.h | grep TIOCM_ > ${.TARGET}
 
 clean:
        rm -f mkioctl Ioctl.txt ${DEFS}
diff --git a/BlackBox/_FreeBSD_/BlackBox1.run b/BlackBox/_FreeBSD_/BlackBox1.run
new file mode 100755 (executable)
index 0000000..6344545
Binary files /dev/null and b/BlackBox/_FreeBSD_/BlackBox1.run differ
diff --git a/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc b/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc
new file mode 100644 (file)
index 0000000..1b244a6
Binary files /dev/null and b/BlackBox/_FreeBSD_/Comm/Mod/TCP.odc differ
index 8f91c5913d204c51e1a26988e8691a998e26dd75..7df7c44451d8c549e67e31c759e893162387f6f3 100644 (file)
Binary files a/BlackBox/_FreeBSD_/Host/Mod/Files.odc and b/BlackBox/_FreeBSD_/Host/Mod/Files.odc differ
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt b/BlackBox/_FreeBSD_/Lin/Mod/Ioctl.txt
new file mode 100644 (file)
index 0000000..8db05a9
--- /dev/null
@@ -0,0 +1,43 @@
+MODULE LinIoctl ["libc.so.7"];
+
+       (*
+               FreeBSD 11.0
+               i386
+       *)
+
+       CONST
+               TIOCM_LE* = {0}; (* line enable *)
+               TIOCM_DTR* = {1}; (* data terminal ready *)
+               TIOCM_RTS* = {2}; (* request to send *)
+               TIOCM_ST* = {3}; (* secondary transmit *)
+               TIOCM_SR* = {4}; (* secondary receive *)
+               TIOCM_CTS* = {5}; (* clear to send *)
+               TIOCM_DCD* = {6}; (* data carrier detect *)
+               TIOCM_RI* = {7}; (* ring indicate *)
+               TIOCM_DSR* = {8}; (* data set ready *)
+
+               FIOCLEX* = 536897025;
+               FIONCLEX* = 536897026;
+               FIONREAD* = 1074030207;
+               FIONBIO* = -2147195266;
+               FIOASYNC* = -2147195267;
+               FIOSETOWN* = -2147195268;
+               FIOGETOWN* = 1074030203;
+               TIOCMGET* = 1074033770;
+               TIOCMSET* = -2147191699;
+               TIOCEXCL* = 536900621;
+               TIOCNXCL* = 536900622;
+               TIOCFLUSH* = -2147191792;
+               TIOCDRAIN* = 536900702;
+               TIOCOUTQ* = 1074033779;
+               TIOCSBRK* = 536900731;
+               TIOCCBRK* = 536900730;
+               TIOCSDTR* = 536900729;
+               TIOCCDTR* = 536900728;
+               TIOCMBIS* = -2147191700;
+               TIOCMBIC* = -2147191701;
+
+       PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
+       PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
+
+END LinIoctl.
\ No newline at end of file
index 0aeaa91339424d09088b58ab1663a1a5083db77f..431e603852d14399f4fea11ba6815dba7653d068 100644 (file)
@@ -1,7 +1,7 @@
 MODULE LinLibc ["libc.so.7"];
 
        (*
-               FreeBSD 9.0
+               FreeBSD 11.0
                i386
        *)
 
@@ -18,9 +18,8 @@ MODULE LinLibc ["libc.so.7"];
                MAP_SHARED* = {0}; (* share changes *)
                MAP_PRIVATE* = {1}; (* changes are private *)
                MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
-               MAP_COPY* = MAP_PRIVATE; (* Obsolete *)
-               MAP_RENAME* = {5}; (* Sun: rename private pages to file *)
-               MAP_NORESERVE* = {6}; (* Sun: don't reserve needed swap area *)
+               MAP_RESERVED0020* = {5}; (* previously unimplemented MAP_RENAME *)
+               MAP_RESERVED0040* = {6}; (* previously unimplemented MAP_NORESERVE *)
                MAP_RESERVED0080* = {7}; (* previously misimplemented MAP_INHERIT *)
                MAP_RESERVED0100* = {8}; (* previously unimplemented MAP_NOEXTEND *)
                MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *)
@@ -28,8 +27,10 @@ MODULE LinLibc ["libc.so.7"];
                MAP_NOSYNC* = {11}; (* page to but do not sync underlying file *)
                MAP_FILE* = {}; (* map from file (default) *)
                MAP_ANON* = {12}; (* allocated from memory, swap space *)
+               MAP_EXCL* = {14}; (* for MAP_FIXED, fail if address is used *)
                MAP_NOCORE* = {17}; (* dont include these pages in a coredump *)
                MAP_PREFAULT_READ* = {18}; (* prefault mapping for reading *)
+               MAP_ALIGNMENT_SHIFT* = {3,4};
 
 
                (* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
@@ -103,6 +104,7 @@ MODULE LinLibc ["libc.so.7"];
                SIGUSR2* = 31; (* user defined signal 2 *)
                SIGTHR* = 32; (* reserved by thread library. *)
                SIGLWP* = SIGTHR;
+               SIGLIBRT* = 33; (* reserved by real-time library. *)
                SIGEV_NONE* = 0; (* No async notification. *)
                SIGEV_SIGNAL* = 1; (* Generate a queued signal. *)
                SIGEV_THREAD* = 2; (* Call back from another pthread. *)
@@ -304,11 +306,9 @@ MODULE LinLibc ["libc.so.7"];
                EDOOFUS* = 88; (* Programming error *)
                ENOTCAPABLE* = 93; (* Capabilities insufficient *)
                ECAPMODE* = 94; (* Not permitted in capability mode *)
-               ELAST* = 94; (* Must be equal largest errno *)
-               ERESTART* = -1; (* restart syscall *)
-               EJUSTRETURN* = -2; (* don't modify regs, just return *)
-               ENOIOCTL* = -3; (* ioctl not handled by this layer *)
-               EDIRIOCTL* = -4; (* do direct ioctl in GEOM *)
+               ENOTRECOVERABLE* = 95; (* State not recoverable *)
+               EOWNERDEAD* = 96; (* Previous owner died *)
+               ELAST* = 96; (* Must be equal largest errno *)
 
 
                NAME_MAX* = 255;
@@ -317,6 +317,10 @@ MODULE LinLibc ["libc.so.7"];
                SEEK_CUR* = 1;
                SEEK_END* = 2;
 
+               STDIN_FILENO* = 0;
+               STDOUT_FILENO* = 1;
+               STDERR_FILENO* = 2;
+
                P_tmpdir* = "/tmp";
 
                (* O_RDWR, O_NONBLOCK (intFlags) *)
@@ -330,6 +334,7 @@ MODULE LinLibc ["libc.so.7"];
                O_EXEC* = {18}; (* Open for execute only *)
                O_TTY_INIT* = {19}; (* Restore default termios attributes *)
                O_CLOEXEC* = {20};
+               O_VERIFY* = {21}; (* open only after verification *)
                O_RDONLY* = {}; (* open for reading only *)
                O_WRONLY* = {0}; (* open for writing only *)
                O_RDWR* = {1}; (* open for reading and writing *)
@@ -343,6 +348,22 @@ MODULE LinLibc ["libc.so.7"];
                O_NOCTTY* = {15}; (* don't assign controlling terminal *)
 
 
+               (* FreeBSD 11.0 /usr/include/time.h *)
+                       CLOCK_REALTIME* = 0;
+                       CLOCK_VIRTUAL* = 1;
+                       CLOCK_PROF* = 2;
+                       CLOCK_MONOTONIC* = 4;
+                       CLOCK_UPTIME* = 5; (* FreeBSD-specific *)
+                       CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *)
+                       CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *)
+                       CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *)
+                       CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *)
+                       CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *)
+                       CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *)
+                       CLOCK_SECOND* = 13; (* FreeBSD-specific *)
+                       CLOCK_THREAD_CPUTIME_ID* = 14;
+                       CLOCK_PROCESS_CPUTIME_ID* = 15;
+
        TYPE
                StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
                PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
@@ -357,6 +378,7 @@ MODULE LinLibc ["libc.so.7"];
                ssize_t* = INTEGER;
                off_t* = LONGINT;
                clock_t* = INTEGER;
+               clockid_t* = INTEGER;
                time_t* = INTEGER;
                mode_t* = SHORTINT;
                pid_t* = INTEGER;
@@ -555,6 +577,12 @@ MODULE LinLibc ["libc.so.7"];
                                d_name*: ARRAY [untagged] 255 + 1 (* 256 *) OF SHORTCHAR;
                END;
 
+               timespec_t* = RECORD [untagged]
+                       (* FreeBSD 11.0 /usr/include/sys/_timespec.h *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_nsec*: long; (* and nanoseconds *)
+               END;
+
 (*
        VAR
                stdin*: INTEGER;
@@ -567,9 +595,13 @@ MODULE LinLibc ["libc.so.7"];
        (* POSIX.1 *)
                PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
 *)
+(*
        VAR
                errno*: INTEGER;
                stdin* ["__stdinp"]: PtrFILE;
+*)
+
+       PROCEDURE [ccall] __errno_location* ["__error"] (): PtrVoid;
 
        (* POSIX.1 *)
                PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
@@ -578,6 +610,9 @@ MODULE LinLibc ["libc.so.7"];
        (* ANSI C 89 *)
                PROCEDURE [ccall] clock* (): clock_t;
 
+       (* POSIX.1 *)
+               PROCEDURE [ccall] clock_gettime* (clock_id: clockid_t; VAR tp: timespec_t): int;
+
        PROCEDURE [ccall] mmap* (adr: PtrVoid; len: size_t; prot: intFlags; flags: intFlags; fd: int; offset: off_t): PtrVoid;
        (* BSD *)
                PROCEDURE [ccall] munmap* (adr: PtrVoid; len: size_t): int;
@@ -616,6 +651,7 @@ MODULE LinLibc ["libc.so.7"];
 
        (* ANSI C 89 *)
                PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
+               PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
                PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
                PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
                PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
@@ -650,6 +686,7 @@ MODULE LinLibc ["libc.so.7"];
                PROCEDURE [ccall] write* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
                PROCEDURE [ccall] read* (d: int; buf: PtrVoid; nbytes: size_t): ssize_t;
                PROCEDURE [ccall] close* (d: int): int;
+               PROCEDURE [ccall] lseek* (d: int; offset: off_t; whence: int): off_t;
 
        (* POSIX.1 *)
                PROCEDURE [ccall] sysconf* (name: int): long;
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/Net.txt b/BlackBox/_FreeBSD_/Lin/Mod/Net.txt
new file mode 100644 (file)
index 0000000..f0ddb5d
--- /dev/null
@@ -0,0 +1,241 @@
+MODULE LinNet ["libc.so.7"];
+
+       (*
+               FreeBSD 11.0
+               i386
+       *)
+
+       CONST
+               NULL* = 0H;
+
+               SOCKET_ERROR* = -1;
+               INVALID_SOCKET* = -1;
+
+               INADDR_NONE* = -1;
+               INADDR_ANY* = 0;
+
+               (* socket domains *)
+                       AF_UNSPEC* = 0; (* unspecified *)
+                       AF_UNIX* = 1; (* standardized name for AF_LOCAL *)
+                       AF_INET* = 2; (* internetwork: UDP, TCP, etc. *)
+                       AF_INET6* = 28; (* IPv6 *)
+
+               (* socket types *)
+                       SOCK_STREAM* = 1; (* stream socket *)
+                       SOCK_DGRAM* = 2; (* datagram socket *)
+                       SOCK_RAW* = 3; (* raw-protocol interface *)
+                       SOCK_SEQPACKET* = 5; (* sequenced packet stream *)
+
+               (* socket protocols *)
+                       IPPROTO_IP* = 0; (* dummy for IP *)
+                       IPPROTO_ICMP* = 1; (* control message protocol *)
+                       IPPROTO_TCP* = 6; (* tcp *)
+                       IPPROTO_UDP* = 17; (* user datagram protocol *)
+
+               (* socket options *)
+                       SO_DEBUG* = {0}; (* turn on debugging info recording *)
+                       SO_ACCEPTCONN* = {1}; (* socket has had listen() *)
+                       SO_REUSEADDR* = {2}; (* allow local address reuse *)
+                       SO_KEEPALIVE* = {3}; (* keep connections alive *)
+                       SO_DONTROUTE* = {4}; (* just use interface addresses *)
+                       SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *)
+                       SO_LINGER* = {7}; (* linger on close if data present *)
+                       SO_OOBINLINE* = {8}; (* leave received OOB data in line *)
+                       SO_NO_OFFLOAD* = {14}; (* socket cannot be offloaded *)
+                       SO_NO_DDP* = {15}; (* disable direct data placement *)
+                       SO_SNDBUF* = {0,12}; (* send buffer size *)
+                       SO_RCVBUF* = {1,12}; (* receive buffer size *)
+                       SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *)
+                       SO_RCVLOWAT* = {2,12}; (* receive low-water mark *)
+                       SO_SNDTIMEO* = {0,2,12}; (* send timeout *)
+                       SO_RCVTIMEO* = {1,2,12}; (* receive timeout *)
+                       SO_ERROR* = {0..2,12}; (* get error status and clear *)
+                       SO_TYPE* = {3,12}; (* 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 *)
+
+               SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *)
+
+               MSG_OOB* = {0}; (* process out-of-band data *)
+               MSG_PEEK* = {1}; (* peek at incoming message *)
+               MSG_DONTROUTE* = {2}; (* send without using routing tables *)
+               MSG_EOR* = {3}; (* data completes record *)
+               MSG_TRUNC* = {4}; (* data discarded before delivery *)
+               MSG_CTRUNC* = {5}; (* control data lost before delivery *)
+               MSG_WAITALL* = {6}; (* wait for full request or error *)
+
+               SOMAXCONN* = 128;
+
+               (* addrinfo.ai_flags *)
+                       AI_PASSIVE* = {0}; (* get address to use bind() *)
+                       AI_CANONNAME* = {1}; (* fill ai_canonname *)
+                       AI_NUMERICHOST* = {2}; (* prevent host name resolution *)
+                       AI_NUMERICSERV* = {3}; (* prevent service name resolution *)
+                       AI_ALL* = {8}; (* IPv6 and IPv4-mapped (with AI_V4MAPPED) *)
+                       AI_V4MAPPED_CFG* = {9}; (* accept IPv4-mapped if kernel supports *)
+                       AI_ADDRCONFIG* = {10}; (* only if any address is assigned *)
+                       AI_V4MAPPED* = {11}; (* accept IPv4-mapped IPv6 address *)
+
+               (* getaddrinfo/getnameinfo/gai_strerror error codes *)
+                       EAI_AGAIN* = 2; (* temporary failure in name resolution *)
+                       EAI_BADFLAGS* = 3; (* invalid value for ai_flags *)
+                       EAI_FAIL* = 4; (* non-recoverable failure in name resolution *)
+                       EAI_FAMILY* = 5; (* ai_family not supported *)
+                       EAI_MEMORY* = 6; (* memory allocation failure *)
+                       EAI_NONAME* = 8; (* hostname nor servname provided, or not known *)
+                       EAI_SERVICE* = 9; (* servname not supported for ai_socktype *)
+                       EAI_SOCKTYPE* = 10; (* ai_socktype not supported *)
+                       EAI_SYSTEM* = 11; (* system error returned in errno *)
+                       EAI_BADHINTS* = 12; (* invalid value for hints *)
+                       EAI_PROTOCOL* = 13; (* resolved protocol is unknown *)
+                       EAI_OVERFLOW* = 14; (* argument buffer overflow *)
+                       EAI_MAX* = 15;
+
+               (* FreeBSD 11.0 /usr/include/sys/select.h *)
+                       FD_SETSIZE = 1024;
+                       _NFDBITS = 8 * 4;
+
+       TYPE
+               u_int8_t = SHORTCHAR;
+               int8_t = SHORTCHAR;
+               uint16_t = SHORTINT;
+               (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
+               PtrVoid* = INTEGER;
+               short* = SHORTINT;
+               int* = INTEGER;
+               intFlags* = SET;
+               size_t* = INTEGER;
+               ssize_t* = INTEGER;
+               time_t* = INTEGER;
+               suseconds_t* = INTEGER;
+               socklen_t* = INTEGER;
+               in_addr_t* = INTEGER;
+               in_port_t* = SHORTINT;
+               nfds_t* = INTEGER;
+               sa_family_t* = SHORTCHAR;
+
+               PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
+
+               SOCKET* = int;
+
+(*
+               in_addr* = RECORD [untagged]
+                       s_addr*: in_addr_t;
+               END;
+*)
+               in_addr* = RECORD [untagged]
+                       S_un*: RECORD [union]
+                               S_un_b*: RECORD [untagged]
+                                       s_b1*: SHORTCHAR;
+                                       s_b2*: SHORTCHAR;
+                                       s_b3*: SHORTCHAR;
+                                       s_b4*: SHORTCHAR;
+                               END;
+                               S_un_w*: RECORD [untagged]
+                                       s_w1*: SHORTINT;
+                                       s_w2*: SHORTINT;
+                               END;
+                               S_addr*: in_addr_t;
+                       END;
+               END;
+
+               Ptrsockaddr* = POINTER [untagged] TO sockaddr;
+               sockaddr* = RECORD [untagged]
+                       (* FreeBSD 11.0 /usr/include/sys/socket.h *)
+                               sa_len*: SHORTCHAR; (* total length *)
+                               sa_family*: sa_family_t; (* address family *)
+                               sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
+               END;
+
+               Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
+               sockaddr_storage* = RECORD [untagged]
+                       (* FreeBSD 11.0 /usr/include/sys/_sockaddr_storage.h *)
+                               ss_len*: SHORTCHAR; (* address length *)
+                               ss_family*: sa_family_t; (* address family *)
+                               __ss_pad1: ARRAY [untagged] 8 - 2 OF SHORTCHAR;
+                               __ss_align: LONGINT; (* force desired struct alignment *)
+                               __ss_pad2: ARRAY [untagged] 128 - 1 - 1 - (8 - 2) - 8 OF SHORTCHAR;
+               END;
+
+               Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
+               sockaddr_in* = RECORD [untagged]
+                       (* FreeBSD 11.0 /usr/include/netinet/in.h *)
+                               sin_len*: SHORTCHAR;
+                               sin_family*: sa_family_t;
+                               sin_port*: in_port_t;
+                               sin_addr*: in_addr;
+                               sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR;
+               END;
+
+               Ptraddrinfo* = POINTER [untagged] TO addrinfo;
+               addrinfo* = RECORD [untagged]
+                       (* FreeBSD 11.0 /usr/include/netdb.h *)
+                               ai_flags*: intFlags;
+                               ai_family*: int;
+                               ai_socktype*: int;
+                               ai_protocol*: int;
+                               ai_addrlen*: socklen_t;
+                               ai_canonname*: PtrSTR;
+                               ai_addr*: Ptrsockaddr;
+                               ai_next*: Ptraddrinfo;
+               END;
+
+               timeval* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_usec*: suseconds_t; (* and microseconds *)
+               END;
+
+               pollfd* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               fd*: int;
+                               events*: short;
+                               revents*: short;
+               END;
+
+               (* FreeBSD 11.0 /usr/include/sys/select.h *)
+                       __fd_mask = SET;
+                       fd_set* = ARRAY [untagged] (FD_SETSIZE + (_NFDBITS - 1)) DIV _NFDBITS OF __fd_mask;
+
+       (* POSIX.1 *)
+               PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
+               PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
+               PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
+               PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
+               PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
+               PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
+               PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
+
+               PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
+               PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
+
+               PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
+
+               PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
+
+(*
+       PROCEDURE FD_ZERO (VAR set: Net.fd_set);
+               VAR i: INTEGER;
+       BEGIN
+               i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
+       END FD_ZERO;
+
+       PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
+       BEGIN
+               INCL(set[fd DIV 32], fd MOD 32)
+       END FD_SET;
+*)
+
+       (* POSIX.1g *)
+               PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
+               PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
+
+               PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
+
+END LinNet.
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/dumpdefs.py
new file mode 120000 (symlink)
index 0000000..1730591
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/dumpdefs.py
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/libver
new file mode 100644 (file)
index 0000000..127fc98
--- /dev/null
@@ -0,0 +1 @@
+.7
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/osname
new file mode 100644 (file)
index 0000000..64f5283
--- /dev/null
@@ -0,0 +1 @@
+FreeBSD 11.0
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Ioctl/untempl.py
new file mode 120000 (symlink)
index 0000000..5800713
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/untempl.py
\ No newline at end of file
index 07b85b3393381631a7a063b4c6ccc29590a1b48e..fc56da2b3ec28ef42dbdc7a8d6b66fcb834367df 100644 (file)
@@ -20,7 +20,7 @@ clockspersec:
 
 defs-map:
        ./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "       MAP_" > ${.TARGET}
-       ./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep "       MAP_" >> ${.TARGET}
+       ./dumpdefs.py 2 2 s ${INCDIR}/sys/mman.h | grep "       MAP_" | grep -v " = MAP_" >> ${.TARGET}
 
 defs-prot:
        ./dumpdefs.py 2 1 s ${INCDIR}/sys/mman.h | grep "       PROT_" > ${.TARGET}
@@ -41,7 +41,7 @@ defs-sa:
 defs-errno:
        ./dumpdefs.py 2 0 i ${INCDIR}/sys/errno.h > ${.TARGET}
        ./dumpdefs.py 2 1 i ${INCDIR}/sys/errno.h >> ${.TARGET}
-       ./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h >> ${.TARGET}
+       ./dumpdefs.py 2 2 i ${INCDIR}/sys/errno.h | grep -v "= -" >> ${.TARGET}
 
 namemax:
        grep "  NAME_MAX        " ${INCDIR}/sys/syslimits.h | head -1 | awk '{print $$3}' | tr -d '\n' > ${.TARGET}
index 164cf8dc1230488558f56ab435396a65024a9b5f..14bdda75ad779566c6e660509374c82d3532d6b6 100644 (file)
@@ -1,6 +1,10 @@
+(*
        VAR
                errno*: INTEGER;
                stdin* ["__stdinp"]: PtrFILE;
+*)
+
+       PROCEDURE [ccall] __errno_location* ["__error"] (): PtrVoid;
 
        (* POSIX.1 *)
                PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/defs-clockid
new file mode 100644 (file)
index 0000000..468e15d
--- /dev/null
@@ -0,0 +1,15 @@
+               (* FreeBSD 11.0 /usr/include/time.h *)
+                       CLOCK_REALTIME* = 0;
+                       CLOCK_VIRTUAL* = 1;
+                       CLOCK_PROF* = 2;
+                       CLOCK_MONOTONIC* = 4;
+                       CLOCK_UPTIME* = 5; (* FreeBSD-specific *)
+                       CLOCK_UPTIME_PRECISE* = 7; (* FreeBSD-specific *)
+                       CLOCK_UPTIME_FAST* = 8; (* FreeBSD-specific *)
+                       CLOCK_REALTIME_PRECISE* = 9; (* FreeBSD-specific *)
+                       CLOCK_REALTIME_FAST* = 10; (* FreeBSD-specific *)
+                       CLOCK_MONOTONIC_PRECISE* = 11; (* FreeBSD-specific *)
+                       CLOCK_MONOTONIC_FAST* = 12; (* FreeBSD-specific *)
+                       CLOCK_SECOND* = 13; (* FreeBSD-specific *)
+                       CLOCK_THREAD_CPUTIME_ID* = 14;
+                       CLOCK_PROCESS_CPUTIME_ID* = 15;
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec b/BlackBox/_FreeBSD_/Lin/Mod/gen-Libc/fields-timespec
new file mode 100644 (file)
index 0000000..c4a5b7c
--- /dev/null
@@ -0,0 +1,3 @@
+                       (* FreeBSD 11.0 /usr/include/sys/_timespec.h *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_nsec*: long; (* and nanoseconds *)
\ No newline at end of file
index 81907015f641459e05de33d46071bb1a0938c370..64f5283aac46eb0df0b855653a807908a48335ac 100644 (file)
@@ -1 +1 @@
-FreeBSD 9.0
\ No newline at end of file
+FreeBSD 11.0
\ No newline at end of file
index 42fb91023165d41137a7b3bec32f771bf8714098..99f380a153fa189ca356d5fb6346387c6982011b 100644 (file)
@@ -59,6 +59,7 @@ int main ()
        D("ssize_t", sizeof(ssize_t), FALSE, TRUE);
        D("off_t", sizeof(off_t), FALSE, TRUE);
        D("clock_t", sizeof(clock_t), FALSE, TRUE);
+       D("clockid_t", sizeof(clockid_t), FALSE, TRUE);
        D("time_t", sizeof(time_t), FALSE, TRUE);
        D("mode_t", sizeof(mode_t), TRUE, TRUE);
        D("pid_t", sizeof(pid_t), FALSE, TRUE);
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/Makefile
new file mode 100644 (file)
index 0000000..dadffc4
--- /dev/null
@@ -0,0 +1,52 @@
+# This is BSD Makefile
+#    BSD       GNU
+# ${.TARGET}    $@
+# ${.ALLSRC}    $^
+# ${.IMPSRC}    $<
+
+INCDIR ?= /usr/include
+
+PY = python2.7
+
+DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn
+
+all: Net.txt ${DEFS}
+
+Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
+       ${PY} ./untempl.py Net.txt.templ ${.TARGET}
+
+defs-basictypes: sizeofs
+       ./sizeofs > ${.TARGET}
+
+defs-af:
+       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     AF_" > ${.TARGET}
+
+defs-sock:
+       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     SOCK_" > ${.TARGET}
+
+defs-proto:
+       ./dumpdefs.py 3 1 i ${INCDIR}/netinet/in.h | grep "     IPPROTO_" > ${.TARGET}
+
+defs-sol:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SOL_" > ${.TARGET}
+
+defs-msg:
+       ./dumpdefs.py 2 1 s ${INCDIR}/sys/socket.h | grep "     MSG_" > ${.TARGET}
+
+defs-somaxconn:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SOMAXCONN" > ${.TARGET}
+
+defs-so:
+       ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep "     SO_" > ${.TARGET}
+
+defs-shut:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SHUT_" > ${.TARGET}
+
+defs-ai:
+       ./dumpdefs.py 3 1 s ${INCDIR}/netdb.h | grep "  AI_" > ${.TARGET}
+
+defs-eai:
+       ./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep "  EAI_" > ${.TARGET}
+
+clean:
+       rm -f ${DEFS} Net.txt sizeofs
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-const
new file mode 100644 (file)
index 0000000..99eac81
--- /dev/null
@@ -0,0 +1,3 @@
+               (* FreeBSD 11.0 /usr/include/sys/select.h *)
+                       FD_SETSIZE = 1024;
+                       _NFDBITS = 8 * 4;
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/defs-fd_set-type
new file mode 100644 (file)
index 0000000..604bf5f
--- /dev/null
@@ -0,0 +1,3 @@
+               (* FreeBSD 11.0 /usr/include/sys/select.h *)
+                       __fd_mask = SET;
+                       fd_set* = ARRAY [untagged] (FD_SETSIZE + (_NFDBITS - 1)) DIV _NFDBITS OF __fd_mask;
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/dumpdefs.py
new file mode 120000 (symlink)
index 0000000..1730591
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/dumpdefs.py
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-addrinfo
new file mode 100644 (file)
index 0000000..0140000
--- /dev/null
@@ -0,0 +1,9 @@
+                       (* FreeBSD 11.0 /usr/include/netdb.h *)
+                               ai_flags*: intFlags;
+                               ai_family*: int;
+                               ai_socktype*: int;
+                               ai_protocol*: int;
+                               ai_addrlen*: socklen_t;
+                               ai_canonname*: PtrSTR;
+                               ai_addr*: Ptrsockaddr;
+                               ai_next*: Ptraddrinfo;
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr
new file mode 100644 (file)
index 0000000..239887f
--- /dev/null
@@ -0,0 +1,4 @@
+                       (* FreeBSD 11.0 /usr/include/sys/socket.h *)
+                               sa_len*: SHORTCHAR; (* total length *)
+                               sa_family*: sa_family_t; (* address family *)
+                               sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_in
new file mode 100644 (file)
index 0000000..9f5a721
--- /dev/null
@@ -0,0 +1,6 @@
+                       (* FreeBSD 11.0 /usr/include/netinet/in.h *)
+                               sin_len*: SHORTCHAR;
+                               sin_family*: sa_family_t;
+                               sin_port*: in_port_t;
+                               sin_addr*: in_addr;
+                               sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage
new file mode 100644 (file)
index 0000000..1772596
--- /dev/null
@@ -0,0 +1,6 @@
+                       (* FreeBSD 11.0 /usr/include/sys/_sockaddr_storage.h *)
+                               ss_len*: SHORTCHAR; (* address length *)
+                               ss_family*: sa_family_t; (* address family *)
+                               __ss_pad1: ARRAY [untagged] 8 - 2 OF SHORTCHAR;
+                               __ss_align: LONGINT; (* force desired struct alignment *)
+                               __ss_pad2: ARRAY [untagged] 128 - 1 - 1 - (8 - 2) - 8 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/libver
new file mode 100644 (file)
index 0000000..127fc98
--- /dev/null
@@ -0,0 +1 @@
+.7
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/osname
new file mode 100644 (file)
index 0000000..64f5283
--- /dev/null
@@ -0,0 +1 @@
+FreeBSD 11.0
\ No newline at end of file
diff --git a/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py b/BlackBox/_FreeBSD_/Lin/Mod/gen-Net/untempl.py
new file mode 120000 (symlink)
index 0000000..5800713
--- /dev/null
@@ -0,0 +1 @@
+../gen-Libc/untempl.py
\ No newline at end of file
index 425a7b30c4885fec3c112ca8b1758abaebaf6c1b..058053a81bd7f6750f9f925f41178165b69fb722 100755 (executable)
Binary files a/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader and b/BlackBox/_FreeBSD_/Lin/Rsrc/loader/loader differ
index 0bee37727833764cac16f1e410960fa99b7b07d6..0d57ce2fefb1c689124a9df00b28314169055b34 100644 (file)
Binary files a/BlackBox/_FreeBSD_/System/Mod/Kernel.odc and b/BlackBox/_FreeBSD_/System/Mod/Kernel.odc differ
index 6ef9ef509c9982b761a9337ad21d47b09fb61bbe..9b520c9ae816f1dcff7368bc08b14e2989dbd300 100644 (file)
Binary files a/BlackBox/_FreeBSD_/libBB.so and b/BlackBox/_FreeBSD_/libBB.so differ
index e4df9fbcaaa1c4df1702a4256182c8c3b05bc74a..9c0a65d45dec65ed407e3acd6ab6a10698ab90e8 100644 (file)
Binary files a/BlackBox/_FreeBSD_/libBB0.so and b/BlackBox/_FreeBSD_/libBB0.so differ
index 99984081d80b19f31bc4aa0b56ca72f2e4e60257..b213fe6ac68c03c565129e3d4ea99feee3e00d21 100644 (file)
Binary files a/BlackBox/_Linux_/Comm/Mod/TCP.odc and b/BlackBox/_Linux_/Comm/Mod/TCP.odc differ
index 0431f399d70b0da51d960aa09f1b202cdb62bc2f..8a848efc79662e8dbd09797ba3d4c99a18980fb3 100644 (file)
@@ -1,23 +1,20 @@
 MODULE LinIoctl ["libc.so.6"];
 
        (*
-               A. V. Shiryaev, 2012.11
-
                GNU/Linux
                i386
        *)
 
        CONST
-               (* /usr/include/i386-linux-gnu/bits/ioctl-types.h *)
-                       TIOCM_LE* = {0};
-                       TIOCM_DTR* = {1};
-                       TIOCM_RTS* = {2};
-                       TIOCM_ST* = {3};
-                       TIOCM_SR* = {4};
-                       TIOCM_CTS* = {5};
-                       TIOCM_CAR* = {6};
-                       TIOCM_RNG* = {7};
-                       TIOCM_DSR* = {8};
+               TIOCM_LE* = {0};
+               TIOCM_DTR* = {1};
+               TIOCM_RTS* = {2};
+               TIOCM_ST* = {3};
+               TIOCM_SR* = {4};
+               TIOCM_CTS* = {5};
+               TIOCM_CAR* = {6};
+               TIOCM_RNG* = {7};
+               TIOCM_DSR* = {8};
 
                FIOCLEX* = 21585;
                FIONCLEX* = 21584;
@@ -37,4 +34,4 @@ MODULE LinIoctl ["libc.so.6"];
        PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
        PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
 
-END LinIoctl.
+END LinIoctl.
\ No newline at end of file
index 4940bdab271c42da04735c2097d9718806e25b93..776f6d161328e6fc2beaf7f7dc0fc0796aa29c2b 100644 (file)
Binary files a/BlackBox/_Linux_/Lin/Mod/Libc.odc and b/BlackBox/_Linux_/Lin/Mod/Libc.odc differ
index d90abb0197a88b38f9e7813d00fac16dcd1512e4..feab677227c853c4968ece4be963ddb5f5356e54 100644 (file)
@@ -246,6 +246,10 @@ MODULE LinLibc ["libc.so.6"];
 
                SIGSTKSZ* = 8192;
 
+               STDIN_FILENO* = 0;
+               STDOUT_FILENO* = 1;
+               STDERR_FILENO* = 2;
+
        TYPE 
                __ftw_func_t* = PROCEDURE (fileName: PtrSTR; VAR [nil] stat: stat_t; flag: INTEGER): INTEGER;
                PtrVoid* = INTEGER;
@@ -396,7 +400,9 @@ MODULE LinLibc ["libc.so.6"];
 
        VAR
                timezone*: INTEGER; (* seconds from GMT *)              
+(*
                stdin*, stdout*, stderr* : PtrFILE;
+*)
 
        PROCEDURE [ccall] calloc* (num, size: size_t): PtrVoid;
        PROCEDURE [ccall] clock* (): clock_t;
@@ -406,6 +412,7 @@ MODULE LinLibc ["libc.so.6"];
        PROCEDURE [ccall] fclose* (fp: PtrFILE): INTEGER;
        PROCEDURE [ccall] fflush* (fp: PtrFILE): INTEGER;
        PROCEDURE [ccall] fopen* (filename, mode: PtrSTR): PtrFILE;
+       PROCEDURE [ccall] fdopen* (fildes: INTEGER; mode: PtrSTR): PtrFILE;
        PROCEDURE [ccall] feof* (fp: PtrFILE): INTEGER;
        PROCEDURE [ccall] fread* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t;
        PROCEDURE [ccall] fseek* (stream: PtrFILE; offset, origin: INTEGER): INTEGER;
index 738f28a6fbb3e6e1438e1be7ed08f3d664870bbb..c8c528956c6d4cd0ae088e09590828d3659e4ee6 100644 (file)
@@ -1,30 +1,20 @@
 MODULE LinNet ["libc.so.6"];
 
        (*
-               A. V. Shiryaev, 2012.11
-
                GNU/Linux
-               32-bit
+               i386
        *)
 
-       IMPORT Libc := LinLibc;
-
        CONST
-               INVALID_SOCKET* = -1;
+               NULL* = 0H;
+
                SOCKET_ERROR* = -1;
+               INVALID_SOCKET* = -1;
 
-               (* /usr/include/i386-linux-gnu/bits/socket.h *)
-                       SHUT_RD* = 0;
-                       SHUT_WR* = 1;
-                       SHUT_RDWR* = 2;
-                       SOCK_STREAM* = 1;
-                       SOCK_DGRAM* = 2;
-                       SOCK_RAW* = 3;
-                       SOCK_RDM* = 4;
-                       SOCK_SEQPACKET* = 5;
-                       SOCK_DCCP* = 6;
-                       SOCK_PACKET* = 10;
+               INADDR_NONE* = -1;
+               INADDR_ANY* = 0;
 
+               (* socket domains *)
                        PF_UNSPEC* = 0; (* Unspecified. *)
                        PF_LOCAL* = 1; (* Local to host (pipes and file-domain). *)
                        PF_UNIX* = PF_LOCAL; (* POSIX name for PF_LOCAL. *)
@@ -66,10 +56,51 @@ MODULE LinNet ["libc.so.6"];
                        PF_CAIF* = 37; (* CAIF sockets. *)
                        PF_ALG* = 38; (* Algorithm sockets. *)
                        PF_NFC* = 39; (* NFC sockets. *)
-                       PF_MAX* = 40; (* For now.. *)
-                       SOMAXCONN* = 128;
+                       PF_VSOCK* = 40; (* vSockets. *)
+                       PF_MAX* = 41; (* For now.. *)
 
-               (* /usr/include/asm-generic/socket.h *)
+               (* socket types *)
+                       (* /usr/include/i386-linux-gnu/bits/socket_type.h *)
+                               SOCK_STREAM* = 1;
+                               SOCK_DGRAM* = 2;
+                               SOCK_RAW* = 3;
+                               SOCK_RDM* = 4;
+                               SOCK_SEQPACKET* = 5;
+                               SOCK_DCCP* = 6;
+                               SOCK_PACKET* = 10;
+
+               (* socket protocols *)
+                       IPPROTO_IP = 0; (* Dummy protocol for TCP. *)
+                       IPPROTO_HOPOPTS* = 0; (* IPv6 Hop-by-Hop options. *)
+                       IPPROTO_ICMP* = 1; (* Internet Control Message Protocol. *)
+                       IPPROTO_IGMP* = 2; (* Internet Group Management Protocol. *)
+                       IPPROTO_IPIP* = 4; (* IPIP tunnels (older KA9Q tunnels use 94). *)
+                       IPPROTO_TCP* = 6; (* Transmission Control Protocol. *)
+                       IPPROTO_EGP* = 8; (* Exterior Gateway Protocol. *)
+                       IPPROTO_PUP* = 12; (* PUP protocol. *)
+                       IPPROTO_UDP* = 17; (* User Datagram Protocol. *)
+                       IPPROTO_IDP* = 22; (* XNS IDP protocol. *)
+                       IPPROTO_TP* = 29; (* SO Transport Protocol Class 4. *)
+                       IPPROTO_DCCP* = 33; (* Datagram Congestion Control Protocol. *)
+                       IPPROTO_IPV6* = 41; (* IPv6 header. *)
+                       IPPROTO_ROUTING* = 43; (* IPv6 routing header. *)
+                       IPPROTO_FRAGMENT* = 44; (* IPv6 fragmentation header. *)
+                       IPPROTO_RSVP* = 46; (* Reservation Protocol. *)
+                       IPPROTO_GRE* = 47; (* General Routing Encapsulation. *)
+                       IPPROTO_ESP* = 50; (* encapsulating security payload. *)
+                       IPPROTO_AH* = 51; (* authentication header. *)
+                       IPPROTO_ICMPV6* = 58; (* ICMPv6. *)
+                       IPPROTO_NONE* = 59; (* IPv6 no next header. *)
+                       IPPROTO_DSTOPTS* = 60; (* IPv6 destination options. *)
+                       IPPROTO_MTP* = 92; (* Multicast Transport Protocol. *)
+                       IPPROTO_ENCAP* = 98; (* Encapsulation Header. *)
+                       IPPROTO_PIM* = 103; (* Protocol Independent Multicast. *)
+                       IPPROTO_COMP* = 108; (* Compression Header Protocol. *)
+                       IPPROTO_SCTP* = 132; (* Stream Control Transmission Protocol. *)
+                       IPPROTO_UDPLITE* = 136; (* UDP-Lite protocol. *)
+                       IPPROTO_RAW* = 255; (* Raw IP packets. *)
+
+               (* socket options *)
                        SO_DEBUG* = {0};
                        SO_REUSEADDR* = {1};
                        SO_TYPE* = {0,1};
@@ -86,6 +117,7 @@ MODULE LinNet ["libc.so.6"];
                        SO_PRIORITY* = {2,3};
                        SO_LINGER* = {0,2,3};
                        SO_BSDCOMPAT* = {1..3};
+                       SO_REUSEPORT* = {0..3};
                        SO_SECURITY_AUTHENTICATION* = {1,2,4};
                        SO_SECURITY_ENCRYPTION_TRANSPORT* = {0..2,4};
                        SO_SECURITY_ENCRYPTION_NETWORK* = {3,4};
@@ -103,141 +135,191 @@ MODULE LinNet ["libc.so.6"];
                        SO_PROTOCOL* = {1,2,5};
                        SO_DOMAIN* = {0..2,5};
                        SO_RXQ_OVFL* = {3,5};
+                       SO_WIFI_STATUS* = {0,3,5};
+                       SO_PEEK_OFF* = {1,3,5};
+                       SO_NOFCS* = {0,1,3,5};
+                       SO_LOCK_FILTER* = {2,3,5};
+                       SO_SELECT_ERR_QUEUE* = {0,2,3,5};
+                       SO_BUSY_POLL* = {1..3,5};
+                       SO_MAX_PACING_RATE* = {0..3,5};
 
-               (* /usr/include/netinet/in.h *)
-                       INADDR_NONE* = -1;
-                       IPPROTO_IP = 0; (* Dummy protocol for TCP. *)
-                       IPPROTO_HOPOPTS* = 0; (* IPv6 Hop-by-Hop options. *)
-                       IPPROTO_ICMP* = 1; (* Internet Control Message Protocol. *)
-                       IPPROTO_IGMP* = 2; (* Internet Group Management Protocol. *)
-                       IPPROTO_IPIP* = 4; (* IPIP tunnels (older KA9Q tunnels use 94). *)
-                       IPPROTO_TCP* = 6; (* Transmission Control Protocol. *)
-                       IPPROTO_EGP* = 8; (* Exterior Gateway Protocol. *)
-                       IPPROTO_PUP* = 12; (* PUP protocol. *)
-                       IPPROTO_UDP* = 17; (* User Datagram Protocol. *)
-                       IPPROTO_IDP* = 22; (* XNS IDP protocol. *)
-                       IPPROTO_TP* = 29; (* SO Transport Protocol Class 4. *)
-                       IPPROTO_DCCP* = 33; (* Datagram Congestion Control Protocol. *)
-                       IPPROTO_IPV6* = 41; (* IPv6 header. *)
-                       IPPROTO_ROUTING* = 43; (* IPv6 routing header. *)
-                       IPPROTO_FRAGMENT* = 44; (* IPv6 fragmentation header. *)
-                       IPPROTO_RSVP* = 46; (* Reservation Protocol. *)
-                       IPPROTO_GRE* = 47; (* General Routing Encapsulation. *)
-                       IPPROTO_ESP* = 50; (* encapsulating security payload. *)
-                       IPPROTO_AH* = 51; (* authentication header. *)
-                       IPPROTO_ICMPV6* = 58; (* ICMPv6. *)
-                       IPPROTO_NONE* = 59; (* IPv6 no next header. *)
-                       IPPROTO_DSTOPTS* = 60; (* IPv6 destination options. *)
-                       IPPROTO_MTP* = 92; (* Multicast Transport Protocol. *)
-                       IPPROTO_ENCAP* = 98; (* Encapsulation Header. *)
-                       IPPROTO_PIM* = 103; (* Protocol Independent Multicast. *)
-                       IPPROTO_COMP* = 108; (* Compression Header Protocol. *)
-                       IPPROTO_SCTP* = 132; (* Stream Control Transmission Protocol. *)
-                       IPPROTO_UDPLITE* = 136; (* UDP-Lite protocol. *)
-                       IPPROTO_RAW* = 255; (* Raw IP packets. *)
+               (* /usr/include/i386-linux-gnu/sys/socket.h *)
+                       SHUT_RD* = 0;
+                       SHUT_WR* = 1;
+                       SHUT_RDWR* = 2;
+
+               SOL_SOCKET* = 1;
+
+               (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                       MSG_OOB* = {0};
+                       MSG_PEEK* = {1};
+                       MSG_DONTROUTE* = {2};
+                       MSG_CTRUNC* = {3};
+                       MSG_PROXY* = {4};
+                       MSG_TRUNC* = {5};
+                       MSG_DONTWAIT* = {6};
+                       MSG_EOR* = {7};
+                       MSG_WAITALL* = {8};
+                       MSG_FIN* = {9};
+                       MSG_SYN* = {10};
+                       MSG_CONFIRM* = {11};
+                       MSG_RST* = {12};
+                       MSG_ERRQUEUE* = {13};
+                       MSG_NOSIGNAL* = {14};
+                       MSG_MORE* = {15};
+                       MSG_WAITFORONE* = {16};
+
+               SOMAXCONN* = 128;
 
-               (* /usr/include/asm-generic/param.h *)
-                       MAXHOSTNAMELEN* = 64; (* max length of hostname *)
+               (* addrinfo.ai_flags *)
+                       AI_PASSIVE* = {0}; (* Socket address is intended for `bind'. *)
+                       AI_CANONNAME* = {1}; (* Request for canonical name. *)
+                       AI_NUMERICHOST* = {2}; (* Don't use name resolution. *)
+                       AI_V4MAPPED* = {3}; (* IPv4 mapped addresses are acceptable. *)
+                       AI_ALL* = {4}; (* Return IPv4 mapped and IPv6 addresses. *)
+                       AI_CANONIDN* = {7}; (* Translate canonical name from IDN format. *)
+                       AI_NUMERICSERV* = {10}; (* Don't use name resolution. *)
 
-               (* /usr/include/netdb.h *)
-                       NETDB_INTERNAL* = -1; (* See errno. *)
-                       NETDB_SUCCESS* = 0; (* No problem. *)
-                       HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found. *)
-                       TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL. *)
-                       NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP. *)
-                       NO_DATA* = 4; (* Valid name, no data record of requested type. *)
+               (* getaddrinfo/getnameinfo/gai_strerror error codes *)
+                       EAI_BADFLAGS* = -1; (* Invalid value for `ai_flags' field. *)
+                       EAI_NONAME* = -2; (* NAME or SERVICE is unknown. *)
+                       EAI_AGAIN* = -3; (* Temporary failure in name resolution. *)
+                       EAI_FAIL* = -4; (* Non-recoverable failure in name res. *)
+                       EAI_FAMILY* = -6; (* `ai_family' not supported. *)
+                       EAI_SOCKTYPE* = -7; (* `ai_socktype' not supported. *)
+                       EAI_SERVICE* = -8; (* SERVICE not supported for `ai_socktype'. *)
+                       EAI_MEMORY* = -10; (* Memory allocation failure. *)
+                       EAI_SYSTEM* = -11; (* System error returned in `errno'. *)
+                       EAI_OVERFLOW* = -12; (* Argument buffer overflow. *)
+                       EAI_NODATA* = -5; (* No address associated with NAME. *)
+                       EAI_ADDRFAMILY* = -9; (* Address family for NAME not supported. *)
+                       EAI_INPROGRESS* = -100; (* Processing request in progress. *)
+                       EAI_CANCELED* = -101; (* Request canceled. *)
+                       EAI_NOTCANCELED* = -102; (* Request not canceled. *)
+                       EAI_ALLDONE* = -103; (* All requests done. *)
+                       EAI_INTR* = -104; (* Interrupted by a signal. *)
+                       EAI_IDN_ENCODE* = -105; (* IDN encoding failed. *)
 
                (* /usr/include/i386-linux-gnu/bits/typesizes.h *)
                        __FD_SETSIZE = 1024;
 
        TYPE
-               SOCKET* = INTEGER;
+               u_int8_t = SHORTCHAR;
+               int8_t = SHORTCHAR;
+               uint16_t = SHORTINT;
+               (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
+               PtrVoid* = INTEGER;
+               short* = SHORTINT;
+               int* = INTEGER;
+               intFlags* = SET;
+               size_t* = INTEGER;
+               ssize_t* = INTEGER;
+               time_t* = INTEGER;
+               suseconds_t* = INTEGER;
+               socklen_t* = INTEGER;
+               in_addr_t* = INTEGER;
+               in_port_t* = SHORTINT;
+               nfds_t* = INTEGER;
+               sa_family_t* = SHORTINT;
 
-               (* /usr/include/i386-linux-gnu/bits/types.h *)
-                       socklen_t* = INTEGER;
-               (* /usr/include/i386-linux-gnu/bits/sockaddr.h *)
-                       sa_family_t* = SHORTINT; (* unsigned short int *)
-               (* /usr/include/netinet/in.h *)
-                       in_addr_t* = INTEGER;
-                       in_port_t* = SHORTINT;
+               PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
 
-               (* /usr/include/i386-linux-gnu/bits/socket.h *)
-                       sockaddr* = RECORD [untagged]
-                               sa_family: sa_family_t;
-                               sa_data: ARRAY [untagged] 14 OF SHORTCHAR;
-                       END;
+               SOCKET* = int;
 
-               (* /usr/include/linux/in.h *)
 (*
-                       in_addr* = INTEGER;
+               in_addr* = RECORD [untagged]
+                       s_addr*: in_addr_t;
+               END;
 *)
-                       in_addr* = RECORD [untagged]
-                               S_un*: RECORD [union]
-                                       S_un_b*: RECORD [untagged]
-                                               s_b1*: SHORTCHAR;
-                                               s_b2*: SHORTCHAR;
-                                               s_b3*: SHORTCHAR;
-                                               s_b4*: SHORTCHAR;
-                                       END;
-                                       S_un_w*: RECORD [untagged]
-                                               s_w1*: SHORTINT;
-                                               s_w2*: SHORTINT;
-                                       END;
-                                       S_addr*: in_addr_t;
+               in_addr* = RECORD [untagged]
+                       S_un*: RECORD [union]
+                               S_un_b*: RECORD [untagged]
+                                       s_b1*: SHORTCHAR;
+                                       s_b2*: SHORTCHAR;
+                                       s_b3*: SHORTCHAR;
+                                       s_b4*: SHORTCHAR;
+                               END;
+                               S_un_w*: RECORD [untagged]
+                                       s_w1*: SHORTINT;
+                                       s_w2*: SHORTINT;
                                END;
+                               S_addr*: in_addr_t;
                        END;
+               END;
 
-               (* /usr/include/linux/in.h *)
-                       sockaddr_in* = RECORD [untagged]
+               Ptrsockaddr* = POINTER [untagged] TO sockaddr;
+               sockaddr* = RECORD [untagged]
+                       (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                               sa_family: sa_family_t;
+                               sa_data: ARRAY [untagged] 14 OF SHORTCHAR;
+               END;
+
+               Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
+               sockaddr_storage* = RECORD [untagged]
+                       (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                               sa_family: sa_family_t;
+                               __ss_align: INTEGER;
+                               __ss_padding: ARRAY [untagged] 128 - 2 * 4 OF SHORTCHAR;
+               END;
+
+               Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
+               sockaddr_in* = RECORD [untagged]
+                       (* /usr/include/linux/in.h *)
                                sin_family*: sa_family_t; (* address family *)
                                sin_port*: SHORTINT; (* port number *)
                                sin_addr*: in_addr; (* internet address *)
                                __pad: ARRAY [untagged] 8 OF SHORTCHAR;
-                       END;
+               END;
 
-               (* /usr/include/netdb.h *)
-                       Ptrhostent* = POINTER TO hostent;
-                       hostent* = RECORD [untagged]
-                               h_name*: Libc.PtrSTR; (* official name of host *)
-                               h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *)
-                               h_addrtype*: INTEGER; (* host address type *)
-                               h_length*: INTEGER; (* length of address *)
-                               h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *)
-                       END;
+               Ptraddrinfo* = POINTER [untagged] TO addrinfo;
+               addrinfo* = RECORD [untagged]
+                       (* /usr/include/netdb.h *)
+                               ai_flags*: intFlags; (* input flags *)
+                               ai_family*: int; (* protocol family for socket *)
+                               ai_socktype*: int; (* socket type *)
+                               ai_protocol*: int; (* protocol for socket *)
+                               ai_addrlen*: socklen_t; (* length of socket-address *)
+                               ai_addr*: Ptrsockaddr; (* socket-address for socket *)
+                               ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
+                               ai_next*: Ptraddrinfo; (* pointer to next in list *)
+               END;
 
-               (* /usr/include/linux/time.h *)
-               (* /usr/include/asm-generic/posix_types.h *)
-                       timeval* = RECORD [untagged]
-                               tv_sec*: INTEGER; (* seconds *)
-                               tv_usec*: INTEGER; (* microseconds *)
-                       END;
+               timeval* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_usec*: suseconds_t; (* and microseconds *)
+               END;
+
+               pollfd* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               fd*: int;
+                               events*: short;
+                               revents*: short;
+               END;
 
                (* /usr/include/i386-linux-gnu/sys/select.h *)
                        __fd_mask = SET;
                        fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask;
 
-       VAR
-               h_errno*: INTEGER;
-
-       PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET;
-       PROCEDURE [ccall] accept* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-       PROCEDURE [ccall] bind* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] connect* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] listen* (sockfd: SOCKET; backlog: INTEGER): INTEGER;
-       PROCEDURE [ccall] recv* (soskfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] send* (sockfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] shutdown* (sockfd: SOCKET; how: INTEGER): INTEGER;
-       PROCEDURE [ccall] getsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] setsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER;
+       (* POSIX.1 *)
+               PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
+               PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
+               PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
+               PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
+               PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
+               PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
+               PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
 
-       PROCEDURE [ccall] htons* (hostshort: SHORTINT): SHORTINT;
+               PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
+               PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
 
-       PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent;
-       PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t;
+               PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
 
-       PROCEDURE [ccall] getsockname* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR;
+               PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
 
 (*
        PROCEDURE FD_ZERO (VAR set: Net.fd_set);
@@ -252,6 +334,10 @@ MODULE LinNet ["libc.so.6"];
        END FD_SET;
 *)
 
-       PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER;
+       (* POSIX.1g *)
+               PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
+               PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
+
+               PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
 
-END LinNet.
+END LinNet.
\ No newline at end of file
index 5fe037ad9bf60634bf1f3d0f27e3e1242d3c81b1..26054ee29ba35346d8c91e407fe198e386473577 100644 (file)
@@ -9,16 +9,16 @@ INCDIR ?= /usr/include
 all: mkioctl Ioctl.txt
 
 PY = python2.7
-DEFS = defs-ioctl1 defs-ioctl
+DEFS = defs-tiocm defs-ioctl
 
 defs-ioctl: mkioctl
        ./mkioctl > $@
 
-Ioctl.txt: Ioctl.txt.templ ${DEFS}
+Ioctl.txt: Ioctl.txt.templ ${DEFS} libver osname machine
        ${PY} ./untempl.py Ioctl.txt.templ $@
 
-defs-ioctl1:
-       ./dumpdefs.py 3 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@
+defs-tiocm:
+       ./dumpdefs.py 2 0 s ${INCDIR}/i386-linux-gnu/bits/ioctl-types.h | grep TIOCM_ > $@
 
 clean:
        rm -f mkioctl Ioctl.txt ${DEFS}
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/libver
new file mode 100644 (file)
index 0000000..ed44321
--- /dev/null
@@ -0,0 +1 @@
+.6
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_Linux_/Lin/Mod/gen-Ioctl/osname
new file mode 100644 (file)
index 0000000..48fc79c
--- /dev/null
@@ -0,0 +1 @@
+GNU/Linux
\ No newline at end of file
index 4f00e45d31a47438386c1b85f8ea535463699135..42ef267b0a4854e961501195244cdd6f7a0d19b9 100644 (file)
@@ -1,25 +1,40 @@
-# This is GNU Makefile
+# This is BSD Makefile
 #    BSD       GNU
-# ${.TARGET}    $@
+# $@    $@
 # ${.ALLSRC}    $^
 # ${.IMPSRC}    $<
 
 INCDIR ?= /usr/include
 
-all: Net.txt dumphstrerrno
-
 PY = python2.7
-DEFS = defs-socket defs-so
 
-Net.txt: Net.txt.templ ${DEFS} defs-netdb defs-in defs-sock
+DEFS = defs-basictypes defs-af defs-so defs-sol defs-ai defs-eai defs-somaxconn
+
+all: Net.txt ${DEFS}
+
+Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
        ${PY} ./untempl.py Net.txt.templ $@
 
-defs-socket:
+defs-basictypes: sizeofs
+       ./sizeofs > $@
+
+defs-af:
        ./dumpdefs.py 3 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep "     PF_" > $@
-       ./dumpdefs.py 3 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep "     SOMAXCONN" >> $@
+
+defs-sol:
+       ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/socket.h | grep "     SOL_" > $@
+
+defs-somaxconn:
+       ./dumpdefs.py 2 1 i ${INCDIR}/i386-linux-gnu/bits/socket.h | grep "     SOMAXCONN" > $@
 
 defs-so:
        ./dumpdefs.py 3 1 s ${INCDIR}/asm-generic/socket.h | grep "     SO_" > $@
 
+defs-ai:
+       ./dumpdefs.py 3 2 s ${INCDIR}/netdb.h | grep "  AI_" > $@
+
+defs-eai:
+       ./dumpdefs.py 3 2 i ${INCDIR}/netdb.h | grep "  EAI_" > $@
+
 clean:
-       rm -f Net.txt ${DEFS} dumphstrerrno
+       rm -f ${DEFS} Net.txt sizeofs
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_Linux_/Lin/Mod/gen-Net/Net.txt.templ
deleted file mode 100644 (file)
index 756fa5e..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-MODULE LinNet ["libc.so.6"];
-
-       (*
-               A. V. Shiryaev, 2012.11
-
-               GNU/Linux
-               32-bit
-       *)
-
-       IMPORT Libc := LinLibc;
-
-       CONST
-               INVALID_SOCKET* = -1;
-               SOCKET_ERROR* = -1;
-
-               (* /usr/include/i386-linux-gnu/bits/socket.h *)
-                       SHUT_RD* = 0;
-                       SHUT_WR* = 1;
-                       SHUT_RDWR* = 2;
-%%defs-sock%%
-%%defs-socket%%
-               (* /usr/include/asm-generic/socket.h *)
-%%defs-so%%
-               (* /usr/include/netinet/in.h *)
-                       INADDR_NONE* = -1;
-%%defs-in%%
-               (* /usr/include/asm-generic/param.h *)
-                       MAXHOSTNAMELEN* = 64; (* max length of hostname *)
-
-               (* /usr/include/netdb.h *)
-%%defs-netdb%%
-               (* /usr/include/i386-linux-gnu/bits/typesizes.h *)
-                       __FD_SETSIZE = 1024;
-
-       TYPE
-               SOCKET* = INTEGER;
-
-               (* /usr/include/i386-linux-gnu/bits/types.h *)
-                       socklen_t* = INTEGER;
-               (* /usr/include/i386-linux-gnu/bits/sockaddr.h *)
-                       sa_family_t* = SHORTINT; (* unsigned short int *)
-               (* /usr/include/netinet/in.h *)
-                       in_addr_t* = INTEGER;
-                       in_port_t* = SHORTINT;
-
-               (* /usr/include/i386-linux-gnu/bits/socket.h *)
-                       sockaddr* = RECORD [untagged]
-                               sa_family: sa_family_t;
-                               sa_data: ARRAY [untagged] 14 OF SHORTCHAR;
-                       END;
-
-               (* /usr/include/linux/in.h *)
-(*
-                       in_addr* = INTEGER;
-*)
-                       in_addr* = RECORD [untagged]
-                               S_un*: RECORD [union]
-                                       S_un_b*: RECORD [untagged]
-                                               s_b1*: SHORTCHAR;
-                                               s_b2*: SHORTCHAR;
-                                               s_b3*: SHORTCHAR;
-                                               s_b4*: SHORTCHAR;
-                                       END;
-                                       S_un_w*: RECORD [untagged]
-                                               s_w1*: SHORTINT;
-                                               s_w2*: SHORTINT;
-                                       END;
-                                       S_addr*: in_addr_t;
-                               END;
-                       END;
-
-               (* /usr/include/linux/in.h *)
-                       sockaddr_in* = RECORD [untagged]
-                               sin_family*: sa_family_t; (* address family *)
-                               sin_port*: SHORTINT; (* port number *)
-                               sin_addr*: in_addr; (* internet address *)
-                               __pad: ARRAY [untagged] 8 OF SHORTCHAR;
-                       END;
-
-               (* /usr/include/netdb.h *)
-                       Ptrhostent* = POINTER TO hostent;
-                       hostent* = RECORD [untagged]
-                               h_name*: Libc.PtrSTR; (* official name of host *)
-                               h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *)
-                               h_addrtype*: INTEGER; (* host address type *)
-                               h_length*: INTEGER; (* length of address *)
-                               h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *)
-                       END;
-
-               (* /usr/include/linux/time.h *)
-               (* /usr/include/asm-generic/posix_types.h *)
-                       timeval* = RECORD [untagged]
-                               tv_sec*: INTEGER; (* seconds *)
-                               tv_usec*: INTEGER; (* microseconds *)
-                       END;
-
-               (* /usr/include/i386-linux-gnu/sys/select.h *)
-                       __fd_mask = SET;
-                       fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask;
-
-       VAR
-               h_errno*: INTEGER;
-
-       PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET;
-       PROCEDURE [ccall] accept* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-       PROCEDURE [ccall] bind* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] connect* (sockfd: SOCKET; VAR addr: sockaddr; addrlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] listen* (sockfd: SOCKET; backlog: INTEGER): INTEGER;
-       PROCEDURE [ccall] recv* (soskfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] send* (sockfd: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] shutdown* (sockfd: SOCKET; how: INTEGER): INTEGER;
-       PROCEDURE [ccall] getsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] setsockopt* (sockfd: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] htons* (hostshort: SHORTINT): SHORTINT;
-
-       PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent;
-       PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t;
-
-       PROCEDURE [ccall] getsockname* (sockfd: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR;
-
-(*
-       PROCEDURE FD_ZERO (VAR set: Net.fd_set);
-               VAR i: INTEGER;
-       BEGIN
-               i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
-       END FD_ZERO;
-
-       PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
-       BEGIN
-               INCL(set[fd DIV 32], fd MOD 32)
-       END FD_SET;
-*)
-
-       PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER;
-
-END LinNet.
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-const
new file mode 100644 (file)
index 0000000..4e6a62d
--- /dev/null
@@ -0,0 +1,2 @@
+               (* /usr/include/i386-linux-gnu/bits/typesizes.h *)
+                       __FD_SETSIZE = 1024;
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-fd_set-type
new file mode 100644 (file)
index 0000000..23da835
--- /dev/null
@@ -0,0 +1,3 @@
+               (* /usr/include/i386-linux-gnu/sys/select.h *)
+                       __fd_mask = SET;
+                       fd_set* = ARRAY [untagged] __FD_SETSIZE DIV (SIZE(__fd_mask) * 8) OF __fd_mask;
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-msg
new file mode 100644 (file)
index 0000000..938b43d
--- /dev/null
@@ -0,0 +1,18 @@
+               (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                       MSG_OOB* = {0};
+                       MSG_PEEK* = {1};
+                       MSG_DONTROUTE* = {2};
+                       MSG_CTRUNC* = {3};
+                       MSG_PROXY* = {4};
+                       MSG_TRUNC* = {5};
+                       MSG_DONTWAIT* = {6};
+                       MSG_EOR* = {7};
+                       MSG_WAITALL* = {8};
+                       MSG_FIN* = {9};
+                       MSG_SYN* = {10};
+                       MSG_CONFIRM* = {11};
+                       MSG_RST* = {12};
+                       MSG_ERRQUEUE* = {13};
+                       MSG_NOSIGNAL* = {14};
+                       MSG_MORE* = {15};
+                       MSG_WAITFORONE* = {16};
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-netdb
deleted file mode 100644 (file)
index 4b218bb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-                       NETDB_INTERNAL* = -1; (* See errno. *)
-                       NETDB_SUCCESS* = 0; (* No problem. *)
-                       HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found. *)
-                       TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL. *)
-                       NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP. *)
-                       NO_DATA* = 4; (* Valid name, no data record of requested type. *)
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut b/BlackBox/_Linux_/Lin/Mod/gen-Net/defs-shut
new file mode 100644 (file)
index 0000000..52bab53
--- /dev/null
@@ -0,0 +1,4 @@
+               (* /usr/include/i386-linux-gnu/sys/socket.h *)
+                       SHUT_RD* = 0;
+                       SHUT_WR* = 1;
+                       SHUT_RDWR* = 2;
index 158217a465c3cb9b167d9e6c81be44289ebf4b57..dbfa8daba543b4bf51052235a793990f22566b1e 100644 (file)
@@ -1,7 +1,8 @@
-                       SOCK_STREAM* = 1;
-                       SOCK_DGRAM* = 2;
-                       SOCK_RAW* = 3;
-                       SOCK_RDM* = 4;
-                       SOCK_SEQPACKET* = 5;
-                       SOCK_DCCP* = 6;
-                       SOCK_PACKET* = 10;
+                       (* /usr/include/i386-linux-gnu/bits/socket_type.h *)
+                               SOCK_STREAM* = 1;
+                               SOCK_DGRAM* = 2;
+                               SOCK_RAW* = 3;
+                               SOCK_RDM* = 4;
+                               SOCK_SEQPACKET* = 5;
+                               SOCK_DCCP* = 6;
+                               SOCK_PACKET* = 10;
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c b/BlackBox/_Linux_/Lin/Mod/gen-Net/dumphstrerrno.c
deleted file mode 120000 (symlink)
index d87b25c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../../_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-addrinfo
new file mode 100644 (file)
index 0000000..be67885
--- /dev/null
@@ -0,0 +1,9 @@
+                       (* /usr/include/netdb.h *)
+                               ai_flags*: intFlags; (* input flags *)
+                               ai_family*: int; (* protocol family for socket *)
+                               ai_socktype*: int; (* socket type *)
+                               ai_protocol*: int; (* protocol for socket *)
+                               ai_addrlen*: socklen_t; (* length of socket-address *)
+                               ai_addr*: Ptrsockaddr; (* socket-address for socket *)
+                               ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
+                               ai_next*: Ptraddrinfo; (* pointer to next in list *)
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr
new file mode 100644 (file)
index 0000000..1e0d5f0
--- /dev/null
@@ -0,0 +1,3 @@
+                       (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                               sa_family: sa_family_t;
+                               sa_data: ARRAY [untagged] 14 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_in
new file mode 100644 (file)
index 0000000..bbeb0ae
--- /dev/null
@@ -0,0 +1,5 @@
+                       (* /usr/include/linux/in.h *)
+                               sin_family*: sa_family_t; (* address family *)
+                               sin_port*: SHORTINT; (* port number *)
+                               sin_addr*: in_addr; (* internet address *)
+                               __pad: ARRAY [untagged] 8 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_Linux_/Lin/Mod/gen-Net/fields-sockaddr_storage
new file mode 100644 (file)
index 0000000..fbf8dd2
--- /dev/null
@@ -0,0 +1,4 @@
+                       (* /usr/include/i386-linux-gnu/bits/socket.h *)
+                               sa_family: sa_family_t;
+                               __ss_align: INTEGER;
+                               __ss_padding: ARRAY [untagged] 128 - 2 * 4 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/libver b/BlackBox/_Linux_/Lin/Mod/gen-Net/libver
new file mode 100644 (file)
index 0000000..ed44321
--- /dev/null
@@ -0,0 +1 @@
+.6
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/machine b/BlackBox/_Linux_/Lin/Mod/gen-Net/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Net/osname b/BlackBox/_Linux_/Lin/Mod/gen-Net/osname
new file mode 100644 (file)
index 0000000..48fc79c
--- /dev/null
@@ -0,0 +1 @@
+GNU/Linux
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/BlackBox1.run b/BlackBox/_OpenBSD_/BlackBox1.run
new file mode 100755 (executable)
index 0000000..fb36a87
Binary files /dev/null and b/BlackBox/_OpenBSD_/BlackBox1.run differ
index 03c1f86eda8388dd08b2f1f144b1a3e8226d0328..e5c7a31e8bacbb663d11fc6e50a6e94cb14440bd 100644 (file)
Binary files a/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc and b/BlackBox/_OpenBSD_/Comm/Mod/TCP.odc differ
diff --git a/BlackBox/_OpenBSD_/Host/Mod/Console.odc b/BlackBox/_OpenBSD_/Host/Mod/Console.odc
deleted file mode 100644 (file)
index 2c44d6c..0000000
Binary files a/BlackBox/_OpenBSD_/Host/Mod/Console.odc and /dev/null differ
index ed81f4de386acf67614f3a80a32133d34e3ae6df..7cc6abd0cd0abdc817385a7922d43bb1fc0f5657 100644 (file)
@@ -1,9 +1,9 @@
-MODULE LinDl ["ld.so"];
+MODULE LinDl ["libc.so.89.2"];
 
        (*
                A. V. Shiryaev, 2012.09, 2013.08
 
-               OpenBSD 5.4
+               OpenBSD 5.6
                32-bit
        *)
 
index e1a1f38a049bbd45d7f8ae24dc12626b8d4a537e..b03ca447692f9e1b37bab1458afa80b2ab9b807e 100644 (file)
@@ -1,4 +1,4 @@
-MODULE LinIconv ["libiconv.so.6"];
+MODULE LinIconv ["libiconv.so.6.0"];
 
        IMPORT Libc := LinLibc;
 
index 51947f484745d4393a3da968088cc7ba2a8901fd..286fa75f882ea49e6b5e4f12f5156b16255fb6de 100644 (file)
@@ -1,23 +1,20 @@
-MODULE LinIoctl ["libc.so.70.0"];
+MODULE LinIoctl ["libc.so.89.2"];
 
        (*
-               A. V. Shiryaev, 2012.11, 2013.08
-
-               OpenBSD 5.4
-               32-bit
+               OpenBSD 6.0
+               i386
        *)
 
        CONST
-               (* /usr/include/sys/ttycom.h *)
-                       TIOCM_LE* = {0}; (* line enable *)
-                       TIOCM_DTR* = {1}; (* data terminal ready *)
-                       TIOCM_RTS* = {2}; (* request to send *)
-                       TIOCM_ST* = {3}; (* secondary transmit *)
-                       TIOCM_SR* = {4}; (* secondary receive *)
-                       TIOCM_CTS* = {5}; (* clear to send *)
-                       TIOCM_CAR* = {6}; (* carrier detect *)
-                       TIOCM_RNG* = {7}; (* ring *)
-                       TIOCM_DSR* = {8}; (* data set ready *)
+               TIOCM_LE* = {0}; (* line enable *)
+               TIOCM_DTR* = {1}; (* data terminal ready *)
+               TIOCM_RTS* = {2}; (* request to send *)
+               TIOCM_ST* = {3}; (* secondary transmit *)
+               TIOCM_SR* = {4}; (* secondary receive *)
+               TIOCM_CTS* = {5}; (* clear to send *)
+               TIOCM_CAR* = {6}; (* carrier detect *)
+               TIOCM_RNG* = {7}; (* ring *)
+               TIOCM_DSR* = {8}; (* data set ready *)
 
                FIOCLEX* = 536897025;
                FIONCLEX* = 536897026;
@@ -43,4 +40,4 @@ MODULE LinIoctl ["libc.so.70.0"];
        PROCEDURE [ccall] ioctl0* ["ioctl"] (d: INTEGER; req: INTEGER): INTEGER;
        PROCEDURE [ccall] ioctl1* ["ioctl"] (d: INTEGER; req: INTEGER; VAR arg: INTEGER): INTEGER;
 
-END LinIoctl.
+END LinIoctl.
\ No newline at end of file
index 7df4f73e3e71556fdeddd73142d4c332d47cb38f..b2d0251e2306152f9d2c439338df03145b19958b 100644 (file)
@@ -1,7 +1,7 @@
-MODULE LinLibc ["libc.so.70.0"];
+MODULE LinLibc ["libc.so.89.2"];
 
        (*
-               OpenBSD 5.4
+               OpenBSD 6.0
                i386
        *)
 
@@ -17,20 +17,14 @@ MODULE LinLibc ["libc.so.70.0"];
                (* MAP_PRIVATE, MAP_ANON (intFlags) *)
                MAP_SHARED* = {0}; (* share changes *)
                MAP_PRIVATE* = {1}; (* changes are private *)
-               MAP_COPY* = {2}; (* "copy" region at mmap time *)
                MAP_FIXED* = {4}; (* map addr must be exactly as requested *)
-               MAP_RENAME* = {5}; (* Sun: rename private pages to file *)
-               MAP_NORESERVE* = {6}; (* Sun: don't reserve needed swap area *)
-               MAP_INHERIT* = {7}; (* region is retained after exec *)
-               MAP_NOEXTEND* = {8}; (* for MAP_FILE, don't change file size *)
-               MAP_HASSEMAPHORE* = {9}; (* region may contain semaphores *)
-               MAP_TRYFIXED* = {10}; (* attempt hint address, even within heap *)
-               MAP_FILE* = {}; (* map from file (default) *)
                MAP_ANON* = {12}; (* allocated from memory, swap space *)
-               MAP_FLAGMASK* = {0..2,4..12};
+               MAP_ANONYMOUS* = MAP_ANON; (* alternate POSIX spelling *)
+               MAP_FLAGMASK* = {0..2,4..13};
                MAP_INHERIT_SHARE* = {}; (* share with child *)
                MAP_INHERIT_COPY* = {0}; (* copy into child *)
                MAP_INHERIT_NONE* = {1}; (* absent from child *)
+               MAP_INHERIT_ZERO* = {0,1}; (* zero in child *)
 
 
                (* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
@@ -297,12 +291,15 @@ MODULE LinLibc ["libc.so.70.0"];
                ECONNREFUSED* = 61; (* Connection refused *)
                ELOOP* = 62; (* Too many levels of symbolic links *)
                ENAMETOOLONG* = 63; (* File name too long *)
+               EHOSTUNREACH* = 65; (* No route to host *)
                ENOTEMPTY* = 66; (* Directory not empty *)
                EDQUOT* = 69; (* Disk quota exceeded *)
                ESTALE* = 70; (* Stale NFS file handle *)
                ENOLCK* = 77; (* No locks available *)
                ENOSYS* = 78; (* Function not implemented *)
                EILSEQ* = 84; (* Illegal byte sequence *)
+               EOVERFLOW* = 87; (* Value too large to be stored in data type *)
+               ECANCELED* = 88; (* Operation canceled *)
                EIDRM* = 89; (* Identifier removed *)
                ENOMSG* = 90; (* No message of desired type *)
                ENOTSUP* = 91; (* Not supported *)
@@ -312,13 +309,12 @@ MODULE LinLibc ["libc.so.70.0"];
                ESHUTDOWN* = 58; (* Can't send after socket shutdown *)
                ETOOMANYREFS* = 59; (* Too many references: can't splice *)
                EHOSTDOWN* = 64; (* Host is down *)
-               EHOSTUNREACH* = 65; (* No route to host *)
                EPROCLIM* = 67; (* Too many processes *)
                EUSERS* = 68; (* Too many users *)
                EREMOTE* = 71; (* Too many levels of remote in path *)
                EBADRPC* = 72; (* RPC struct is bad *)
                ERPCMISMATCH* = 73; (* RPC version wrong *)
-               EPROGUNAVAIL* = 74; (* RPC prog. not avail *)
+               EPROGUNAVAIL* = 74; (* RPC program not available *)
                EPROGMISMATCH* = 75; (* Program version wrong *)
                EPROCUNAVAIL* = 76; (* Bad procedure for program *)
                EFTYPE* = 79; (* Inappropriate file type or format *)
@@ -327,9 +323,7 @@ MODULE LinLibc ["libc.so.70.0"];
                EIPSEC* = 82; (* IPsec processing failure *)
                ENOATTR* = 83; (* Attribute not found *)
                ENOMEDIUM* = 85; (* No medium found *)
-               EMEDIUMTYPE* = 86; (* Wrong Medium Type *)
-               EOVERFLOW* = 87; (* Conversion overflow *)
-               ECANCELED* = 88; (* Operation canceled *)
+               EMEDIUMTYPE* = 86; (* Wrong medium type *)
                ELAST* = 91; (* Must be equal largest errno *)
                ERESTART* = -1; (* restart syscall *)
                EJUSTRETURN* = -2; (* don't modify regs, just return *)
@@ -341,6 +335,10 @@ MODULE LinLibc ["libc.so.70.0"];
                SEEK_CUR* = 1;
                SEEK_END* = 2;
 
+               STDIN_FILENO* = 0;
+               STDOUT_FILENO* = 1;
+               STDERR_FILENO* = 2;
+
                P_tmpdir* = "/tmp";
 
                (* O_RDWR, O_NONBLOCK (intFlags) *)
@@ -366,7 +364,6 @@ MODULE LinLibc ["libc.so.70.0"];
 
 
                CLOCK_REALTIME* = 0;
-               CLOCK_VIRTUAL* = 1;
                CLOCK_PROCESS_CPUTIME_ID* = 2;
                CLOCK_MONOTONIC* = 3;
                CLOCK_THREAD_CPUTIME_ID* = 4;
@@ -396,6 +393,8 @@ MODULE LinLibc ["libc.so.70.0"];
                dev_t* = INTEGER;
                ino_t* = LONGINT;
                nlink_t* = INTEGER;
+               blkcnt_t = LONGINT;
+               blksize_t = INTEGER;
                int8_t* = SHORTCHAR;
                u_int8_t* = SHORTCHAR;
                int16_t* = SHORTINT;
@@ -415,7 +414,7 @@ MODULE LinLibc ["libc.so.70.0"];
                tmDesc* = RECORD [untagged]
                        (* NOTE: check record size *)
                        (* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *)
-                       (* OpenBSD 5.4 /usr/include/time.h *)
+                       (* OpenBSD 6.0 /usr/include/time.h *)
                                tm_sec*: int; (* seconds after the minute [0-60] *)
                                tm_min*: int; (* minutes after the hour [0-59] *)
                                tm_hour*: int; (* hours since midnight [0-23] *)
@@ -432,7 +431,7 @@ MODULE LinLibc ["libc.so.70.0"];
                Ptrsiginfo_t* = POINTER TO siginfo_t;
                siginfo_t = RECORD [untagged]
                        (* si_code, fault address *)
-                       (* OpenBSD 5.4 /usr/include/sys/siginfo.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/siginfo.h *)
                                si_signo*: int; (* signal from signal.h *)
                                si_code*: int; (* code from above *)
                                si_errno*: int; (* error from errno.h *)
@@ -465,7 +464,7 @@ MODULE LinLibc ["libc.so.70.0"];
                Ptrucontext_t* = POINTER TO ucontext_t;
                ucontext_t = RECORD [untagged]
                        (* IP, SP, FP *)
-                       (* OpenBSD 5.4 /usr/include/i386/signal.h struct sigcontext *)
+                       (* OpenBSD 5.9 /usr/include/i386/signal.h struct sigcontext *)
                                sc_gs*: int;
                                sc_fs*: int;
                                sc_es*: int;
@@ -491,7 +490,7 @@ MODULE LinLibc ["libc.so.70.0"];
                                sc_err*: int;
 
                                sc_fpstate*: RECORD [union]
-                                       (* OpenBSD 5.4 /usr/include/i386/npx.h union savefpu *)
+                                       (* OpenBSD 5.9 /usr/include/i386/npx.h union savefpu *)
 (*
                                                sv_87*: RECORD [untagged]
                                                        ...
@@ -508,7 +507,7 @@ MODULE LinLibc ["libc.so.70.0"];
                        sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; context: Ptrucontext_t),
                        sa_flags*: intFlags, sa_mask*: sigset_t
 *)
-                       (* OpenBSD 5.4 /usr/include/sys/signal.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/signal.h *)
                                sa_sigaction*: PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; ctx: Ptrucontext_t);
                                sa_mask*: sigset_t;
                                sa_flags*: intFlags;
@@ -518,7 +517,7 @@ MODULE LinLibc ["libc.so.70.0"];
 (*
                        ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags
 *)
-                       (* OpenBSD 5.4 /usr/include/sys/signal.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/signal.h *)
                                ss_sp*: PtrVoid; (* signal stack base *)
                                ss_size*: size_t; (* signal stack length *)
                                ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *)
@@ -529,7 +528,7 @@ MODULE LinLibc ["libc.so.70.0"];
                        NOTE: check record size
                        st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t
 *)
-                       (* OpenBSD 5.4 /usr/include/sys/stat.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/stat.h *)
                                st_mode*: mode_t;
                                st_dev*: dev_t;
                                st_ino*: ino_t;
@@ -546,8 +545,8 @@ MODULE LinLibc ["libc.so.70.0"];
                                st_ctimensec*: long;
 
                                st_size*: off_t;
-                               st_blocks*: int64_t;
-                               st_blksize*: u_int32_t;
+                               st_blocks*: blkcnt_t;
+                               st_blksize*: blksize_t;
                                st_flags*: u_int32_t;
                                st_gen*: u_int32_t;
 
@@ -563,7 +562,7 @@ MODULE LinLibc ["libc.so.70.0"];
 (*
                        d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR
 *)
-                       (* OpenBSD 5.4 /usr/include/sys/dirent.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/dirent.h *)
                                d_fileno*: ino_t; (* file number of entry *)
                                d_off*: off_t; (* offset after this entry *)
                                d_reclen*: u_int16_t; (* length of this record *)
@@ -574,7 +573,7 @@ MODULE LinLibc ["libc.so.70.0"];
                END;
 
                timespec_t* = RECORD [untagged]
-                       (* OpenBSD 5.4 /usr/include/time.h *)
+                       (* OpenBSD 5.9 /usr/include/time.h *)
                                tv_sec*: time_t; (* seconds *)
                                tv_nsec*: long; (* and nanoseconds *)
                END;
@@ -591,14 +590,16 @@ MODULE LinLibc ["libc.so.70.0"];
        (* POSIX.1 *)
                PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
 *)
+(*
        VAR
                (* OpenBSD: stdin, stdout, stderr *)
-                       __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.2 /usr/include/stdio.h *)
+                       __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.8 /usr/include/stdio.h *)
                                (*
                                        stdin = SYSTEM.ADR(__sF[0])
                                        stdout = SYSTEM.ADR(__sF[1])
                                        stderr = SYSTEM.ADR(__sF[2])
                                *)
+*)
 
        PROCEDURE [ccall] __errno_location* ["__errno"] (): PtrVoid;
 
@@ -650,6 +651,7 @@ MODULE LinLibc ["libc.so.70.0"];
 
        (* ANSI C 89 *)
                PROCEDURE [ccall] fopen* (path, mode: PtrSTR): PtrFILE;
+               PROCEDURE [ccall] fdopen* (fildes: int; mode: PtrSTR): PtrFILE;
                PROCEDURE [ccall] fclose* (stream: PtrFILE): int;
                PROCEDURE [ccall] fread* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
                PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size: size_t; nmemb: size_t; stream: PtrFILE): size_t;
index 4b744621e77a19ef4e34cf3184f01b87b317b790..bee2677d8353dff37541dd3ac081b80f061f9976 100644 (file)
@@ -1,24 +1,20 @@
-MODULE LinNet ["libc.so.70.0"];
+MODULE LinNet ["libc.so.89.2"];
 
        (*
-               A. V. Shiryaev, 2012.11, 2013.08
-
-               OpenBSD 5.4
-               32-bit
+               OpenBSD 6.0
+               i386
        *)
 
-       IMPORT Libc := LinLibc;
-
        CONST
-               INVALID_SOCKET* = -1;
+               NULL* = 0H;
+
                SOCKET_ERROR* = -1;
+               INVALID_SOCKET* = -1;
 
-               (* /usr/include/sys/socket.h *)
-                       SOCK_STREAM* = 1; (* stream socket *)
-                       SOCK_DGRAM* = 2; (* datagram socket *)
-                       SOCK_RAW* = 3; (* raw-protocol interface *)
-                       SOCK_RDM* = 4; (* reliably-delivered message *)
-                       SOCK_SEQPACKET* = 5; (* sequenced packet stream *)
+               INADDR_NONE* = -1;
+               INADDR_ANY* = 0;
+
+               (* socket domains *)
                        AF_UNSPEC* = 0; (* unspecified *)
                        AF_LOCAL* = 1; (* local to host (pipes, portals) *)
                        AF_UNIX* = AF_LOCAL; (* backward compatibility *)
@@ -52,49 +48,15 @@ MODULE LinNet ["libc.so.70.0"];
                        AF_BLUETOOTH* = 32; (* Bluetooth *)
                        AF_MPLS* = 33; (* MPLS *)
                        AF_MAX* = 36;
-                       SHUT_RD* = 0;
-                       SHUT_WR* = 1;
-                       SHUT_RDWR* = 2;
-                       SOMAXCONN* = 128;
-                       SO_DEBUG* = {0}; (* turn on debugging info recording *)
-                       SO_ACCEPTCONN* = {1}; (* socket has had listen() *)
-                       SO_REUSEADDR* = {2}; (* allow local address reuse *)
-                       SO_KEEPALIVE* = {3}; (* keep connections alive *)
-                       SO_DONTROUTE* = {4}; (* just use interface addresses *)
-                       SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *)
-                       SO_USELOOPBACK* = {6}; (* bypass hardware when possible *)
-                       SO_LINGER* = {7}; (* linger on close if data present *)
-                       SO_OOBINLINE* = {8}; (* leave received OOB data in line *)
-                       SO_REUSEPORT* = {9}; (* allow local address & port reuse *)
-                       SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *)
-                       SO_BINDANY* = {12}; (* allow bind to any address *)
-                       SO_SNDBUF* = {0,12}; (* send buffer size *)
-                       SO_RCVBUF* = {1,12}; (* receive buffer size *)
-                       SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *)
-                       SO_RCVLOWAT* = {2,12}; (* receive low-water mark *)
-                       SO_SNDTIMEO* = {0,2,12}; (* send timeout *)
-                       SO_RCVTIMEO* = {1,2,12}; (* receive timeout *)
-                       SO_ERROR* = {0..2,12}; (* get error status and clear *)
-                       SO_TYPE* = {3,12}; (* get socket type *)
-                       SO_NETPROC* = {5,12}; (* multiplex; network processing *)
-                       SO_RTABLE* = {0,5,12}; (* routing table to be used *)
-                       SO_PEERCRED* = {1,5,12}; (* get connect-time credentials *)
-                       SO_SPLICE* = {0,1,5,12}; (* splice data to other socket *)
-                       SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *)
-                       MSG_OOB* = {0}; (* process out-of-band data *)
-                       MSG_PEEK* = {1}; (* peek at incoming message *)
-                       MSG_DONTROUTE* = {2}; (* send without using routing tables *)
-                       MSG_EOR* = {3}; (* data completes record *)
-                       MSG_TRUNC* = {4}; (* data discarded before delivery *)
-                       MSG_CTRUNC* = {5}; (* control data lost before delivery *)
-                       MSG_WAITALL* = {6}; (* wait for full request or error *)
-                       MSG_DONTWAIT* = {7}; (* this message should be nonblocking *)
-                       MSG_BCAST* = {8}; (* this message rec'd as broadcast *)
-                       MSG_MCAST* = {9}; (* this message rec'd as multicast *)
-                       MSG_NOSIGNAL* = {10}; (* do not send SIGPIPE *)
-
-               (* /usr/include/netinet/in.h *)
-                       INADDR_NONE* = -1;
+
+               (* socket types *)
+                       SOCK_STREAM* = 1; (* stream socket *)
+                       SOCK_DGRAM* = 2; (* datagram socket *)
+                       SOCK_RAW* = 3; (* raw-protocol interface *)
+                       SOCK_RDM* = 4; (* reliably-delivered message *)
+                       SOCK_SEQPACKET* = 5; (* sequenced packet stream *)
+
+               (* socket protocols *)
                        IPPROTO_IP* = 0; (* dummy for IP *)
                        IPPROTO_HOPOPTS* = IPPROTO_IP; (* Hop-by-hop option header *)
                        IPPROTO_ICMP* = 1; (* control message protocol *)
@@ -134,126 +96,203 @@ MODULE LinNet ["libc.so.70.0"];
                        IPPROTO_DIVERT_RESP* = 01H; (* {0} *) (* divert response packets *)
                        IPPROTO_DIVERT_INIT* = 02H; (* {1} *) (* divert packets initial direction *)
 
-               (* /usr/include/sys/param.h *)
-                       MAXHOSTNAMELEN* = 256; (* max hostname size *)
-
-               (* /usr/include/netdb.h *)
-                       NETDB_INTERNAL* = -1; (* see errno *)
-                       NETDB_SUCCESS* = 0; (* no problem *)
-                       HOST_NOT_FOUND* = 1; (* Authoritative Answer Host not found *)
-                       TRY_AGAIN* = 2; (* Non-Authoritative Host not found, or SERVERFAIL *)
-                       NO_RECOVERY* = 3; (* Non recoverable errors, FORMERR, REFUSED, NOTIMP *)
-                       NO_DATA* = 4; (* Valid name, no data record of requested type *)
-                       NO_ADDRESS* = NO_DATA; (* no address *)
-                       NI_MAXHOST* = MAXHOSTNAMELEN; (* max host name returned by getnameinfo *)
-                       NI_MAXSERV* = 32; (* max serv. name length returned by getnameinfo *)
-                       RRSET_VALIDATED* = 1;
-                       ERRSET_SUCCESS* = 0;
-                       ERRSET_NOMEMORY* = 1;
-                       ERRSET_FAIL* = 2;
-                       ERRSET_INVAL* = 3;
-                       ERRSET_NONAME* = 4;
-                       ERRSET_NODATA* = 5;
-
-               (* /usr/include/sys/select.h *)
+               (* socket options *)
+                       SO_DEBUG* = {0}; (* turn on debugging info recording *)
+                       SO_ACCEPTCONN* = {1}; (* socket has had listen() *)
+                       SO_REUSEADDR* = {2}; (* allow local address reuse *)
+                       SO_KEEPALIVE* = {3}; (* keep connections alive *)
+                       SO_DONTROUTE* = {4}; (* just use interface addresses *)
+                       SO_BROADCAST* = {5}; (* permit sending of broadcast msgs *)
+                       SO_USELOOPBACK* = {6}; (* bypass hardware when possible *)
+                       SO_LINGER* = {7}; (* linger on close if data present *)
+                       SO_OOBINLINE* = {8}; (* leave received OOB data in line *)
+                       SO_REUSEPORT* = {9}; (* allow local address & port reuse *)
+                       SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *)
+                       SO_BINDANY* = {12}; (* allow bind to any address *)
+                       SO_SNDBUF* = {0,12}; (* send buffer size *)
+                       SO_RCVBUF* = {1,12}; (* receive buffer size *)
+                       SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *)
+                       SO_RCVLOWAT* = {2,12}; (* receive low-water mark *)
+                       SO_SNDTIMEO* = {0,2,12}; (* send timeout *)
+                       SO_RCVTIMEO* = {1,2,12}; (* receive timeout *)
+                       SO_ERROR* = {0..2,12}; (* get error status and clear *)
+                       SO_TYPE* = {3,12}; (* get socket type *)
+                       SO_NETPROC* = {5,12}; (* multiplex; network processing *)
+                       SO_RTABLE* = {0,5,12}; (* routing table to be used *)
+                       SO_PEERCRED* = {1,5,12}; (* get connect-time credentials *)
+                       SO_SPLICE* = {0,1,5,12}; (* splice data to other socket *)
+
+               SHUT_RD* = 0;
+               SHUT_WR* = 1;
+               SHUT_RDWR* = 2;
+
+               SOL_SOCKET* = 0FFFFH; (* {0..15} *) (* options for socket level *)
+
+               MSG_OOB* = {0}; (* process out-of-band data *)
+               MSG_PEEK* = {1}; (* peek at incoming message *)
+               MSG_DONTROUTE* = {2}; (* send without using routing tables *)
+               MSG_EOR* = {3}; (* data completes record *)
+               MSG_TRUNC* = {4}; (* data discarded before delivery *)
+               MSG_CTRUNC* = {5}; (* control data lost before delivery *)
+               MSG_WAITALL* = {6}; (* wait for full request or error *)
+               MSG_DONTWAIT* = {7}; (* this message should be nonblocking *)
+               MSG_BCAST* = {8}; (* this message rec'd as broadcast *)
+               MSG_MCAST* = {9}; (* this message rec'd as multicast *)
+               MSG_NOSIGNAL* = {10}; (* do not send SIGPIPE *)
+               MSG_CMSG_CLOEXEC* = {11}; (* set FD_CLOEXEC on received fds *)
+
+               SOMAXCONN* = 128;
+
+               (* addrinfo.ai_flags *)
+                       AI_PASSIVE* = {0}; (* socket address is intended for bind() *)
+                       AI_CANONNAME* = {1}; (* request for canonical name *)
+                       AI_NUMERICHOST* = {2}; (* don't ever try hostname lookup *)
+                       AI_EXT* = {3}; (* enable non-portable extensions *)
+                       AI_NUMERICSERV* = {4}; (* don't ever try servname lookup *)
+                       AI_FQDN* = {5}; (* return the FQDN that was resolved *)
+                       AI_ADDRCONFIG* = {6}; (* return configured address families only *)
+
+               (* getaddrinfo/getnameinfo/gai_strerror error codes *)
+                       EAI_BADFLAGS* = -1; (* invalid value for ai_flags *)
+                       EAI_NONAME* = -2; (* name or service is not known *)
+                       EAI_AGAIN* = -3; (* temporary failure in name resolution *)
+                       EAI_FAIL* = -4; (* non-recoverable failure in name resolution *)
+                       EAI_NODATA* = -5; (* no address associated with name *)
+                       EAI_FAMILY* = -6; (* ai_family not supported *)
+                       EAI_SOCKTYPE* = -7; (* ai_socktype not supported *)
+                       EAI_SERVICE* = -8; (* service not supported for ai_socktype *)
+                       EAI_ADDRFAMILY* = -9; (* address family for name not supported *)
+                       EAI_MEMORY* = -10; (* memory allocation failure *)
+                       EAI_SYSTEM* = -11; (* system error (code indicated in errno) *)
+                       EAI_BADHINTS* = -12; (* invalid value for hints *)
+                       EAI_PROTOCOL* = -13; (* resolved protocol is unknown *)
+                       EAI_OVERFLOW* = -14; (* argument buffer overflow *)
+
+               (* OpenBSD 6.0 /usr/include/sys/select.h *)
                        FD_SETSIZE = 1024;
                        __NBBY = 8;
 
        TYPE
-               SOCKET* = INTEGER;
+               u_int8_t = SHORTCHAR;
+               int8_t = SHORTCHAR;
+               uint16_t = SHORTINT;
+               (* PtrVoid, int, intFlags, short, socklen_t, size_t, ssize_t, in_addr_t, in_port_t, time_t, suseconds_t, nfds_t, sa_family_t *)
+               PtrVoid* = INTEGER;
+               short* = SHORTINT;
+               int* = INTEGER;
+               intFlags* = SET;
+               size_t* = INTEGER;
+               ssize_t* = INTEGER;
+               time_t* = LONGINT;
+               suseconds_t* = INTEGER;
+               socklen_t* = INTEGER;
+               in_addr_t* = INTEGER;
+               in_port_t* = SHORTINT;
+               nfds_t* = INTEGER;
+               sa_family_t* = SHORTCHAR;
+
+               PtrSTR* = POINTER [untagged] TO ARRAY [untagged] OF SHORTCHAR;
+
+               SOCKET* = int;
 
-               (* /usr/include/sys/_types.h *)
-                       socklen_t* = INTEGER;
-                       sa_family_t* = SHORTCHAR;
-                       in_addr_t* = INTEGER;
-                       in_port_t* = SHORTINT;
+(*
+               in_addr* = RECORD [untagged]
+                       s_addr*: in_addr_t;
+               END;
+*)
+               in_addr* = RECORD [untagged]
+                       S_un*: RECORD [union]
+                               S_un_b*: RECORD [untagged]
+                                       s_b1*: SHORTCHAR;
+                                       s_b2*: SHORTCHAR;
+                                       s_b3*: SHORTCHAR;
+                                       s_b4*: SHORTCHAR;
+                               END;
+                               S_un_w*: RECORD [untagged]
+                                       s_w1*: SHORTINT;
+                                       s_w2*: SHORTINT;
+                               END;
+                               S_addr*: in_addr_t;
+                       END;
+               END;
 
-               (* /usr/include/sys/socket.h *)
-                       sockaddr* = RECORD [untagged]
+               Ptrsockaddr* = POINTER [untagged] TO sockaddr;
+               sockaddr* = RECORD [untagged]
+                       (* OpenBSD /usr/include/sys/socket.h *)
                                sa_len*: SHORTCHAR; (* total length *)
                                sa_family*: sa_family_t; (* address family *)
                                sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
-                       END;
-                       sockaddr_storage* = RECORD [untagged]
+               END;
+
+               Ptrsockaddr_storage = POINTER [untagged] TO sockaddr_storage;
+               sockaddr_storage* = RECORD [untagged]
+                       (* OpenBSD 6.0 /usr/include/sys/socket.h *)
                                ss_len*: SHORTCHAR; (* total length *)
                                ss_family*: sa_family_t; (* address family *)
                                __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *)
                                __ss_pad2: LONGINT; (* force alignment for stupid compilers *)
                                __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *)
-                       END;
-
-               (* /usr/include/netinet/in.h *)
-(*
-                       in_addr* = RECORD [untagged]
-                               s_addr*: in_addr_t;
-                       END;
-*)
-                       in_addr* = RECORD [untagged]
-                               S_un*: RECORD [union]
-                                       S_un_b*: RECORD [untagged]
-                                               s_b1*: SHORTCHAR;
-                                               s_b2*: SHORTCHAR;
-                                               s_b3*: SHORTCHAR;
-                                               s_b4*: SHORTCHAR;
-                                       END;
-                                       S_un_w*: RECORD [untagged]
-                                               s_w1*: SHORTINT;
-                                               s_w2*: SHORTINT;
-                                       END;
-                                       S_addr*: in_addr_t;
-                               END;
-                       END;
+               END;
 
-                       sockaddr_in* = RECORD [untagged]
-                               sin_len*: SHORTCHAR;
+               Ptrsockaddr_in* = POINTER [untagged] TO sockaddr_in;
+               sockaddr_in* = RECORD [untagged]
+                       (* OpenBSD /usr/include/netinet/in.h *)
+                               sin_len*: u_int8_t;
                                sin_family*: sa_family_t;
                                sin_port*: in_port_t;
                                sin_addr*: in_addr;
-                               sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR;
-                       END;
+                               sin_zero*: ARRAY [untagged] 8 OF int8_t;
+               END;
 
-               (* /usr/include/netdb.h *)
-                       Ptrhostent* = POINTER TO hostent;
-                       hostent* = RECORD [untagged]
-                               h_name*: Libc.PtrSTR; (* official name of host *)
-                               h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *)
-                               h_addrtype*: INTEGER; (* host address type *)
-                               h_length*: INTEGER; (* length of address *)
-                               h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *)
-                       END;
+               Ptraddrinfo* = POINTER [untagged] TO addrinfo;
+               addrinfo* = RECORD [untagged]
+                       (* OpenBSD 6.0 /usr/include/netdb.h *)
+                               ai_flags*: intFlags; (* input flags *)
+                               ai_family*: int; (* protocol family for socket *)
+                               ai_socktype*: int; (* socket type *)
+                               ai_protocol*: int; (* protocol for socket *)
+                               ai_addrlen*: socklen_t; (* length of socket-address *)
+                               ai_addr*: Ptrsockaddr; (* socket-address for socket *)
+                               ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
+                               ai_next*: Ptraddrinfo; (* pointer to next in list *)
+               END;
 
-               (* /usr/include/sys/time.h *)
-                       timeval* = RECORD [untagged]
-                               tv_sec*: INTEGER; (* seconds *)
-                               tv_usec*: INTEGER; (* and microseconds *)
-                       END;
+               timeval* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               tv_sec*: time_t; (* seconds *)
+                               tv_usec*: suseconds_t; (* and microseconds *)
+               END;
+
+               pollfd* = RECORD [untagged]
+                       (* Linux, FreeBSD, OpenBSD *)
+                               fd*: int;
+                               events*: short;
+                               revents*: short;
+               END;
 
-               (* /usr/include/sys/select.h *)
+               (* OpenBSD 6.0 /usr/include/sys/select.h *)
                        __fd_mask = SET;
                        fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask;
 
-       VAR
-               h_errno*: INTEGER;
+       (* POSIX.1 *)
+               PROCEDURE [ccall] socket* (domain: int; type: int; protocol: int): SOCKET;
+               PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
+               PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): int;
+               PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): int;
+               PROCEDURE [ccall] listen* (s: SOCKET; backlog: int): int;
+               PROCEDURE [ccall] recv* (s: SOCKET; buf: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] send* (s: SOCKET; msg: PtrVoid; len: size_t; flags: intFlags): ssize_t;
+               PROCEDURE [ccall] shutdown* (s: SOCKET; how: int): int;
+               PROCEDURE [ccall] getsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; VAR [nil] optlen: socklen_t): int;
+               PROCEDURE [ccall] setsockopt* (s: SOCKET; level: int; optname: intFlags; optval: PtrVoid; optlen: socklen_t): int;
 
-       PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET;
-       PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-       PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER;
-       PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER;
-       PROCEDURE [ccall] listen* (s: SOCKET; backlog: INTEGER): INTEGER;
-       PROCEDURE [ccall] recv* (s: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] send* (s: SOCKET; msg: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] shutdown* (s: SOCKET; how: INTEGER): INTEGER;
-       PROCEDURE [ccall] getsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] setsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER;
+               PROCEDURE [ccall] inet_addr* (cp: PtrSTR): in_addr_t;
+               PROCEDURE [ccall] htons* (host16: uint16_t): uint16_t;
 
-       PROCEDURE [ccall] htons* (host16: SHORTINT): SHORTINT;
+               PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): int;
 
-       PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent;
-       PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t;
-
-       PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR;
+               PROCEDURE [ccall] poll* (VAR fds: ARRAY [untagged] OF pollfd; nfds: nfds_t; timeout: int): int;
 
 (*
        PROCEDURE FD_ZERO (VAR set: Net.fd_set);
@@ -268,6 +307,10 @@ MODULE LinNet ["libc.so.70.0"];
        END FD_SET;
 *)
 
-       PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER;
+       (* POSIX.1g *)
+               PROCEDURE [ccall] getaddrinfo* (hostname: PtrSTR; servname: PtrSTR; VAR [nil] hints: addrinfo; VAR res: Ptraddrinfo): int;
+               PROCEDURE [ccall] freeaddrinfo* (ai: Ptraddrinfo);
+
+               PROCEDURE [ccall] gai_strerror* (ecode: int): PtrSTR;
 
-END LinNet.
+END LinNet.
\ No newline at end of file
index a3162c758a6955097fad8787da983c97903357de..96c9ca206626e3b0013a27858883438f7e8e1292 100644 (file)
@@ -1,9 +1,9 @@
-MODULE LinTermios ["libc.so.70.0"];
+MODULE LinTermios ["libc.so.89.2"];
 
        (*
-               A. V. Shiryaev, 2012.11, 2013.08
+               A. V. Shiryaev, 2012.11, 2013.08, 2015.09
 
-               OpenBSD 5.4
+               OpenBSD 5.8
                32-bit
        *)
 
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver
new file mode 100644 (file)
index 0000000..01f9f66
--- /dev/null
@@ -0,0 +1 @@
+.89.2
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname
new file mode 100644 (file)
index 0000000..6fcf4b6
--- /dev/null
@@ -0,0 +1 @@
+OpenBSD 6.0
\ No newline at end of file
index e522bff399be383415deb500cc294e61048c305c..586533b56194494be5de1c973c0d8c736506df21 100644 (file)
@@ -1,11 +1,13 @@
+(*
        VAR
                (* OpenBSD: stdin, stdout, stderr *)
-                       __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.2 /usr/include/stdio.h *)
+                       __sF*: ARRAY [untagged] 3 OF FILE; (* OpenBSD 5.8 /usr/include/stdio.h *)
                                (*
                                        stdin = SYSTEM.ADR(__sF[0])
                                        stdout = SYSTEM.ADR(__sF[1])
                                        stderr = SYSTEM.ADR(__sF[2])
                                *)
+*)
 
        PROCEDURE [ccall] __errno_location* ["__errno"] (): PtrVoid;
 
index 1fdc13478d0c55974e26b5c3d0da24ec152e826d..dcf09aa91b5b6ca5361ac8006e323a515ec137e6 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/sys/dirent.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/dirent.h *)
                                d_fileno*: ino_t; (* file number of entry *)
                                d_off*: off_t; (* offset after this entry *)
                                d_reclen*: u_int16_t; (* length of this record *)
index e28a208d2a34f35a3f75164009fa67cd435210d2..d7931fc2d05ad25fad335580c1d305d2cd9ddedc 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/sys/signal.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/signal.h *)
                                sa_sigaction*: PROCEDURE [ccall] (sig: int; siginfo: Ptrsiginfo_t; ctx: Ptrucontext_t);
                                sa_mask*: sigset_t;
                                sa_flags*: intFlags;
\ No newline at end of file
index 18b189945392fba416a2fbe386ab71b690e0cf4e..e140d85983afee0961cab4884ed26b7bd6b1e7bc 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/sys/siginfo.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/siginfo.h *)
                                si_signo*: int; (* signal from signal.h *)
                                si_code*: int; (* code from above *)
                                si_errno*: int; (* error from errno.h *)
index 3136138ed1ef60269619ba6ed2d51ced1e9d3b2b..fa8962d34df502bc38b510f715b4c2f5e45ef43e 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/sys/signal.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/signal.h *)
                                ss_sp*: PtrVoid; (* signal stack base *)
                                ss_size*: size_t; (* signal stack length *)
                                ss_flags*: intFlags; (* SS_DISABLE and/or SS_ONSTACK *)
\ No newline at end of file
index 20f9c0a83c704a5b53d994ceca5149a9ddaed3d1..0300013864b6c11fc022f8e6228edb43c795b6fd 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/sys/stat.h *)
+                       (* OpenBSD 5.9 /usr/include/sys/stat.h *)
                                st_mode*: mode_t;
                                st_dev*: dev_t;
                                st_ino*: ino_t;
@@ -15,8 +15,8 @@
                                st_ctimensec*: long;
 
                                st_size*: off_t;
-                               st_blocks*: int64_t;
-                               st_blksize*: u_int32_t;
+                               st_blocks*: blkcnt_t;
+                               st_blksize*: blksize_t;
                                st_flags*: u_int32_t;
                                st_gen*: u_int32_t;
 
index ed5eb09246734c662647fee8feab0f07a2449e6b..47cd29e381eaf40c6c6bc5c86a286df19659c733 100644 (file)
@@ -1,3 +1,3 @@
-                       (* OpenBSD 5.4 /usr/include/time.h *)
+                       (* OpenBSD 5.9 /usr/include/time.h *)
                                tv_sec*: time_t; (* seconds *)
                                tv_nsec*: long; (* and nanoseconds *)
\ No newline at end of file
index 4c70ef656f159232297944c78c4b1b6bae04e4ca..4030e2649fa3224b2efc10062691e5c6e7c2eb49 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/time.h *)
+                       (* OpenBSD 6.0 /usr/include/time.h *)
                                tm_sec*: int; (* seconds after the minute [0-60] *)
                                tm_min*: int; (* minutes after the hour [0-59] *)
                                tm_hour*: int; (* hours since midnight [0-23] *)
index 43b443df19805a31fc635b658a093a5a52f94359..397ded891fd3f2d33823589b2e4bffdd24c17aee 100644 (file)
@@ -1,4 +1,4 @@
-                       (* OpenBSD 5.4 /usr/include/i386/signal.h struct sigcontext *)
+                       (* OpenBSD 5.9 /usr/include/i386/signal.h struct sigcontext *)
                                sc_gs*: int;
                                sc_fs*: int;
                                sc_es*: int;
@@ -24,7 +24,7 @@
                                sc_err*: int;
 
                                sc_fpstate*: RECORD [union]
-                                       (* OpenBSD 5.4 /usr/include/i386/npx.h union savefpu *)
+                                       (* OpenBSD 5.9 /usr/include/i386/npx.h union savefpu *)
 (*
                                                sv_87*: RECORD [untagged]
                                                        ...
index 3d9c28b559f592914469fcd19a982d64c990d8b4..8681f064bf1797d9b3b750aa102c0a2ac72ef511 100644 (file)
@@ -1 +1 @@
-.70.0
\ No newline at end of file
+.86.0
\ No newline at end of file
index fdefe880b45229122b564cee1ae0fcc591c8745d..3a22993420a90eccf2bcb6893707262c008fa262 100755 (executable)
@@ -15,6 +15,7 @@ def main ():
 
 #include <errno.h>
 #include <stdio.h>
+#include <string.h>
 
 static void D (const char *s, int e)
 {
index 68114049c479046434fb656510c1f5258c401a70..3cc5971d09c242a3868d84fd0354243601adbb82 100644 (file)
@@ -1 +1 @@
-OpenBSD 5.4
\ No newline at end of file
+OpenBSD 5.9
\ No newline at end of file
index b2ad10d85d4e755ce7aebcda13b4ae5615897d67..efd53bd4ce4f7d5d14fa5e150327e2fdb8aab078 100644 (file)
@@ -69,6 +69,8 @@ int main ()
        D("dev_t", sizeof(dev_t), FALSE, TRUE);
        D("ino_t", sizeof(ino_t), FALSE, TRUE);
        D("nlink_t", sizeof(nlink_t), FALSE, TRUE);
+       D("blkcnt_t", sizeof(blkcnt_t), FALSE, FALSE);
+       D("blksize_t", sizeof(blksize_t), FALSE, FALSE);
        D("int8_t", sizeof(int8_t), FALSE, TRUE);
        D("u_int8_t", sizeof(u_int8_t), FALSE, TRUE);
        D("int16_t", sizeof(int16_t), FALSE, TRUE);
index 9fe82db863599881635ad2cf47f5161094fd1c32..dadffc4610c904f1d0b0e8a51d793bca4c4bdba7 100644 (file)
@@ -6,28 +6,47 @@
 
 INCDIR ?= /usr/include
 
-all: Net.txt dumphstrerrno
-
 PY = python2.7
-DEFS = defs-socket defs-in defs-netdb
 
-Net.txt: Net.txt.templ ${DEFS}
+DEFS = defs-basictypes defs-af defs-sock defs-proto defs-shut defs-so defs-sol defs-msg defs-ai defs-eai defs-somaxconn
+
+all: Net.txt ${DEFS}
+
+Net.txt: Net.txt.templ ${DEFS} libver osname machine fields-sockaddr fields-sockaddr_in fields-sockaddr_storage fields-addrinfo defs-fd_set-const defs-fd_set-type
        ${PY} ./untempl.py Net.txt.templ ${.TARGET}
 
-defs-socket:
+defs-basictypes: sizeofs
+       ./sizeofs > ${.TARGET}
+
+defs-af:
+       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     AF_" > ${.TARGET}
+
+defs-sock:
        ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     SOCK_" > ${.TARGET}
-       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     AF_" >> ${.TARGET}
-       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     SHUT_" >> ${.TARGET}
-       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     SOMAXCONN" >> ${.TARGET}
-       ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep "     SO_" >> ${.TARGET}
-       ./dumpdefs.py 3 1 i ${INCDIR}/sys/socket.h | grep "     SOL_" >> ${.TARGET}
-       ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep "     MSG_" >> ${.TARGET}
-
-defs-in:
+
+defs-proto:
        ./dumpdefs.py 3 1 i ${INCDIR}/netinet/in.h | grep "     IPPROTO_" > ${.TARGET}
 
-defs-netdb:
-       ./dumpdefs.py 3 2 i ${INCDIR}/netdb.h > ${.TARGET}
+defs-sol:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SOL_" > ${.TARGET}
+
+defs-msg:
+       ./dumpdefs.py 2 1 s ${INCDIR}/sys/socket.h | grep "     MSG_" > ${.TARGET}
+
+defs-somaxconn:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SOMAXCONN" > ${.TARGET}
+
+defs-so:
+       ./dumpdefs.py 3 1 s ${INCDIR}/sys/socket.h | grep "     SO_" > ${.TARGET}
+
+defs-shut:
+       ./dumpdefs.py 2 1 i ${INCDIR}/sys/socket.h | grep "     SHUT_" > ${.TARGET}
+
+defs-ai:
+       ./dumpdefs.py 3 1 s ${INCDIR}/netdb.h | grep "  AI_" > ${.TARGET}
+
+defs-eai:
+       ./dumpdefs.py 3 1 i ${INCDIR}/netdb.h | grep "  EAI_" > ${.TARGET}
 
 clean:
-       rm -f Net.txt ${DEFS} dumphstrerrno
+       rm -f ${DEFS} Net.txt sizeofs
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/Net.txt.templ
deleted file mode 100644 (file)
index 29b9011..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-MODULE LinNet ["libc.so.70.0"];
-
-       (*
-               A. V. Shiryaev, 2012.11, 2013.08
-
-               OpenBSD 5.4
-               32-bit
-       *)
-
-       IMPORT Libc := LinLibc;
-
-       CONST
-               INVALID_SOCKET* = -1;
-               SOCKET_ERROR* = -1;
-
-               (* /usr/include/sys/socket.h *)
-%%defs-socket%%
-               (* /usr/include/netinet/in.h *)
-                       INADDR_NONE* = -1;
-%%defs-in%%
-               (* /usr/include/sys/param.h *)
-                       MAXHOSTNAMELEN* = 256; (* max hostname size *)
-
-               (* /usr/include/netdb.h *)
-%%defs-netdb%%
-               (* /usr/include/sys/select.h *)
-                       FD_SETSIZE = 1024;
-                       __NBBY = 8;
-
-       TYPE
-               SOCKET* = INTEGER;
-
-               (* /usr/include/sys/_types.h *)
-                       socklen_t* = INTEGER;
-                       sa_family_t* = SHORTCHAR;
-                       in_addr_t* = INTEGER;
-                       in_port_t* = SHORTINT;
-
-               (* /usr/include/sys/socket.h *)
-                       sockaddr* = RECORD [untagged]
-                               sa_len*: SHORTCHAR; (* total length *)
-                               sa_family*: sa_family_t; (* address family *)
-                               sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
-                       END;
-                       sockaddr_storage* = RECORD [untagged]
-                               ss_len*: SHORTCHAR; (* total length *)
-                               ss_family*: sa_family_t; (* address family *)
-                               __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *)
-                               __ss_pad2: LONGINT; (* force alignment for stupid compilers *)
-                               __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *)
-                       END;
-
-               (* /usr/include/netinet/in.h *)
-(*
-                       in_addr* = RECORD [untagged]
-                               s_addr*: in_addr_t;
-                       END;
-*)
-                       in_addr* = RECORD [untagged]
-                               S_un*: RECORD [union]
-                                       S_un_b*: RECORD [untagged]
-                                               s_b1*: SHORTCHAR;
-                                               s_b2*: SHORTCHAR;
-                                               s_b3*: SHORTCHAR;
-                                               s_b4*: SHORTCHAR;
-                                       END;
-                                       S_un_w*: RECORD [untagged]
-                                               s_w1*: SHORTINT;
-                                               s_w2*: SHORTINT;
-                                       END;
-                                       S_addr*: in_addr_t;
-                               END;
-                       END;
-
-                       sockaddr_in* = RECORD [untagged]
-                               sin_len*: SHORTCHAR;
-                               sin_family*: sa_family_t;
-                               sin_port*: in_port_t;
-                               sin_addr*: in_addr;
-                               sin_zero*: ARRAY [untagged] 8 OF SHORTCHAR;
-                       END;
-
-               (* /usr/include/netdb.h *)
-                       Ptrhostent* = POINTER TO hostent;
-                       hostent* = RECORD [untagged]
-                               h_name*: Libc.PtrSTR; (* official name of host *)
-                               h_aliases*: POINTER TO ARRAY [untagged] OF Libc.PtrSTR; (* alias list *)
-                               h_addrtype*: INTEGER; (* host address type *)
-                               h_length*: INTEGER; (* length of address *)
-                               h_addr_list*: POINTER TO ARRAY [untagged] OF POINTER TO ARRAY [untagged] OF in_addr; (* list of addresses from name server *)
-                       END;
-
-               (* /usr/include/sys/time.h *)
-                       timeval* = RECORD [untagged]
-                               tv_sec*: INTEGER; (* seconds *)
-                               tv_usec*: INTEGER; (* and microseconds *)
-                       END;
-
-               (* /usr/include/sys/select.h *)
-                       __fd_mask = SET;
-                       fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask;
-
-       VAR
-               h_errno*: INTEGER;
-
-       PROCEDURE [ccall] socket* (domain: INTEGER; type: INTEGER; protocol: INTEGER): SOCKET;
-       PROCEDURE [ccall] accept* (s: SOCKET; VAR addr: sockaddr; VAR addrlen: socklen_t): SOCKET;
-       PROCEDURE [ccall] bind* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER;
-       PROCEDURE [ccall] connect* (s: SOCKET; VAR name: sockaddr; namelen: socklen_t): INTEGER;
-       PROCEDURE [ccall] listen* (s: SOCKET; backlog: INTEGER): INTEGER;
-       PROCEDURE [ccall] recv* (s: SOCKET; buf: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] send* (s: SOCKET; msg: Libc.PtrVoid; len: Libc.size_t; flags: SET): Libc.ssize_t;
-       PROCEDURE [ccall] shutdown* (s: SOCKET; how: INTEGER): INTEGER;
-       PROCEDURE [ccall] getsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; VAR optlen: socklen_t): INTEGER;
-       PROCEDURE [ccall] setsockopt* (s: SOCKET; level: INTEGER; optname: SET; optval: Libc.PtrVoid; optlen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] htons* (host16: SHORTINT): SHORTINT;
-
-       PROCEDURE [ccall] gethostbyname* (name: Libc.PtrSTR): Ptrhostent;
-       PROCEDURE [ccall] inet_addr* (cp: Libc.PtrSTR): in_addr_t;
-
-       PROCEDURE [ccall] getsockname* (s: SOCKET; VAR name: sockaddr; VAR namelen: socklen_t): INTEGER;
-
-       PROCEDURE [ccall] hstrerror* (err: INTEGER): Libc.PtrSTR;
-
-(*
-       PROCEDURE FD_ZERO (VAR set: Net.fd_set);
-               VAR i: INTEGER;
-       BEGIN
-               i := LEN(set); REPEAT DEC(i); set[i] := {} UNTIL i = 0
-       END FD_ZERO;
-
-       PROCEDURE FD_SET (fd: Net.SOCKET; VAR set: Net.fd_set);
-       BEGIN
-               INCL(set[fd DIV 32], fd MOD 32)
-       END FD_SET;
-*)
-
-       PROCEDURE [ccall] select* (nfds: INTEGER; VAR [nil] readfds: fd_set; VAR [nil] writefds: fd_set; VAR [nil] exceptfds: fd_set; VAR timeout: timeval): INTEGER;
-
-END LinNet.
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-const
new file mode 100644 (file)
index 0000000..e9939f3
--- /dev/null
@@ -0,0 +1,3 @@
+               (* OpenBSD 6.0 /usr/include/sys/select.h *)
+                       FD_SETSIZE = 1024;
+                       __NBBY = 8;
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/defs-fd_set-type
new file mode 100644 (file)
index 0000000..7c936d5
--- /dev/null
@@ -0,0 +1,3 @@
+               (* OpenBSD 6.0 /usr/include/sys/select.h *)
+                       __fd_mask = SET;
+                       fd_set* = ARRAY [untagged] (FD_SETSIZE + (SIZE(__fd_mask) * __NBBY - 1)) DIV (SIZE(__fd_mask) * __NBBY) OF __fd_mask;
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/dumphstrerrno.c
deleted file mode 100644 (file)
index e839256..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <netdb.h>
-#include <stdio.h>
-
-static void D (const char *s, int e)
-{
-       printf("%s, %s\n", s, hstrerror(e));
-}
-
-int main (int argc, char *argv[])
-{
-       D("NETDB_INTERNAL", NETDB_INTERNAL);
-       D("NETDB_SUCCESS", NETDB_SUCCESS);
-       D("HOST_NOT_FOUND", HOST_NOT_FOUND);
-       D("TRY_AGAIN", TRY_AGAIN);
-       D("NO_RECOVERY", NO_RECOVERY);
-       D("NO_DATA", NO_DATA);
-
-       return 0;
-}
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-addrinfo
new file mode 100644 (file)
index 0000000..1c9c112
--- /dev/null
@@ -0,0 +1,9 @@
+                       (* OpenBSD 6.0 /usr/include/netdb.h *)
+                               ai_flags*: intFlags; (* input flags *)
+                               ai_family*: int; (* protocol family for socket *)
+                               ai_socktype*: int; (* socket type *)
+                               ai_protocol*: int; (* protocol for socket *)
+                               ai_addrlen*: socklen_t; (* length of socket-address *)
+                               ai_addr*: Ptrsockaddr; (* socket-address for socket *)
+                               ai_canonname*: PtrSTR; (* canonical name for service location (iff req) *)
+                               ai_next*: Ptraddrinfo; (* pointer to next in list *)
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr
new file mode 100644 (file)
index 0000000..8024438
--- /dev/null
@@ -0,0 +1,4 @@
+                       (* OpenBSD /usr/include/sys/socket.h *)
+                               sa_len*: SHORTCHAR; (* total length *)
+                               sa_family*: sa_family_t; (* address family *)
+                               sa_data*: ARRAY [untagged] 14 OF SHORTCHAR; (* actually longer; address value *)
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_in
new file mode 100644 (file)
index 0000000..b4893d3
--- /dev/null
@@ -0,0 +1,6 @@
+                       (* OpenBSD /usr/include/netinet/in.h *)
+                               sin_len*: u_int8_t;
+                               sin_family*: sa_family_t;
+                               sin_port*: in_port_t;
+                               sin_addr*: in_addr;
+                               sin_zero*: ARRAY [untagged] 8 OF int8_t;
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/fields-sockaddr_storage
new file mode 100644 (file)
index 0000000..27ace91
--- /dev/null
@@ -0,0 +1,6 @@
+                       (* OpenBSD 6.0 /usr/include/sys/socket.h *)
+                               ss_len*: SHORTCHAR; (* total length *)
+                               ss_family*: sa_family_t; (* address family *)
+                               __ss_pad1: ARRAY [untagged] 6 OF SHORTCHAR; (* align to quad *)
+                               __ss_pad2: LONGINT; (* force alignment for stupid compilers *)
+                               __ss_pad3: ARRAY [untagged] 240 OF SHORTCHAR; (* pad to a total of 256 bytes *)
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver
new file mode 100644 (file)
index 0000000..01f9f66
--- /dev/null
@@ -0,0 +1 @@
+.89.2
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/machine
new file mode 100644 (file)
index 0000000..fd32fa4
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname
new file mode 100644 (file)
index 0000000..6fcf4b6
--- /dev/null
@@ -0,0 +1 @@
+OpenBSD 6.0
\ No newline at end of file
index 055af2807d6f2401f7a6f57c2cabde500fc41a76..5ef897d0d1c0aa2bf7bc6b3e6676b441e0cb7237 100644 (file)
@@ -1,9 +1,9 @@
-MODULE LinTermios ["libc.so.70.0"];
+MODULE LinTermios ["libc.so.86.0"];
 
        (*
-               A. V. Shiryaev, 2012.11, 2013.08
+               A. V. Shiryaev, 2012.11, 2013.08, 2015.09
 
-               OpenBSD 5.4
+               OpenBSD 5.8
                32-bit
        *)
 
index f4104ddc8803543a96cede957feedf94343ded8b..855cd8ade1cbe3d448849ff0b54b590dc31028f5 100644 (file)
@@ -11,7 +11,7 @@ all: loader
 # -pthread required to dlopen libraries that depends on pthread
 
 loader: loader.c
-       ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -pthread
+       ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -pthread -Wl,-z,'wxneeded'
 
 clean:
        rm -f loader
index bea6f87850f4f51f6508d878c08e93426b66624e..67d406562ed1464cdfe53f0d06e6d4a245b2ace6 100755 (executable)
Binary files a/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader and b/BlackBox/_OpenBSD_/Lin/Rsrc/loader/loader differ
index fc065a2d539d4a00231ff6eb9df46e048c3e729d..d754e3daa6fc10688f542f9396e1323e298b5878 100644 (file)
Binary files a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc and b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc differ
index 62b54f7b1c9854587eef94bc8f87185c44e89843..2f57f6b65afb88d3cfec9b54c9a57557b9ab4c5a 100644 (file)
Binary files a/BlackBox/_OpenBSD_/libBB.so and b/BlackBox/_OpenBSD_/libBB.so differ
index aac734ed6e0e17bc54928f51841850227ca489a8..8c5cfb051fe7461ce1cb9ecbb5a06f1f195123b1 100644 (file)
Binary files a/BlackBox/_OpenBSD_/libBB0.so and b/BlackBox/_OpenBSD_/libBB0.so differ