From: Alexander Shiryaev Date: Wed, 17 Jan 2018 09:26:53 +0000 (+0300) Subject: libc interface updated X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=4fafe12bb092834966700b01b6b9e4a3f0f44ec2;p=bbcp.git libc interface updated --- diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ index dbcef0c..3e156fd 100644 --- a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ +++ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ @@ -43,6 +43,8 @@ MODULE LinLibc ["libc.so%%libver%%"]; (* ENOENT, EEXIST, EACCES, ENOMEM, EDQUOT, EMFILE, ENOTDIR (int) *) %%defs-errno%% +%%defs-wait%% + NAME_MAX* = %%namemax%%; SEEK_SET* = 0; @@ -225,11 +227,19 @@ MODULE LinLibc ["libc.so%%libver%%"]; PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int; (* POSIX.1 *) - PROCEDURE [ccall] sysconf* (name: int): long; + PROCEDURE [ccall] fork* (): pid_t; + PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: int; options: intFlags): pid_t; + + (* POSIX.1 *) + PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int; + PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int; (* POSIX.2 *) PROCEDURE [ccall] system* (string: PtrSTR): int; + (* POSIX.1 *) + PROCEDURE [ccall] sysconf* (name: int): long; + PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE; PROCEDURE [ccall] pclose* (stream: PtrFILE): int; diff --git a/BlackBox/_Linux_/Lin/Mod/Libc.odc b/BlackBox/_Linux_/Lin/Mod/Libc.odc index ed69804..f53d5c4 100644 Binary files a/BlackBox/_Linux_/Lin/Mod/Libc.odc and b/BlackBox/_Linux_/Lin/Mod/Libc.odc differ diff --git a/BlackBox/_Linux_/Lin/Mod/Libc.txt b/BlackBox/_Linux_/Lin/Mod/Libc.txt index 577df71..fdc3d67 100644 --- a/BlackBox/_Linux_/Lin/Mod/Libc.txt +++ b/BlackBox/_Linux_/Lin/Mod/Libc.txt @@ -250,6 +250,11 @@ MODULE LinLibc ["libc.so.6"]; STDOUT_FILENO* = 1; STDERR_FILENO* = 2; + WAIT_ANY* = -1; + WCONTINUED* = {3}; + WNOHANG* = {0}; + WUNTRACED* = {1}; + TYPE __ftw_func_t* = PROCEDURE (fileName: PtrSTR; VAR [nil] stat: stat_t; flag: INTEGER): INTEGER; PtrVoid* = INTEGER; @@ -467,15 +472,21 @@ MODULE LinLibc ["libc.so.6"]; PROCEDURE [ccall] mprotect* (addr: PtrVoid; len: size_t; prot: SET): INTEGER; PROCEDURE [ccall] getenv* (name: PtrSTR): PtrSTR; - - PROCEDURE [ccall] sysconf* (name: INTEGER): INTEGER; PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): INTEGER; PROCEDURE [ccall] sigprocmask* (how: INTEGER; set: Ptrsigset_t; oldset: Ptrsigset_t): INTEGER; - + + PROCEDURE [ccall] fork* (): pid_t; + PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: INTEGER; options: SET): pid_t; + + PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER; + PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER; + PROCEDURE [ccall] system* (string: PtrSTR): INTEGER; + PROCEDURE [ccall] sysconf* (name: INTEGER): INTEGER; + PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE; PROCEDURE [ccall] pclose* (stream: PtrFILE): INTEGER; diff --git a/BlackBox/_OpenBSD_/Host/Mod/Files16.odc b/BlackBox/_OpenBSD_/Host/Mod/Files16.odc deleted file mode 100644 index 2faa926..0000000 Binary files a/BlackBox/_OpenBSD_/Host/Mod/Files16.odc and /dev/null differ diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt b/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt index e25536b..6f3ade0 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Dl.txt @@ -1,16 +1,16 @@ -MODULE LinDl ["libc.so.90.0"]; +MODULE LinDl ["libc.so.90"]; (* A. V. Shiryaev, 2012.09, 2013.08 - OpenBSD 5.6 + OpenBSD 6.2 32-bit *) CONST NULL* = 0H; - (* from OpenBSD 5.2 /usr/include/dlfcn.h *) + (* from OpenBSD 6.2 /usr/include/dlfcn.h *) RTLD_LAZY* = 1; (* DL_LAZY* = RTLD_LAZY; *) (* compat *) RTLD_NOW* = 2; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt b/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt index b03ca44..e1a1f38 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Iconv.txt @@ -1,4 +1,4 @@ -MODULE LinIconv ["libiconv.so.6.0"]; +MODULE LinIconv ["libiconv.so.6"]; IMPORT Libc := LinLibc; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt b/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt index 57d1cb2..b310635 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Ioctl.txt @@ -1,7 +1,7 @@ -MODULE LinIoctl ["libc.so.90.0"]; +MODULE LinIoctl ["libc.so.90"]; (* - OpenBSD 6.0 + OpenBSD 6.2 i386 *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/LibW.txt b/BlackBox/_OpenBSD_/Lin/Mod/LibW.txt index 35e9cb0..454417b 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/LibW.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/LibW.txt @@ -1,7 +1,7 @@ -MODULE LinLibW ["libc.so.90.0"]; +MODULE LinLibW ["libc.so.90"]; (* - OpenBSD 6.0 + OpenBSD 6.2 i386 *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt b/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt index 37fee0f..aa872b6 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Libc.txt @@ -1,7 +1,7 @@ -MODULE LinLibc ["libc.so.90.0"]; +MODULE LinLibc ["libc.so.90"]; (* - OpenBSD 6.0 + OpenBSD 6.2 i386 *) @@ -303,6 +303,10 @@ MODULE LinLibc ["libc.so.90.0"]; EIDRM* = 89; (* Identifier removed *) ENOMSG* = 90; (* No message of desired type *) ENOTSUP* = 91; (* Not supported *) + EBADMSG* = 92; (* Bad message *) + ENOTRECOVERABLE* = 93; (* State not recoverable *) + EOWNERDEAD* = 94; (* Previous owner died *) + EPROTO* = 95; (* Protocol error *) ENOTBLK* = 15; (* Block device required *) ESOCKTNOSUPPORT* = 44; (* Socket type not supported *) EPFNOSUPPORT* = 46; (* Protocol family not supported *) @@ -324,11 +328,18 @@ MODULE LinLibc ["libc.so.90.0"]; ENOATTR* = 83; (* Attribute not found *) ENOMEDIUM* = 85; (* No medium found *) EMEDIUMTYPE* = 86; (* Wrong medium type *) - ELAST* = 91; (* Must be equal largest errno *) + ELAST* = 95; (* Must be equal largest errno *) ERESTART* = -1; (* restart syscall *) EJUSTRETURN* = -2; (* don't modify regs, just return *) + WAIT_ANY* = -1; (* any process *) + WAIT_MYPGRP* = 0; (* any process in my process group *) + WCONTINUED* = {3}; (* report a job control continued process *) + WNOHANG* = {0}; (* don't hang in wait *) + WUNTRACED* = {1}; (* tell about stopped, untraced children *) + + NAME_MAX* = 255; SEEK_SET* = 0; @@ -693,11 +704,19 @@ MODULE LinLibc ["libc.so.90.0"]; PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int; (* POSIX.1 *) - PROCEDURE [ccall] sysconf* (name: int): long; + PROCEDURE [ccall] fork* (): pid_t; + PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: int; options: intFlags): pid_t; + + (* POSIX.1 *) + PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int; + PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): int; (* POSIX.2 *) PROCEDURE [ccall] system* (string: PtrSTR): int; + (* POSIX.1 *) + PROCEDURE [ccall] sysconf* (name: int): long; + PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE; PROCEDURE [ccall] pclose* (stream: PtrFILE): int; diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Net.txt b/BlackBox/_OpenBSD_/Lin/Mod/Net.txt index 7295b04..172b895 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Net.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Net.txt @@ -1,7 +1,7 @@ -MODULE LinNet ["libc.so.90.0"]; +MODULE LinNet ["libc.so.90"]; (* - OpenBSD 6.0 + OpenBSD 6.2 i386 *) @@ -109,6 +109,7 @@ MODULE LinNet ["libc.so.90.0"]; SO_REUSEPORT* = {9}; (* allow local address & port reuse *) SO_TIMESTAMP* = {11}; (* timestamp received dgram traffic *) SO_BINDANY* = {12}; (* allow bind to any address *) + SO_ZEROIZE* = {13}; (* zero out all mbufs sent over socket *) SO_SNDBUF* = {0,12}; (* send buffer size *) SO_RCVBUF* = {1,12}; (* receive buffer size *) SO_SNDLOWAT* = {0,1,12}; (* send low-water mark *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt b/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt index 102c11b..52e72dd 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt +++ b/BlackBox/_OpenBSD_/Lin/Mod/Termios.txt @@ -1,9 +1,9 @@ -MODULE LinTermios ["libc.so.90.0"]; +MODULE LinTermios ["libc.so.90"]; (* A. V. Shiryaev, 2012.11, 2013.08, 2015.09 - OpenBSD 5.8 + OpenBSD 6.2 32-bit *) diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver index 0728c38..0b68164 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/libver @@ -1 +1 @@ -.90.0 \ No newline at end of file +.90 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname index 6fcf4b6..34dbec5 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Ioctl/osname @@ -1 +1 @@ -OpenBSD 6.0 \ No newline at end of file +OpenBSD 6.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver index 0728c38..0b68164 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/libver @@ -1 +1 @@ -.90.0 \ No newline at end of file +.90 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname index 6fcf4b6..34dbec5 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-LibW/osname @@ -1 +1 @@ -OpenBSD 6.0 \ No newline at end of file +OpenBSD 6.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile index 8e8d081..88db999 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/Makefile @@ -8,7 +8,7 @@ INCDIR ?= /usr/include PY = python2.7 -DEFS = clockspersec defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc defs-clockid +DEFS = clockspersec defs-map defs-prot defs-sigmask nsig defs-signo defs-fpe defs-sa defs-errno namemax defs-fcntlo defs-basictypes defs-sc defs-clockid defs-wait all: Libc.txt ${DEFS} strerrnocase.txt @@ -71,6 +71,12 @@ defs-clockid: # ./dumpdefs.py 2 2 i ${INCDIR}/sys/siginfo.h | grep SEGV_ >> ${.TARGET} # ./dumpdefs.py 2 2 i ${INCDIR}/sys/siginfo.h | grep BUS_ >> ${.TARGET} +defs-wait: + ./dumpdefs.py 2 2 i ${INCDIR}/sys/wait.h | grep WAIT_ > ${.TARGET} + ./dumpdefs.py 2 1 s ${INCDIR}/sys/wait.h | grep WCONTINUED | grep -v _WCONTINUED >> ${.TARGET} + ./dumpdefs.py 2 1 s ${INCDIR}/sys/wait.h | grep WNOHANG >> ${.TARGET} + ./dumpdefs.py 2 1 s ${INCDIR}/sys/wait.h | grep WUNTRACED >> ${.TARGET} + dumpstrerrno.c: defs-errno grep -v ERESTART ${.ALLSRC} | grep -v EJUSTRETURN | ./mkdumpstrerrno.py > ${.TARGET} diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver index 0728c38..0b68164 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/libver @@ -1 +1 @@ -.90.0 \ No newline at end of file +.90 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname index 3cc5971..34dbec5 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/osname @@ -1 +1 @@ -OpenBSD 5.9 \ No newline at end of file +OpenBSD 6.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver index 0728c38..0b68164 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/libver @@ -1 +1 @@ -.90.0 \ No newline at end of file +.90 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname index 6fcf4b6..34dbec5 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Net/osname @@ -1 +1 @@ -OpenBSD 6.0 \ No newline at end of file +OpenBSD 6.2 \ No newline at end of file diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ index d171031..98c6972 100644 --- a/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ +++ b/BlackBox/_OpenBSD_/Lin/Mod/gen-Termios/Termios.txt.templ @@ -1,9 +1,9 @@ -MODULE LinTermios ["libc.so.90.0"]; +MODULE LinTermios ["libc.so.90"]; (* A. V. Shiryaev, 2012.11, 2013.08, 2015.09 - OpenBSD 5.8 + OpenBSD 6.2 32-bit *) diff --git a/BlackBox/_OpenBSD_/blackbox b/BlackBox/_OpenBSD_/blackbox index 21af521..29c77b0 100755 Binary files a/BlackBox/_OpenBSD_/blackbox and b/BlackBox/_OpenBSD_/blackbox differ diff --git a/BlackBox/_OpenBSD_/dev0 b/BlackBox/_OpenBSD_/dev0 index 44bc02b..f85efa0 100755 Binary files a/BlackBox/_OpenBSD_/dev0 and b/BlackBox/_OpenBSD_/dev0 differ