summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0aeb96)
raw | patch | inline | side by side (parent: e0aeb96)
author | Alexander Shiryaev <aixp@mail.ru> | |
Wed, 17 Jan 2018 21:02:19 +0000 (00:02 +0300) | ||
committer | Alexander Shiryaev <aixp@mail.ru> | |
Wed, 17 Jan 2018 21:02:19 +0000 (00:02 +0300) |
27 files changed:
diff --git a/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ b/BlackBox/_FreeBSDLinuxOpenBSD_/Lin/Mod/gen-Libc/Libc.txt.templ
index 5851681dcafc1ad5f21fb78ccb024aaa3be7fb7c..fb0cd79689a411ad278a461207d329f6297f137d 100644 (file)
PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
(* POSIX.1 *)
+(*
PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
+*)
PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
(* POSIX.1 *)
- PROCEDURE [ccall] sigemptyset* (VAR set: sigset_t): int;
- PROCEDURE [ccall] sigfillset* (VAR set: sigset_t): int;
- PROCEDURE [ccall] sigaddset* (VAR set: sigset_t; signo: int): int;
- PROCEDURE [ccall] sigprocmask* (how: int; VAR [nil] set: sigset_t; VAR [nil] oset: sigset_t): int;
+ PROCEDURE [ccall] sigemptyset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigfillset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigaddset* (set: PtrSigset_t; signo: int): int;
+ PROCEDURE [ccall] sigprocmask* (how: int; set: PtrSigset_t; oset: PtrSigset_t): int;
(* POSIX.1 *)
PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c b/BlackBox/_LinuxOpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
similarity index 93%
rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
rename to BlackBox/_LinuxOpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
index efd53bd4ce4f7d5d14fa5e150327e2fdb8aab078..2339dab37b66c7779a8b796e4d74a5b8a518c77d 100644 (file)
rename from BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
rename to BlackBox/_LinuxOpenBSD_/Lin/Mod/gen-Libc/sizeofs.c
index efd53bd4ce4f7d5d14fa5e150327e2fdb8aab078..2339dab37b66c7779a8b796e4d74a5b8a518c77d 100644 (file)
D("int64_t", sizeof(int64_t), FALSE, TRUE);
D("u_int64_t", sizeof(u_int64_t), FALSE, TRUE);
D("wchar_t", sizeof(wchar_t), FALSE, TRUE);
- D("sigset_t", sizeof(sigset_t), TRUE, TRUE);
D("sigjmp_buf", sizeof(sigjmp_buf), FALSE, TRUE);
D("intFlags", sizeof(int), TRUE, TRUE);
D("FILE", sizeof(FILE), FALSE, FALSE);
+ printf("%ssigset_t* = ARRAY [untagged] %d OF BYTE;\n", TABS, (int)sizeof(sigset_t));
+ printf("%sPtrSigset_t* = POINTER [untagged] TO sigset_t;\n", TABS);
+
return 0;
}
index 0dcf73bb2334117c2d4f31eaea5a5dc49d5bf5cb..4eea2ff99cfe1338f8d1ec2c7ab2aa0df7b92c2d 100644 (file)
Binary files a/BlackBox/_Linux_/Host/Mod/Files.odc and b/BlackBox/_Linux_/Host/Mod/Files.odc differ
Binary files a/BlackBox/_Linux_/Host/Mod/Files.odc and b/BlackBox/_Linux_/Host/Mod/Files.odc differ
index 768363fb192f46846bf561781dc81f2e6e596ddb..35d59d0c5ef89518c4f5087eb1e47352e2b13dee 100644 (file)
-MODULE LinLibc ["libc.so.6"];\r
-\r
- (* THIS IS TEXT COPY OF Libc.odc *)\r
- (* DO NOT EDIT *)\r
-\r
- IMPORT SYSTEM;\r
- \r
- CONST\r
- NULL* = 0H;\r
- TRUE* = 1;\r
- FALSE* = 0;\r
- \r
- (* file constants *)\r
- SEEK_SET* = 0;\r
- SEEK_CUR* = 1;\r
- SEEK_END* = 2;\r
- NAME_MAX* = 256;\r
- \r
- (* The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems.*)\r
- CLOCKS_PER_SECOND* = 1000000; \r
- \r
- (* temp directory defined in stdio.h *)\r
- P_tmpdir* = "/tmp";\r
- \r
- (* signal constants *) (* Fake signal functions. *)\r
- SIG_ERR* = -1; (* Error return. *)\r
- SIG_DFL* = 0; (* Default action. *)\r
- SIG_IGN* = 1; (* Ignore signal. *)\r
- SIG_HOLD* = 2; (* Add signal to hold mask. *)\r
- \r
- (* Signals. *)\r
- SIGHUP* = 1; (* Hangup (POSIX). *)\r
- SIGINT* = 2; (* Interrupt (ANSI). *)\r
- SIGQUIT* = 3; (* Quit (POSIX). *)\r
- SIGILL* = 4; (* Illegal instruction (ANSI). *)\r
- SIGTRAP* = 5; (* Trace trap (POSIX). *)\r
- SIGABRT* = 6; (* Abort (ANSI). *)\r
- SIGIOT* = 6; (* IOT trap (4.2 BSD). *)\r
- SIGBUS* = 7; (* BUS error (4.2 BSD). *)\r
- SIGFPE* = 8; (* Floating-point exception (ANSI). *)\r
- SIGKILL* = 9; (* Kill, unblockable (POSIX). *)\r
- SIGUSR1* = 10; (* User-defined signal 1 (POSIX). *)\r
- SIGSEGV* = 11; (* Segmentation violation (ANSI). *)\r
- SIGUSR2* = 12; (* User-defined signal 2 (POSIX). *)\r
- SIGPIPE* = 13; (* Broken pipe (POSIX). *)\r
- SIGALRM* = 14; (* Alarm clock (POSIX). *)\r
- SIGTERM* = 15; (* Termination (ANSI). *)\r
- SIGSTKFLT* = 16; (* Stack fault. *)\r
- SIGCHLD* = 17; (* Child status has changed (POSIX). *)\r
- SIGCLD* = SIGCHLD; (* Same as SIGCHLD (System V). *)\r
- SIGCONT* = 18; (* Continue (POSIX). *)\r
- SIGSTOP* = 19; (* Stop, unblockable (POSIX). *)\r
- SIGTSTP* = 20; (* Keyboard stop (POSIX). *)\r
- SIGTTIN* = 21; (* Background read from tty (POSIX). *)\r
- SIGTTOU* = 22; (* Background write to tty (POSIX). *)\r
- SIGURG* = 23; (* Urgent condition on socket (4.2 BSD). *)\r
- SIGXCPU* = 24; (* CPU limit exceeded (4.2 BSD). *)\r
- SIGXFSZ* = 25; (* File size limit exceeded (4.2 BSD). *)\r
- SIGVTALRM* =26; (* Virtual alarm clock (4.2 BSD). *)\r
- SIGPROF* = 27; (* Profiling alarm clock (4.2 BSD). *)\r
- SIGWINCH* = 28; (* Window size change (4.3 BSD, Sun). *)\r
- SIGIO* = 29; (* I/O now possible (4.2 BSD). *)\r
- SIGPOLL* = SIGIO; (* Pollable event occurred (System V). *)\r
- SIGPWR* = 30; (* Power failure restart (System V). *)\r
- SIGSYS* = 31; (* Bad system call. *)\r
- SIGUNUSED* =31;\r
- _NSIG* = 64; (* Biggest signal number + 1 (including real-time signals). *)\r
- __SIGRTMIN*= 32;\r
- __SIGRTMAX*=_NSIG - 1;\r
-\r
- (* Bits in `sa_flags'. *)\r
- SA_NOCLDSTOP* = {0}; (* = 1 Don't send SIGCHLD when children stop. *)\r
- SA_NOCLDWAIT* = {1}; (* = 2 Don't create zombie on child death. *)\r
- SA_SIGINFO* = {2}; (* = 4 Invoke signal-catching function wth three arguments instead of one. *)\r
- SA_ONSTACK* = {27}; (* = 0x08000000 Use signal stack by using `sa_restorer'. *)\r
- SA_RESTART* = {28}; (* = 0x10000000 Restart syscall on signal return. *)\r
- SA_NODEFER* = {30}; (* = 0x40000000 Don't automatically block the signal when its handler is being executed. *)\r
- SA_RESETHAND* = {31}; (* = 0x80000000 Reset to SIG_DFL on entry to handler. *)\r
- SA_INTERRUPT* = {29}; (* = 0x20000000 Historical no-op. *)\r
- (* Some aliases for the SA_ constants. *)\r
- SA_NOMASK* = SA_NODEFER;\r
- SA_ONESHOT* = SA_RESETHAND;\r
- SA_STACK* = SA_ONSTACK;\r
-\r
- (* code values for siginfo_t.si_code when sig = SIGFPE *)\r
- FPE_INTDIV* = 1; (* Integer divide by zero. *)\r
- FPE_INTOVF* = 2; (* Integer overflow. *)\r
- FPE_FLTDIV* = 3; (* Floating point divide by zero. *)\r
- FPE_FLTOVF* = 4; (* Floating point overflow. *)\r
- FPE_FLTUND* = 5; (* Floating point underflow. *)\r
- FPE_FLTRES* =6; (* Floating point inexact result. *)\r
- FPE_FLTINV* = 7; (* Floating point invalid operation. *)\r
- FPE_FLTSUB* = 8; (* Subscript out of range. *)\r
-\r
- (* possible error constants for errno *)\r
- EPERM* = 1; (* Operation not permitted *)\r
- ENOENT* = 2; (* No such file or directory *)\r
- ESRCH* = 3; (* No such process *)\r
- EINTR* = 4; (* Interrupted system call *)\r
- EIO* = 5; (* I/O error *)\r
- ENXIO* = 6; (* No such device or address *)\r
- E2BIG* = 7; (* Arg list too long *)\r
- ENOEXEC* = 8; (* Exec format error *)\r
- EBADF* = 9; (* Bad file number *)\r
- ECHILD* = 10; (* No child processes *)\r
- EAGAIN* = 11; (* Try again *)\r
- ENOMEM* = 12; (* Out of memory *)\r
- EACCES* = 13; (* Permission denied *)\r
- EFAULT* = 14; (* Bad address *)\r
- ENOTBLK* = 15; (* Block device required *)\r
- EBUSY* = 16; (* Device or resource busy *)\r
- EEXIST* = 17; (* File exists *)\r
- EXDEV* = 18; (* Cross-device link *)\r
- ENODEV* = 19; (* No such device *)\r
- ENOTDIR* = 20; (* Not a directory *)\r
- EISDIR* = 21; (* Is a directory *)\r
- EINVAL* = 22; (* Invalid argument *)\r
- ENFILE* = 23; (* File table overflow *)\r
- EMFILE* = 24; (* Too many open files *)\r
- ENOTTY* = 25; (* Not a typewriter *)\r
- ETXTBSY* = 26; (* Text file busy *)\r
- EFBIG* = 27; (* File too large *)\r
- ENOSPC* = 28; (* No space left on device *)\r
- ESPIPE* = 29; (* Illegal seek *)\r
- EROFS* = 30; (* Read-only file system *)\r
- EMLINK* = 31; (* Too many links *)\r
- EPIPE* = 32; (* Broken pipe *)\r
- EDOM* = 33; (* Math argument out of domain of func *)\r
- ERANGE* = 34; (* Math result not representable *)\r
- EDEADLK* = 35; (* Resource deadlock would occur *)\r
- ENAMETOOLONG* = 36; (* File name too long *)\r
- ENOLCK* = 37; (* No record locks available *)\r
- ENOSYS* = 38; (* Function not implemented *)\r
- ENOTEMPTY* = 39; (* Directory not empty *)\r
- ELOOP* = 40; (* Too many symbolic links encountered *)\r
- EWOULDBLOCK* = EAGAIN; (* Operation would block *)\r
- ENOMSG* = 42; (* No message of desired type *)\r
- EIDRM* = 43; (* Identifier removed *)\r
- ECHRNG* = 44; (* Channel number out of range *)\r
- EL2NSYNC* = 45; (* Level 2 not synchronized *)\r
- EL3HLT* = 46; (* Level 3 halted *)\r
- EL3RST* = 47; (* Level 3 reset *)\r
- ELNRNG* = 48; (* Link number out of range *)\r
- EUNATCH* = 49; (* Protocol driver not attached *)\r
- ENOCSI* = 50; (* No CSI structure available *)\r
- EL2HLT* = 51; (* Level 2 halted *)\r
- EBADE* = 52; (* Invalid exchange *)\r
- EBADR* = 53; (* Invalid request descriptor *)\r
- EXFULL* = 54; (* Exchange full *)\r
- ENOANO* = 55; (* No anode *)\r
- EBADRQC* = 56; (* Invalid request code *)\r
- EBADSLT* = 57; (* Invalid slot *)\r
- EDEADLOCK* = EDEADLK;\r
- EBFONT* = 59; (* Bad font file format *)\r
- ENOSTR* = 60; (* Device not a stream *)\r
- ENODATA* = 61; (* No data available *)\r
- ETIME* = 62; (* Timer expired *)\r
- ENOSR* = 63; (* Out of streams resources *)\r
- ENONET* = 64; (* Machine is not on the network *)\r
- ENOPKG* = 65; (* Package not installed *)\r
- EREMOTE* = 66; (* Object is remote *)\r
- ENOLINK* = 67; (* Link has been severed *)\r
- EADV* = 68; (* Advertise error *)\r
- ESRMNT* = 69; (* Srmount error *)\r
- ECOMM* = 70; (* Communication error on send *)\r
- EPROTO* = 71; (* Protocol error *)\r
- EMULTIHOP* = 72; (* Multihop attempted *)\r
- EDOTDOT* = 73; (* RFS specific error *)\r
- EBADMSG* = 74; (* Not a data message *)\r
- EOVERFLOW* = 75; (* Value too large for defined data type *)\r
- ENOTUNIQ* = 76; (* Name not unique on network *)\r
- EBADFD* = 77; (* File descriptor in bad state *)\r
- EREMCHG* = 78; (* Remote address changed *)\r
- ELIBACC* = 79; (* Can not access a needed shared library *)\r
- ELIBBAD* = 80; (* Accessing a corrupted shared library *)\r
- ELIBSCN* = 81; (* .lib section in a.out corrupted *)\r
- ELIBMAX* = 82; (* Attempting to link in too many shared libraries *)\r
- ELIBEXEC* = 83; (* Cannot exec a shared library directly *)\r
- EILSEQ* = 84; (* Illegal byte sequence *)\r
- ERESTART* = 85; (* Interrupted system call should be restarted *)\r
- ESTRPIPE* = 86; (* Streams pipe error *)\r
- EUSERS* = 87; (* Too many users *)\r
- ENOTSOCK* = 88; (* Socket operation on non-socket *)\r
- EDESTADDRREQ* = 89; (* Destination address required *)\r
- EMSGSIZE* = 90; (* Message too long *)\r
- EPROTOTYPE* = 91; (* Protocol wrong type for socket *)\r
- ENOPROTOOPT* = 92; (* Protocol not available *)\r
- EPROTONOSUPPORT* = 93; (* Protocol not supported *)\r
- ESOCKTNOSUPPORT* = 94; (* Socket type not supported *)\r
- EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *)\r
- EPFNOSUPPORT* = 96; (* Protocol family not supported *)\r
- EAFNOSUPPORT* = 97; (* Address family not supported by protocol *)\r
- EADDRINUSE* = 98; (* Address already in use *)\r
- EADDRNOTAVAIL* = 99; (* Cannot assign requested address *)\r
- ENETDOWN* = 100; (* Network is down *)\r
- ENETUNREACH* = 101; (* Network is unreachable *)\r
- ENETRESET* = 102; (* Network dropped connection because of reset *)\r
- ECONNABORTED* = 103; (* Software caused connection abort *)\r
- ECONNRESET* = 104; (* Connection reset by peer *)\r
- ENOBUFS* = 105; (* No buffer space available *)\r
- EISCONN* = 106; (* Transport endpoint is already connected *)\r
- ENOTCONN* = 107; (* Transport endpoint is not connected *)\r
- ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *)\r
- ETOOMANYREFS* = 109; (* Too many references: cannot splice *)\r
- ETIMEDOUT* = 110; (* Connection timed out *)\r
- ECONNREFUSED* = 111; (* Connection refused *)\r
- EHOSTDOWN* = 112; (* Host is down *)\r
- EHOSTUNREACH* = 113; (* No route to host *)\r
- EALREADY* = 114; (* Operation already in progress *)\r
- EINPROGRESS* = 115; (* Operation now in progress *)\r
- ESTALE* = 116; (* Stale NFS file handle *)\r
- EUCLEAN* = 117; (* Structure needs cleaning *)\r
- ENOTNAM* = 118; (* Not a XENIX named type file *)\r
- ENAVAIL* = 119; (* No XENIX semaphores available *)\r
- EISNAM* = 120; (* Is a named type file *)\r
- EREMOTEIO* = 121; (* Remote I/O error *)\r
- EDQUOT* = 122; (* Quota exceeded *)\r
- ENOMEDIUM* = 123; (* No medium found *)\r
- EMEDIUMTYPE* = 124; (* Wrong medium type *)\r
-\r
- PROT_NONE* = {}; (* No access *)\r
- PROT_READ* = {2}; (* Pages can be read *)\r
- PROT_WRITE* = {1}; (* Pages can be written *)\r
- PROT_EXEC* = {0}; (* Pages can be executed *)\r
- MAP_FILE* = {0}; (* Mapped from a file or device *)\r
- MAP_ANON* = {1}; (* Allocated from anonymous virtual memory *)\r
- MAP_COPY* = {5}; (* Virtual copy of region at mapping time *)\r
- MAP_SHARED* = {4}; (* Share changes *)\r
- MAP_PRIVATE* = {}; (* Changes private; copy pages on write *)\r
- MAP_FIXED* = {8}; (* Map address must be exactly as requested *)\r
- MAP_NOEXTEND* = {9} ; (* For MAP_FILE, don't change file size *)\r
- MAP_HASSEMPHORE*= {10}; (* Region may contain semaphores *)\r
- MAP_INHERIT* = {11} ; (* Region is retained after exec *)\r
- MAP_FAILED* = -1;\r
-\r
- O_RDONLY* = {} ; (* Open read-only *)\r
- O_WRONLY* = {0} ; (* Open write-only *)\r
- O_RDWR* = {1} ; (* Open read/write *)\r
- O_NONBLOCK* = {11};\r
-\r
- SIG_BLOCK* = 0; (* Block signals *)\r
- SIG_UNBLOCK* = 1; (* Unblock signals *)\r
- SIG_SETMASK* = 2; (* Set the set of blocked signals *)\r
-\r
- _SC_PAGESIZE* = 30;\r
-\r
- SIGSTKSZ* = 8192;\r
-\r
- STDIN_FILENO* = 0;\r
- STDOUT_FILENO* = 1;\r
- STDERR_FILENO* = 2;\r
-\r
- WAIT_ANY* = -1;\r
- WCONTINUED* = {3};\r
- WNOHANG* = {0};\r
- WUNTRACED* = {1};\r
-\r
- TYPE \r
- __ftw_func_t* = PROCEDURE (fileName: PtrSTR; VAR [nil] stat: stat_t; flag: INTEGER): INTEGER;\r
- PtrVoid* = INTEGER;\r
- PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;\r
- wchar_t* = INTEGER;\r
- PtrWSTR* = POINTER TO ARRAY [untagged] OF wchar_t;\r
- PtrInt* = INTEGER;\r
- StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;\r
- PtrFILE* = INTEGER;\r
- PtrDIR* = INTEGER;\r
- PtrProc* = INTEGER;\r
- clock_t* = INTEGER;\r
- jmp_buf* = ARRAY [untagged] 6 OF INTEGER; (* bx, si, di, bp, sp, pc *)\r
- mode_t* = SET;\r
- off_t* = INTEGER;\r
- SelectorFunc* = PROCEDURE (dirent: Dirent): INTEGER;\r
- CmpFunc* = PROCEDURE (VAR [nil] dirent1, dirent2: PtrDirent): INTEGER;\r
- size_t* = INTEGER; (* should be unsigned int *)\r
- ssize_t* = INTEGER;\r
- sigjmp_buf* = RECORD [untagged] \r
- buf*: jmp_buf;\r
- mask_was_saved*: INTEGER;\r
- saved_mask*: sigset_t;\r
- END; \r
- \r
- PtrDirent* = POINTER TO Dirent;\r
- PtrDirentArray* = POINTER TO ARRAY [untagged] OF Dirent;\r
- Dirent* = RECORD [untagged]\r
- d_ino*: INTEGER; (* inode number *)\r
- d_off*: off_t; (* offset to this dirent *)\r
- d_reclen*: SHORTINT; (* length of this d_name *)\r
- d_type*: BYTE;\r
- d_name*: ARRAY[untagged] NAME_MAX+1 OF SHORTCHAR; (* file name (null-terminated) *)\r
- END;\r
- \r
- pid_t* = INTEGER;\r
- uid_t* = INTEGER;\r
- sigval_t* = INTEGER;\r
-\r
- siginfo_t* = RECORD [untagged]\r
- si_signo*: INTEGER; (* Signal number *)\r
- si_errno*: INTEGER; (* An errno value *)\r
- si_code*: INTEGER; (* Signal code *)\r
- si_pid*: pid_t; (* Sending process ID *)\r
- si_uid*: uid_t; (* Real user ID of sending process *)\r
- si_status*: INTEGER; (* Exit value or signal *)\r
- si_utime*: clock_t; (* User time consumed *)\r
- si_stime*: clock_t; (* System time consumed *)\r
- si_value*: sigval_t; (* Signal value *)\r
- si_int*: INTEGER; (* POSIX.1b signal *)\r
- si_ptr*: PtrVoid; (* POSIX.1b signal *)\r
- si_addr*: PtrVoid; (* Memory location which caused fault *)\r
- si_band*: INTEGER; (* Band event *)\r
- si_fd*: INTEGER; (* File descriptor *)\r
- END;\r
- Ptrsiginfo_t* = POINTER TO siginfo_t;\r
- \r
- sigset_t* = ARRAY [untagged] 128 OF BYTE;\r
- Ptrsigset_t* = INTEGER;\r
- sigaction_t* = RECORD [untagged]\r
- sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; ptr: Ptrucontext_t); (* union with sa_handler*: PtrProc;*)\r
- sa_mask*: sigset_t;\r
- sa_flags*: SET;\r
- sa_restorer*: LONGINT;\r
- END;\r
- \r
- stack_t* = RECORD [untagged]\r
- ss_sp*: PtrVoid; \r
- ss_flags*: INTEGER; \r
- ss_size*: size_t;\r
- END;\r
- \r
- stat_t* = RECORD [untagged]\r
- st_dev*: LONGINT; (* device *)\r
- __pad1: SHORTINT;\r
- st_ino*: INTEGER; (* 64? inode *)\r
- st_mode*: mode_t; (* protection *)\r
- st_nlink*: INTEGER; (* number of hard links *)\r
- st_uid*: uid_t; (* user ID of owner *)\r
- st_gid*: INTEGER; (* group ID of owner *)\r
- st_rdev*: LONGINT; (* device type (if inode device) *)\r
- __pad2: SHORTINT;\r
- st_size*: off_t; (* 64? total size, in bytes *)\r
- st_blksize*: INTEGER; (* blocksize for filesystem I/O *)\r
- st_blocks*: INTEGER; (* 64? number of blocks allocated *)\r
- st_atime*: INTEGER; (* time of last access *)\r
- __unused1: INTEGER;\r
- st_mtime*: INTEGER; (* time of last modification *) \r
- __unused2: INTEGER;\r
- st_ctime*: INTEGER; (* time of last change *)\r
- __unused3: INTEGER;\r
- __unused4: INTEGER;\r
- __unused5: INTEGER;\r
- END;\r
- \r
- fpreg* = RECORD [untagged]\r
- significand*: ARRAY [untagged] 4 OF CHAR;\r
- exponent*: CHAR;\r
- END;\r
-\r
- fpstate* = RECORD [untagged]\r
- cw*: INTEGER; (* unsigned long int *)\r
- sw*: INTEGER; (* unsigned long int *)\r
- tag*: INTEGER; (* unsigned long int *)\r
- ipoff*: INTEGER; (* unsigned long int *)\r
- cssel*: INTEGER; (* unsigned long int *)\r
- dataoff*: INTEGER; (* unsigned long int *)\r
- datasel*: INTEGER; (* unsigned long int *)\r
- _st: ARRAY [untagged] 8 OF fpreg;\r
- status*: INTEGER; (* unsigned long int *)\r
- END;\r
-\r
- gregset_t* = ARRAY [untagged] 19 OF INTEGER;\r
- fpregset_t* = POINTER TO fpstate;\r
- \r
- mcontext_t* = RECORD [untagged]\r
- gregs*: gregset_t;\r
- fpregs*: fpregset_t;\r
- oldmask*: INTEGER; (* unsigned long int *)\r
- cr2*: INTEGER; (* unsigned long int *)\r
- END;\r
- \r
- Ptrucontext_t* = POINTER TO ucontext_t;\r
- ucontext_t* = RECORD [untagged]\r
- uc_flags*: INTEGER; (* unsigned long int *)\r
- uc_link*: Ptrucontext_t;\r
- uc_stack*: stack_t;\r
- uc_mcontext*: mcontext_t;\r
- uc_sigmask: sigset_t;\r
- __fpregs_mem*: fpstate;\r
- END;\r
- \r
- (* Times and Dates *)\r
- \r
- tm* = POINTER TO tmDesc;\r
- tmDesc* = RECORD [untagged]\r
- tm_sec*: INTEGER; (* seconds *)\r
- tm_min*: INTEGER; (* minutes *)\r
- tm_hour*: INTEGER; (* hours *)\r
- tm_mday*: INTEGER; (* day of the month *)\r
- tm_mon*: INTEGER; (* month *)\r
- tm_year*: INTEGER; (* year *)\r
- tm_wday*: INTEGER; (* day of the week *)\r
- tm_yday*: INTEGER; (* day in the year *)\r
- tm_isdst*: INTEGER; (* daylight saving time *)\r
- END;\r
- time_t* = INTEGER;\r
-\r
- VAR\r
- timezone*: INTEGER; (* seconds from GMT *) \r
-(*\r
- stdin*, stdout*, stderr* : PtrFILE;\r
-*)\r
-\r
- PROCEDURE [ccall] calloc* (num, size: size_t): PtrVoid;\r
- PROCEDURE [ccall] clock* (): clock_t;\r
- PROCEDURE [ccall] closedir* (dir: PtrDIR): INTEGER;\r
- PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): INTEGER;\r
- PROCEDURE [ccall] fchmod* (fd: INTEGER; mode: mode_t): INTEGER;\r
- PROCEDURE [ccall] exit* (status: INTEGER);\r
- PROCEDURE [ccall] fclose* (fp: PtrFILE): INTEGER;\r
- PROCEDURE [ccall] fflush* (fp: PtrFILE): INTEGER;\r
- PROCEDURE [ccall] fopen* (filename, mode: PtrSTR): PtrFILE;\r
- PROCEDURE [ccall] fdopen* (fildes: INTEGER; mode: PtrSTR): PtrFILE;\r
- PROCEDURE [ccall] feof* (fp: PtrFILE): INTEGER;\r
- PROCEDURE [ccall] fileno* (stream: PtrFILE): INTEGER;\r
- PROCEDURE [ccall] fread* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t;\r
- PROCEDURE [ccall] fseek* (stream: PtrFILE; offset, origin: INTEGER): INTEGER;\r
- PROCEDURE [ccall] free* (p: PtrVoid);\r
- PROCEDURE [ccall] ftell* (stream: PtrFILE): LONGINT;\r
- PROCEDURE [ccall] ftw* (filename: PtrSTR; func: __ftw_func_t; descriptors: INTEGER): INTEGER;\r
- PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t;\r
- PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;\r
- PROCEDURE [ccall] getcontext* (ucontext_t: Ptrucontext_t): INTEGER;\r
- PROCEDURE [ccall] gets* (s: PtrSTR);\r
- PROCEDURE [ccall] fgets* (s: PtrSTR; n: INTEGER; fp: PtrFILE): PtrSTR;\r
- PROCEDURE [ccall] gmtime* (VAR timep: time_t): tm;\r
- PROCEDURE [ccall] kill* (pid: pid_t; sig: INTEGER): INTEGER;\r
- PROCEDURE [ccall] localtime* (VAR timep: time_t): tm;\r
- PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;\r
- PROCEDURE [ccall] mkdir* (pathname: PtrSTR; mode: mode_t): INTEGER;\r
- PROCEDURE [ccall] mktime* (timeptr: tm): time_t;\r
- PROCEDURE [ccall] opendir* (name: PtrSTR): PtrDIR;\r
- PROCEDURE [ccall] printf* (s: PtrSTR): INTEGER; \r
- PROCEDURE [ccall] readdir* (dir: PtrDIR): PtrDirent;\r
- PROCEDURE [ccall] remove* (filename: PtrSTR): INTEGER;\r
- PROCEDURE [ccall] rename* (oldname, newname: PtrSTR): INTEGER;\r
- PROCEDURE [ccall] scandir* (dir: PtrDIR; namelist: PtrDirentArray; selector: SelectorFunc; cmp: CmpFunc): INTEGER;\r
- PROCEDURE [ccall] setcontext* (ucontext_t: Ptrucontext_t): INTEGER;\r
- PROCEDURE [ccall] setjmp* (VAR env: jmp_buf): INTEGER;\r
- PROCEDURE [ccall] sigaction* (sig_num: INTEGER; VAR [nil] act: sigaction_t; VAR [nil] oldact: sigaction_t): INTEGER;\r
- PROCEDURE [ccall] sigaddset* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
- PROCEDURE [ccall] sigdelset* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
- PROCEDURE [ccall] sigemptyset* (set: Ptrsigset_t): INTEGER;\r
- PROCEDURE [ccall] sigfillset* (set: Ptrsigset_t): INTEGER;\r
- PROCEDURE [ccall] sigismemeber* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
- PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: INTEGER);\r
- PROCEDURE [ccall] signal* (sig_num: INTEGER; sighandler: PtrProc): PtrProc;\r
- PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: INTEGER): INTEGER; \r
-(*\r
- PROCEDURE [ccall] stat* (filename: PtrSTR; VAR buf: stat_t): INTEGER; stat is a macro and expands to __xstat(3, filename, buf)\r
-*)\r
- PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;\r
- PROCEDURE [ccall] strftime* (s: PtrSTR; max: size_t; format: PtrSTR; ptm: tm): size_t;\r
- PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;\r
-\r
- PROCEDURE [ccall] __errno_location*(): INTEGER;\r
-\r
- PROCEDURE [ccall] open* (name: PtrSTR; flags: SET; mode: mode_t): INTEGER;\r
- PROCEDURE [ccall] close* (d: INTEGER): INTEGER;\r
- PROCEDURE [ccall] read* (d: INTEGER; buf: PtrVoid; nbytes: size_t): ssize_t;\r
- PROCEDURE [ccall] write* (d: INTEGER; buf: PtrVoid; nBytes: size_t): ssize_t;\r
-\r
- PROCEDURE [ccall] mmap* (addr: PtrVoid; len: size_t; prot: SET; flags: SET; fd, offset: off_t): PtrVoid;\r
- PROCEDURE [ccall] munmap* (addr: PtrVoid; len: size_t): INTEGER;\r
- PROCEDURE [ccall] mprotect* (addr: PtrVoid; len: size_t; prot: SET): INTEGER;\r
-\r
- PROCEDURE [ccall] getenv* (name: PtrSTR): PtrSTR;\r
- \r
- PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): INTEGER;\r
-\r
- PROCEDURE [ccall] sigprocmask* (how: INTEGER; set: Ptrsigset_t; oldset: Ptrsigset_t): INTEGER;\r
-\r
- PROCEDURE [ccall] fork* (): pid_t;\r
- PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: INTEGER; options: SET): pid_t;\r
-\r
- PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER;\r
- PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER;\r
-\r
- PROCEDURE [ccall] system* (string: PtrSTR): INTEGER;\r
-\r
- PROCEDURE [ccall] sysconf* (name: INTEGER): INTEGER;\r
-\r
- PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE;\r
- PROCEDURE [ccall] pclose* (stream: PtrFILE): INTEGER;\r
-\r
-END LinLibc.\r
+MODULE LinLibc ["libc.so.6"];
+
+ (*
+ GNU/Linux (Ubuntu 17.10)
+ i386
+ *)
+
+ CONST
+ NULL* = 0H;
+ FALSE* = 0;
+ TRUE* = 1;
+
+ CLOCKS_PER_SEC* = 1000000;
+
+ MAP_FAILED* = -1;
+
+ (* MAP_PRIVATE, MAP_ANON (intFlags) *)
+ MAP_SHARED* = {0}; (* Share changes *)
+ MAP_PRIVATE* = {1}; (* Changes are private *)
+ MAP_TYPE* = {0..3}; (* Mask for type of mapping *)
+ MAP_FIXED* = {4}; (* Interpret addr exactly *)
+ MAP_ANONYMOUS* = {5}; (* don't use a file *)
+ MAP_FILE* = {};
+ MAP_HUGE_SHIFT* = {1,3,4};
+ MAP_HUGE_MASK* = {0..5};
+ MAP_ANON* = MAP_ANONYMOUS;
+
+
+ (* PROT_READ, PROT_WRITE, PROT_EXEC (intFlags) *)
+ PROT_READ* = {0}; (* page can be read *)
+ PROT_WRITE* = {1}; (* page can be written *)
+ PROT_EXEC* = {2}; (* page can be executed *)
+ PROT_SEM* = {3}; (* page may be used for atomic ops *)
+ PROT_NONE* = {}; (* page can not be accessed *)
+ PROT_GROWSDOWN* = {24}; (* mprotect flag: extend change to start of growsdown vma *)
+ PROT_GROWSUP* = {25}; (* mprotect flag: extend change to end of growsup vma *)
+
+
+ (* SIG_UNBLOCK, SIG_SETMASK (int) *)
+ SIG_BLOCK* = 0; (* for blocking signals *)
+ SIG_UNBLOCK* = 1; (* for unblocking signals *)
+ SIG_SETMASK* = 2; (* for setting the signal mask *)
+
+
+ (* FPE_INTDIV, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB (int) *)
+ FPE_INTDIV* = 1; (* integer divide by zero *)
+ FPE_INTOVF* = 2; (* integer overflow *)
+ FPE_FLTDIV* = 3; (* floating point divide by zero *)
+ FPE_FLTOVF* = 4; (* floating point overflow *)
+ FPE_FLTUND* = 5; (* floating point underflow *)
+ FPE_FLTRES* = 6; (* floating point inexact result *)
+ FPE_FLTINV* = 7; (* floating point invalid operation *)
+ FPE_FLTSUB* = 8; (* subscript out of range *)
+
+
+ (* SA_SIGINFO (intFlags) *)
+ SA_NOCLDSTOP* = {0};
+ SA_NOCLDWAIT* = {1};
+ SA_SIGINFO* = {2};
+ SA_ONSTACK* = {27};
+ SA_RESTART* = {28};
+ SA_NODEFER* = {30};
+ SA_RESETHAND* = {31};
+
+
+ (* SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGKILL, SIGSTOP, SIGWINCH, SIGTHR (int) *)
+ SIGHUP* = 1;
+ SIGINT* = 2;
+ SIGQUIT* = 3;
+ SIGILL* = 4;
+ SIGTRAP* = 5;
+ SIGABRT* = 6;
+ SIGIOT* = 6;
+ SIGBUS* = 7;
+ SIGFPE* = 8;
+ SIGKILL* = 9;
+ SIGUSR1* = 10;
+ SIGSEGV* = 11;
+ SIGUSR2* = 12;
+ SIGPIPE* = 13;
+ SIGALRM* = 14;
+ SIGTERM* = 15;
+ SIGSTKFLT* = 16;
+ SIGCHLD* = 17;
+ SIGCONT* = 18;
+ SIGSTOP* = 19;
+ SIGTSTP* = 20;
+ SIGTTIN* = 21;
+ SIGTTOU* = 22;
+ SIGURG* = 23;
+ SIGXCPU* = 24;
+ SIGXFSZ* = 25;
+ SIGVTALRM* = 26;
+ SIGPROF* = 27;
+ SIGWINCH* = 28;
+ SIGIO* = 29;
+ SIGPOLL* = SIGIO;
+ SIGLOST* = 29;
+ SIGPWR* = 30;
+ SIGSYS* = 31;
+ SIGUNUSED* = 31;
+ SIGRTMIN* = 32;
+
+ _NSIG* = 64;
+
+(*
+ PAGE_SIZE* = 4096;
+*)
+ _SC_PAGESIZE* = 30;
+
+
+ SIGSTKSZ* = 8192;
+
+ (* ENOENT, EEXIST, EACCES, ENOMEM, EDQUOT, EMFILE, ENOTDIR (int) *)
+ EPERM* = 1; (* Operation not permitted *)
+ ENOENT* = 2; (* No such file or directory *)
+ ESRCH* = 3; (* No such process *)
+ EINTR* = 4; (* Interrupted system call *)
+ EIO* = 5; (* I/O error *)
+ ENXIO* = 6; (* No such device or address *)
+ E2BIG* = 7; (* Argument list too long *)
+ ENOEXEC* = 8; (* Exec format error *)
+ EBADF* = 9; (* Bad file number *)
+ ECHILD* = 10; (* No child processes *)
+ EAGAIN* = 11; (* Try again *)
+ ENOMEM* = 12; (* Out of memory *)
+ EACCES* = 13; (* Permission denied *)
+ EFAULT* = 14; (* Bad address *)
+ ENOTBLK* = 15; (* Block device required *)
+ EBUSY* = 16; (* Device or resource busy *)
+ EEXIST* = 17; (* File exists *)
+ EXDEV* = 18; (* Cross-device link *)
+ ENODEV* = 19; (* No such device *)
+ ENOTDIR* = 20; (* Not a directory *)
+ EISDIR* = 21; (* Is a directory *)
+ EINVAL* = 22; (* Invalid argument *)
+ ENFILE* = 23; (* File table overflow *)
+ EMFILE* = 24; (* Too many open files *)
+ ENOTTY* = 25; (* Not a typewriter *)
+ ETXTBSY* = 26; (* Text file busy *)
+ EFBIG* = 27; (* File too large *)
+ ENOSPC* = 28; (* No space left on device *)
+ ESPIPE* = 29; (* Illegal seek *)
+ EROFS* = 30; (* Read-only file system *)
+ EMLINK* = 31; (* Too many links *)
+ EPIPE* = 32; (* Broken pipe *)
+ EDOM* = 33; (* Math argument out of domain of func *)
+ ERANGE* = 34; (* Math result not representable *)
+ EDEADLK* = 35; (* Resource deadlock would occur *)
+ ENAMETOOLONG* = 36; (* File name too long *)
+ ENOLCK* = 37; (* No record locks available *)
+ ENOSYS* = 38; (* Invalid system call number *)
+ ENOTEMPTY* = 39; (* Directory not empty *)
+ ELOOP* = 40; (* Too many symbolic links encountered *)
+ EWOULDBLOCK* = EAGAIN; (* Operation would block *)
+ ENOMSG* = 42; (* No message of desired type *)
+ EIDRM* = 43; (* Identifier removed *)
+ ECHRNG* = 44; (* Channel number out of range *)
+ EL2NSYNC* = 45; (* Level 2 not synchronized *)
+ EL3HLT* = 46; (* Level 3 halted *)
+ EL3RST* = 47; (* Level 3 reset *)
+ ELNRNG* = 48; (* Link number out of range *)
+ EUNATCH* = 49; (* Protocol driver not attached *)
+ ENOCSI* = 50; (* No CSI structure available *)
+ EL2HLT* = 51; (* Level 2 halted *)
+ EBADE* = 52; (* Invalid exchange *)
+ EBADR* = 53; (* Invalid request descriptor *)
+ EXFULL* = 54; (* Exchange full *)
+ ENOANO* = 55; (* No anode *)
+ EBADRQC* = 56; (* Invalid request code *)
+ EBADSLT* = 57; (* Invalid slot *)
+ EDEADLOCK* = EDEADLK;
+ EBFONT* = 59; (* Bad font file format *)
+ ENOSTR* = 60; (* Device not a stream *)
+ ENODATA* = 61; (* No data available *)
+ ETIME* = 62; (* Timer expired *)
+ ENOSR* = 63; (* Out of streams resources *)
+ ENONET* = 64; (* Machine is not on the network *)
+ ENOPKG* = 65; (* Package not installed *)
+ EREMOTE* = 66; (* Object is remote *)
+ ENOLINK* = 67; (* Link has been severed *)
+ EADV* = 68; (* Advertise error *)
+ ESRMNT* = 69; (* Srmount error *)
+ ECOMM* = 70; (* Communication error on send *)
+ EPROTO* = 71; (* Protocol error *)
+ EMULTIHOP* = 72; (* Multihop attempted *)
+ EDOTDOT* = 73; (* RFS specific error *)
+ EBADMSG* = 74; (* Not a data message *)
+ EOVERFLOW* = 75; (* Value too large for defined data type *)
+ ENOTUNIQ* = 76; (* Name not unique on network *)
+ EBADFD* = 77; (* File descriptor in bad state *)
+ EREMCHG* = 78; (* Remote address changed *)
+ ELIBACC* = 79; (* Can not access a needed shared library *)
+ ELIBBAD* = 80; (* Accessing a corrupted shared library *)
+ ELIBSCN* = 81; (* .lib section in a.out corrupted *)
+ ELIBMAX* = 82; (* Attempting to link in too many shared libraries *)
+ ELIBEXEC* = 83; (* Cannot exec a shared library directly *)
+ EILSEQ* = 84; (* Illegal byte sequence *)
+ ERESTART* = 85; (* Interrupted system call should be restarted *)
+ ESTRPIPE* = 86; (* Streams pipe error *)
+ EUSERS* = 87; (* Too many users *)
+ ENOTSOCK* = 88; (* Socket operation on non-socket *)
+ EDESTADDRREQ* = 89; (* Destination address required *)
+ EMSGSIZE* = 90; (* Message too long *)
+ EPROTOTYPE* = 91; (* Protocol wrong type for socket *)
+ ENOPROTOOPT* = 92; (* Protocol not available *)
+ EPROTONOSUPPORT* = 93; (* Protocol not supported *)
+ ESOCKTNOSUPPORT* = 94; (* Socket type not supported *)
+ EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *)
+ EPFNOSUPPORT* = 96; (* Protocol family not supported *)
+ EAFNOSUPPORT* = 97; (* Address family not supported by protocol *)
+ EADDRINUSE* = 98; (* Address already in use *)
+ EADDRNOTAVAIL* = 99; (* Cannot assign requested address *)
+ ENETDOWN* = 100; (* Network is down *)
+ ENETUNREACH* = 101; (* Network is unreachable *)
+ ENETRESET* = 102; (* Network dropped connection because of reset *)
+ ECONNABORTED* = 103; (* Software caused connection abort *)
+ ECONNRESET* = 104; (* Connection reset by peer *)
+ ENOBUFS* = 105; (* No buffer space available *)
+ EISCONN* = 106; (* Transport endpoint is already connected *)
+ ENOTCONN* = 107; (* Transport endpoint is not connected *)
+ ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *)
+ ETOOMANYREFS* = 109; (* Too many references: cannot splice *)
+ ETIMEDOUT* = 110; (* Connection timed out *)
+ ECONNREFUSED* = 111; (* Connection refused *)
+ EHOSTDOWN* = 112; (* Host is down *)
+ EHOSTUNREACH* = 113; (* No route to host *)
+ EALREADY* = 114; (* Operation already in progress *)
+ EINPROGRESS* = 115; (* Operation now in progress *)
+ ESTALE* = 116; (* Stale file handle *)
+ EUCLEAN* = 117; (* Structure needs cleaning *)
+ ENOTNAM* = 118; (* Not a XENIX named type file *)
+ ENAVAIL* = 119; (* No XENIX semaphores available *)
+ EISNAM* = 120; (* Is a named type file *)
+ EREMOTEIO* = 121; (* Remote I/O error *)
+ EDQUOT* = 122; (* Quota exceeded *)
+ ENOMEDIUM* = 123; (* No medium found *)
+ EMEDIUMTYPE* = 124; (* Wrong medium type *)
+ ECANCELED* = 125; (* Operation Canceled *)
+ ENOKEY* = 126; (* Required key not available *)
+ EKEYEXPIRED* = 127; (* Key has expired *)
+ EKEYREVOKED* = 128; (* Key has been revoked *)
+ EKEYREJECTED* = 129; (* Key was rejected by service *)
+ EOWNERDEAD* = 130; (* Owner died *)
+ ENOTRECOVERABLE* = 131; (* State not recoverable *)
+ ERFKILL* = 132; (* Operation not possible due to RF-kill *)
+ EHWPOISON* = 133; (* Memory page has hardware error *)
+
+
+ WAIT_ANY* = -1;
+ WCONTINUED* = {3};
+ WNOHANG* = {0};
+ WUNTRACED* = {1};
+
+
+ NAME_MAX* = 255;
+
+ SEEK_SET* = 0;
+ SEEK_CUR* = 1;
+ SEEK_END* = 2;
+
+ STDIN_FILENO* = 0;
+ STDOUT_FILENO* = 1;
+ STDERR_FILENO* = 2;
+
+ P_tmpdir* = "/tmp";
+
+ (* O_RDWR, O_NONBLOCK (intFlags) *)
+ O_ACCMODE* = {0,1};
+ O_RDONLY* = {};
+ O_WRONLY* = {0};
+ O_RDWR* = {1};
+ O_CREAT* = {6}; (* not fcntl *)
+ O_EXCL* = {7}; (* not fcntl *)
+ O_NOCTTY* = {8}; (* not fcntl *)
+ O_TRUNC* = {9}; (* not fcntl *)
+ O_APPEND* = {10};
+ O_NONBLOCK* = {11};
+ O_DSYNC* = {12}; (* used to be O_SYNC, see below *)
+ O_DIRECT* = {14}; (* direct disk access hint *)
+ O_LARGEFILE* = {15};
+ O_DIRECTORY* = {16}; (* must be a directory *)
+ O_NOFOLLOW* = {17}; (* don't follow links *)
+ O_NOATIME* = {18};
+ O_CLOEXEC* = {19}; (* set close_on_exec *)
+ O_PATH* = {21};
+
+
+ CLOCK_REALTIME* = 0;
+ CLOCK_MONOTONIC* = 1;
+ CLOCK_PROCESS_CPUTIME_ID* = 2;
+ CLOCK_THREAD_CPUTIME_ID* = 3;
+ CLOCK_MONOTONIC_RAW* = 4;
+ CLOCK_REALTIME_COARSE* = 5;
+ CLOCK_MONOTONIC_COARSE* = 6;
+ CLOCK_BOOTTIME* = 7;
+ CLOCK_REALTIME_ALARM* = 8;
+ CLOCK_BOOTTIME_ALARM* = 9;
+ CLOCK_SGI_CYCLE* = 10;
+ CLOCK_TAI* = 11;
+
+
+ TYPE
+ StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;
+ PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;
+
+ (* PtrVoid, int, long, size_t, ssize_t, off_t, time_t, clock_t, sigjmp_buf *)
+ (* mode_t, intFlags, sigset_t (set) *)
+ PtrVoid* = INTEGER;
+ int* = INTEGER;
+ long* = INTEGER;
+ ulong* = INTEGER;
+ size_t* = INTEGER;
+ ssize_t* = INTEGER;
+ off_t* = INTEGER;
+ clock_t* = INTEGER;
+ clockid_t* = INTEGER;
+ time_t* = INTEGER;
+ mode_t* = SET;
+ pid_t* = INTEGER;
+ uid_t* = INTEGER;
+ gid_t* = INTEGER;
+ dev_t* = LONGINT;
+ ino_t* = INTEGER;
+ nlink_t* = INTEGER;
+ blkcnt_t = INTEGER;
+ blksize_t = INTEGER;
+ int8_t* = SHORTCHAR;
+ u_int8_t* = SHORTCHAR;
+ int16_t* = SHORTINT;
+ u_int16_t* = SHORTINT;
+ int32_t* = INTEGER;
+ u_int32_t* = INTEGER;
+ int64_t* = LONGINT;
+ u_int64_t* = LONGINT;
+ wchar_t* = INTEGER;
+ sigjmp_buf* = ARRAY [untagged] 39 OF INTEGER;
+ intFlags* = SET;
+ FILE = ARRAY [untagged] 37 OF INTEGER;
+ sigset_t* = ARRAY [untagged] 128 OF BYTE;
+ PtrSigset_t* = POINTER [untagged] TO sigset_t;
+
+
+ tm* = POINTER TO tmDesc;
+ tmDesc* = RECORD [untagged]
+ (* NOTE: check record size *)
+ (* tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday [ , tm_gmtoff ] *)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_tm.h: *)
+ tm_sec*: int; (* Seconds. [0-60] (1 leap second) *)
+ tm_min*: int; (* Minutes. [0-59] *)
+ tm_hour*: int; (* Hours. [0-23] *)
+ tm_mday*: int; (* Day. [1-31] *)
+ tm_mon*: int; (* Month. [0-11] *)
+ tm_year*: int; (* Year - 1900. *)
+ tm_wday*: int; (* Day of week. [0-6] *)
+ tm_yday*: int; (* Days in year.[0-365] *)
+ tm_isdst*: int; (* DST. [-1/0/1] *)
+
+ tm_gmtoff*: int; (* long int *) (* Seconds east of UTC *)
+ tm_zone*: PtrSTR; (* Timezone abbreviation *)
+ END;
+
+ Ptrsiginfo_t* = POINTER TO siginfo_t;
+ siginfo_t = RECORD [untagged]
+ (* si_code, fault address *)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/siginfo_t.h: *)
+ si_signo*: int; (* Signal number *)
+ si_errno*: int; (* An errno value *)
+ si_code*: int; (* Signal code *)
+
+ _sifields*: RECORD [union]
+ _pad: ARRAY [untagged] 29 OF int;
+ _kill*: RECORD [untagged]
+ si_pid*: pid_t;
+ si_uid*: uid_t
+ END;
+ _timer*: RECORD [untagged]
+ si_tid*: int;
+ si_overrun*: int;
+ si_sigval*: sigval_t
+ END;
+ _rt*: RECORD [untagged]
+ si_pid*: pid_t;
+ si_uid*: uid_t;
+ si_sigval*: sigval_t
+ END;
+ _sigchild*: RECORD [untagged]
+ si_pid: pid_t;
+ si_uid*: uid_t;
+ si_status*: int;
+ si_utime*: clock_t;
+ si_stime*: clock_t
+ END;
+ _sigfault*: RECORD [untagged]
+ si_addr*: PtrVoid;
+ si_addr_lsb*: SHORTINT;
+ _bounds*: RECORD [union]
+ _addr_bnd*: RECORD [untagged]
+ _lower*: PtrVoid;
+ _upper*: PtrVoid
+ END;
+ _pkey: INTEGER
+ END
+ END;
+ _sigpoll: RECORD [untagged]
+ si_band*: int; (* long int *);
+ si_fd*: int
+ END;
+ _sigsys*: RECORD [untagged]
+ _call_addr*: PtrVoid;
+ _syscall*: int;
+ _arch*: int (* unsigned int *)
+ END
+ END;
+ END;
+
+ Ptrucontext_t* = POINTER TO ucontext_t;
+ ucontext_t = RECORD [untagged]
+ (* IP, SP, FP *)
+ uc_flags*: INTEGER; (* unsigned long int *)
+ uc_link*: Ptrucontext_t;
+ uc_stack*: stack_t;
+ uc_mcontext*: RECORD [untagged] (* mcontext_t *)
+ gregs*: gregset_t;
+ fpregs*: fpregset_t;
+ oldmask*: INTEGER; (* unsigned long int *)
+ cr2*: INTEGER; (* unsigned long int *)
+ END;
+ uc_sigmask: sigset_t;
+ __fpregs_mem*: fpstate;
+
+ END;
+
+ sigaction_t* = RECORD [untagged]
+(*
+ sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; context: Ptrucontext_t),
+ sa_flags*: intFlags, sa_mask*: sigset_t
+*)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/asm/signal.h, /usr/include/i386-linux-gnu/bits/sigaction.h *)
+ sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; ptr: Ptrucontext_t); (* union with sa_handler*: PtrProc;*)
+ sa_mask*: sigset_t;
+ sa_flags*: intFlags;
+ sa_restorer*: PROCEDURE [ccall];
+ END;
+
+ stack_t* = RECORD [untagged]
+(*
+ ss_sp*: PtrVoid, ss_size*: size_t, ss_flags*: intFlags
+*)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/stack_t.h: *)
+ ss_sp*: PtrVoid;
+ ss_flags*: intFlags;
+ ss_size*: size_t;
+ END;
+
+ stat_t* = RECORD [untagged]
+(*
+ NOTE: check record size
+ st_mode*: mode_t, st_size*: off_t, st_mtime*: time_t
+*)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/stat.h: *)
+ st_dev*: dev_t;
+ __pad1: SHORTINT;
+ st_ino*: ino_t;
+ st_mode*: mode_t;
+ st_nlink*: nlink_t;
+ st_uid*: uid_t;
+ st_gid*: gid_t;
+ st_rdev*: dev_t;
+ __pad2: SHORTINT;
+ st_size*: off_t;
+ st_blksize*: blksize_t;
+ st_blocks*: blkcnt_t;
+ st_atim*: timespec_t;
+ st_mtim*: timespec_t;
+ st_ctim*: timespec_t;
+ __glibc_reserved4: INTEGER; (* long int *)
+ __glibc_reserved5: INTEGER; (* long int *)
+ END;
+
+ PtrFILE* = PtrVoid;
+ PtrDIR* = PtrVoid;
+
+ PtrDirent* = POINTER TO Dirent;
+ Dirent = RECORD [untagged]
+(*
+ d_name*: ARRAY [untagged] NAME_MAX + 1 OF SHORTCHAR
+*)
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/dirent.h: *)
+ d_ino*: ino_t; (* inode number *)
+ d_off*: off_t; (* offset to this dirent *)
+ d_reclen*: SHORTINT; (* length of this d_name *)
+ d_type*: BYTE;
+ d_name*: ARRAY [untagged] 256 OF SHORTCHAR;
+ END;
+
+ timespec_t* = RECORD [untagged]
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_timespec.h: *)
+ tv_sec*: time_t;
+ tv_nsec*: INTEGER;
+ END;
+
+(*
+ VAR
+ stdin*: INTEGER;
+ timezone*: INTEGER; (* or tm.tm_gmtoff *)
+*)
+(*
+ PROCEDURE [ccall] __errno_location* (): PtrVoid;
+*)
+(*
+ (* POSIX.1 *)
+ PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
+*)
+ TYPE
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/sigval_t.h: *)
+ sigval_t* = RECORD [union]
+ sival_int*: int;
+ sival_ptr*: PtrVoid
+ END;
+
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/sys/ucontext.h: *)
+ greg_t* = int;
+ gregset_t* = ARRAY [untagged] 19 OF greg_t;
+ fpregset_t* = POINTER [untagged] TO fpstate;
+ fpreg* = RECORD [untagged]
+ significand*: ARRAY [untagged] 4 OF SHORTINT; (* unsigned short int *)
+ exponent*: SHORTINT; (* unsigned short int *)
+ END;
+ fpstate* = RECORD [untagged]
+ cw*: INTEGER; (* unsigned long int *)
+ sw*: INTEGER; (* unsigned long int *)
+ tag*: INTEGER; (* unsigned long int *)
+ ipoff*: INTEGER; (* unsigned long int *)
+ cssel*: INTEGER; (* unsigned long int *)
+ dataoff*: INTEGER; (* unsigned long int *)
+ datasel*: INTEGER; (* unsigned long int *)
+ _st: ARRAY [untagged] 8 OF fpreg;
+ status*: INTEGER; (* unsigned long int *)
+ END;
+
+ VAR
+ timezone*: INTEGER; (* seconds from GMT *)
+(*
+ stdin*, stdout*, stderr* : PtrFILE;
+*)
+
+ PROCEDURE [ccall] __errno_location*(): INTEGER;
+
+ PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;
+
+ PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: int): int;
+
+
+ (* 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;
+ PROCEDURE [ccall] mprotect* (adr: PtrVoid; len: size_t; prot: intFlags): int;
+
+(*
+ PROCEDURE [ccall] calloc* (nmemb: size_t; size: size_t): PtrVoid;
+ (* ANSI C 89 *)
+ PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;
+*)
+ PROCEDURE [ccall] free* (ptr: PtrVoid);
+
+ (* AT&T *)
+ PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;
+ PROCEDURE [ccall] gmtime* (VAR [nil] t: time_t): tm;
+ PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
+
+ (* POSIX.1 *)
+(*
+ PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
+*)
+ PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] sigemptyset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigfillset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigaddset* (set: PtrSigset_t; signo: int): int;
+ PROCEDURE [ccall] sigprocmask* (how: int; set: PtrSigset_t; oset: PtrSigset_t): int;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
+
+ (* BSD *)
+ PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): int;
+
+ (* ANSI C 89 *)
+ PROCEDURE [ccall] getenv* (s: PtrSTR): PtrSTR;
+
+ (* 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;
+ PROCEDURE [ccall] fflush* (s: PtrFILE): int;
+ PROCEDURE [ccall] printf* (s: PtrSTR): int;
+ (* ANSI C 89, XPG4 *)
+ PROCEDURE [ccall] fseek* (stream: PtrFILE; offset: long; whence: int): int;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] fileno* (stream: PtrFILE): int;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] rename* (from, to: PtrSTR): int;
+ PROCEDURE [ccall] mkdir* (path: PtrSTR; mode: mode_t): int;
+ PROCEDURE [ccall] opendir* (filename: PtrSTR): PtrDIR;
+ PROCEDURE [ccall] readdir* (dirp: PtrDIR): PtrDirent;
+ PROCEDURE [ccall] closedir* (dirp: PtrDIR): int;
+ (* ANSI C 89, XPG4.2 *)
+ PROCEDURE [ccall] remove* (path: PtrSTR): int;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;
+
+ (* ANSI C 99 *)
+ PROCEDURE [ccall] exit* (status: int);
+
+ (* ANSI C 89 *)
+ PROCEDURE [ccall] strftime* (buf: PtrSTR; maxsize: size_t; format: PtrSTR; timeptr: tm): size_t;
+
+ (* XXX: use fread instead *)
+ PROCEDURE [ccall] fgets* (str: PtrSTR; size: int; stream: PtrFILE): PtrSTR;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] open* (path: PtrSTR; flags: intFlags; mode: mode_t): int;
+ 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] chmod* (path: PtrSTR; mode: mode_t): int;
+ PROCEDURE [ccall] fchmod* (fd: int; mode: mode_t): int;
+
+ (* POSIX.1 *)
+ 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;
+
+END LinLibc.
similarity index 100%
rename from BlackBox/_Linux_/Lin/Mod/Libc.odc
rename to BlackBox/_Linux_/Lin/Mod/attic/Libc.odc
rename from BlackBox/_Linux_/Lin/Mod/Libc.odc
rename to BlackBox/_Linux_/Lin/Mod/attic/Libc.odc
diff --git a/BlackBox/_Linux_/Lin/Mod/attic/Libc.txt b/BlackBox/_Linux_/Lin/Mod/attic/Libc.txt
--- /dev/null
@@ -0,0 +1,494 @@
+MODULE LinLibc ["libc.so.6"];\r
+\r
+ (* THIS IS TEXT COPY OF Libc.odc *)\r
+ (* DO NOT EDIT *)\r
+\r
+ IMPORT SYSTEM;\r
+ \r
+ CONST\r
+ NULL* = 0H;\r
+ TRUE* = 1;\r
+ FALSE* = 0;\r
+ \r
+ (* file constants *)\r
+ SEEK_SET* = 0;\r
+ SEEK_CUR* = 1;\r
+ SEEK_END* = 2;\r
+ NAME_MAX* = 256;\r
+ \r
+ (* The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems.*)\r
+ CLOCKS_PER_SECOND* = 1000000; \r
+ \r
+ (* temp directory defined in stdio.h *)\r
+ P_tmpdir* = "/tmp";\r
+ \r
+ (* signal constants *) (* Fake signal functions. *)\r
+ SIG_ERR* = -1; (* Error return. *)\r
+ SIG_DFL* = 0; (* Default action. *)\r
+ SIG_IGN* = 1; (* Ignore signal. *)\r
+ SIG_HOLD* = 2; (* Add signal to hold mask. *)\r
+ \r
+ (* Signals. *)\r
+ SIGHUP* = 1; (* Hangup (POSIX). *)\r
+ SIGINT* = 2; (* Interrupt (ANSI). *)\r
+ SIGQUIT* = 3; (* Quit (POSIX). *)\r
+ SIGILL* = 4; (* Illegal instruction (ANSI). *)\r
+ SIGTRAP* = 5; (* Trace trap (POSIX). *)\r
+ SIGABRT* = 6; (* Abort (ANSI). *)\r
+ SIGIOT* = 6; (* IOT trap (4.2 BSD). *)\r
+ SIGBUS* = 7; (* BUS error (4.2 BSD). *)\r
+ SIGFPE* = 8; (* Floating-point exception (ANSI). *)\r
+ SIGKILL* = 9; (* Kill, unblockable (POSIX). *)\r
+ SIGUSR1* = 10; (* User-defined signal 1 (POSIX). *)\r
+ SIGSEGV* = 11; (* Segmentation violation (ANSI). *)\r
+ SIGUSR2* = 12; (* User-defined signal 2 (POSIX). *)\r
+ SIGPIPE* = 13; (* Broken pipe (POSIX). *)\r
+ SIGALRM* = 14; (* Alarm clock (POSIX). *)\r
+ SIGTERM* = 15; (* Termination (ANSI). *)\r
+ SIGSTKFLT* = 16; (* Stack fault. *)\r
+ SIGCHLD* = 17; (* Child status has changed (POSIX). *)\r
+ SIGCLD* = SIGCHLD; (* Same as SIGCHLD (System V). *)\r
+ SIGCONT* = 18; (* Continue (POSIX). *)\r
+ SIGSTOP* = 19; (* Stop, unblockable (POSIX). *)\r
+ SIGTSTP* = 20; (* Keyboard stop (POSIX). *)\r
+ SIGTTIN* = 21; (* Background read from tty (POSIX). *)\r
+ SIGTTOU* = 22; (* Background write to tty (POSIX). *)\r
+ SIGURG* = 23; (* Urgent condition on socket (4.2 BSD). *)\r
+ SIGXCPU* = 24; (* CPU limit exceeded (4.2 BSD). *)\r
+ SIGXFSZ* = 25; (* File size limit exceeded (4.2 BSD). *)\r
+ SIGVTALRM* =26; (* Virtual alarm clock (4.2 BSD). *)\r
+ SIGPROF* = 27; (* Profiling alarm clock (4.2 BSD). *)\r
+ SIGWINCH* = 28; (* Window size change (4.3 BSD, Sun). *)\r
+ SIGIO* = 29; (* I/O now possible (4.2 BSD). *)\r
+ SIGPOLL* = SIGIO; (* Pollable event occurred (System V). *)\r
+ SIGPWR* = 30; (* Power failure restart (System V). *)\r
+ SIGSYS* = 31; (* Bad system call. *)\r
+ SIGUNUSED* =31;\r
+ _NSIG* = 64; (* Biggest signal number + 1 (including real-time signals). *)\r
+ __SIGRTMIN*= 32;\r
+ __SIGRTMAX*=_NSIG - 1;\r
+\r
+ (* Bits in `sa_flags'. *)\r
+ SA_NOCLDSTOP* = {0}; (* = 1 Don't send SIGCHLD when children stop. *)\r
+ SA_NOCLDWAIT* = {1}; (* = 2 Don't create zombie on child death. *)\r
+ SA_SIGINFO* = {2}; (* = 4 Invoke signal-catching function wth three arguments instead of one. *)\r
+ SA_ONSTACK* = {27}; (* = 0x08000000 Use signal stack by using `sa_restorer'. *)\r
+ SA_RESTART* = {28}; (* = 0x10000000 Restart syscall on signal return. *)\r
+ SA_NODEFER* = {30}; (* = 0x40000000 Don't automatically block the signal when its handler is being executed. *)\r
+ SA_RESETHAND* = {31}; (* = 0x80000000 Reset to SIG_DFL on entry to handler. *)\r
+ SA_INTERRUPT* = {29}; (* = 0x20000000 Historical no-op. *)\r
+ (* Some aliases for the SA_ constants. *)\r
+ SA_NOMASK* = SA_NODEFER;\r
+ SA_ONESHOT* = SA_RESETHAND;\r
+ SA_STACK* = SA_ONSTACK;\r
+\r
+ (* code values for siginfo_t.si_code when sig = SIGFPE *)\r
+ FPE_INTDIV* = 1; (* Integer divide by zero. *)\r
+ FPE_INTOVF* = 2; (* Integer overflow. *)\r
+ FPE_FLTDIV* = 3; (* Floating point divide by zero. *)\r
+ FPE_FLTOVF* = 4; (* Floating point overflow. *)\r
+ FPE_FLTUND* = 5; (* Floating point underflow. *)\r
+ FPE_FLTRES* =6; (* Floating point inexact result. *)\r
+ FPE_FLTINV* = 7; (* Floating point invalid operation. *)\r
+ FPE_FLTSUB* = 8; (* Subscript out of range. *)\r
+\r
+ (* possible error constants for errno *)\r
+ EPERM* = 1; (* Operation not permitted *)\r
+ ENOENT* = 2; (* No such file or directory *)\r
+ ESRCH* = 3; (* No such process *)\r
+ EINTR* = 4; (* Interrupted system call *)\r
+ EIO* = 5; (* I/O error *)\r
+ ENXIO* = 6; (* No such device or address *)\r
+ E2BIG* = 7; (* Arg list too long *)\r
+ ENOEXEC* = 8; (* Exec format error *)\r
+ EBADF* = 9; (* Bad file number *)\r
+ ECHILD* = 10; (* No child processes *)\r
+ EAGAIN* = 11; (* Try again *)\r
+ ENOMEM* = 12; (* Out of memory *)\r
+ EACCES* = 13; (* Permission denied *)\r
+ EFAULT* = 14; (* Bad address *)\r
+ ENOTBLK* = 15; (* Block device required *)\r
+ EBUSY* = 16; (* Device or resource busy *)\r
+ EEXIST* = 17; (* File exists *)\r
+ EXDEV* = 18; (* Cross-device link *)\r
+ ENODEV* = 19; (* No such device *)\r
+ ENOTDIR* = 20; (* Not a directory *)\r
+ EISDIR* = 21; (* Is a directory *)\r
+ EINVAL* = 22; (* Invalid argument *)\r
+ ENFILE* = 23; (* File table overflow *)\r
+ EMFILE* = 24; (* Too many open files *)\r
+ ENOTTY* = 25; (* Not a typewriter *)\r
+ ETXTBSY* = 26; (* Text file busy *)\r
+ EFBIG* = 27; (* File too large *)\r
+ ENOSPC* = 28; (* No space left on device *)\r
+ ESPIPE* = 29; (* Illegal seek *)\r
+ EROFS* = 30; (* Read-only file system *)\r
+ EMLINK* = 31; (* Too many links *)\r
+ EPIPE* = 32; (* Broken pipe *)\r
+ EDOM* = 33; (* Math argument out of domain of func *)\r
+ ERANGE* = 34; (* Math result not representable *)\r
+ EDEADLK* = 35; (* Resource deadlock would occur *)\r
+ ENAMETOOLONG* = 36; (* File name too long *)\r
+ ENOLCK* = 37; (* No record locks available *)\r
+ ENOSYS* = 38; (* Function not implemented *)\r
+ ENOTEMPTY* = 39; (* Directory not empty *)\r
+ ELOOP* = 40; (* Too many symbolic links encountered *)\r
+ EWOULDBLOCK* = EAGAIN; (* Operation would block *)\r
+ ENOMSG* = 42; (* No message of desired type *)\r
+ EIDRM* = 43; (* Identifier removed *)\r
+ ECHRNG* = 44; (* Channel number out of range *)\r
+ EL2NSYNC* = 45; (* Level 2 not synchronized *)\r
+ EL3HLT* = 46; (* Level 3 halted *)\r
+ EL3RST* = 47; (* Level 3 reset *)\r
+ ELNRNG* = 48; (* Link number out of range *)\r
+ EUNATCH* = 49; (* Protocol driver not attached *)\r
+ ENOCSI* = 50; (* No CSI structure available *)\r
+ EL2HLT* = 51; (* Level 2 halted *)\r
+ EBADE* = 52; (* Invalid exchange *)\r
+ EBADR* = 53; (* Invalid request descriptor *)\r
+ EXFULL* = 54; (* Exchange full *)\r
+ ENOANO* = 55; (* No anode *)\r
+ EBADRQC* = 56; (* Invalid request code *)\r
+ EBADSLT* = 57; (* Invalid slot *)\r
+ EDEADLOCK* = EDEADLK;\r
+ EBFONT* = 59; (* Bad font file format *)\r
+ ENOSTR* = 60; (* Device not a stream *)\r
+ ENODATA* = 61; (* No data available *)\r
+ ETIME* = 62; (* Timer expired *)\r
+ ENOSR* = 63; (* Out of streams resources *)\r
+ ENONET* = 64; (* Machine is not on the network *)\r
+ ENOPKG* = 65; (* Package not installed *)\r
+ EREMOTE* = 66; (* Object is remote *)\r
+ ENOLINK* = 67; (* Link has been severed *)\r
+ EADV* = 68; (* Advertise error *)\r
+ ESRMNT* = 69; (* Srmount error *)\r
+ ECOMM* = 70; (* Communication error on send *)\r
+ EPROTO* = 71; (* Protocol error *)\r
+ EMULTIHOP* = 72; (* Multihop attempted *)\r
+ EDOTDOT* = 73; (* RFS specific error *)\r
+ EBADMSG* = 74; (* Not a data message *)\r
+ EOVERFLOW* = 75; (* Value too large for defined data type *)\r
+ ENOTUNIQ* = 76; (* Name not unique on network *)\r
+ EBADFD* = 77; (* File descriptor in bad state *)\r
+ EREMCHG* = 78; (* Remote address changed *)\r
+ ELIBACC* = 79; (* Can not access a needed shared library *)\r
+ ELIBBAD* = 80; (* Accessing a corrupted shared library *)\r
+ ELIBSCN* = 81; (* .lib section in a.out corrupted *)\r
+ ELIBMAX* = 82; (* Attempting to link in too many shared libraries *)\r
+ ELIBEXEC* = 83; (* Cannot exec a shared library directly *)\r
+ EILSEQ* = 84; (* Illegal byte sequence *)\r
+ ERESTART* = 85; (* Interrupted system call should be restarted *)\r
+ ESTRPIPE* = 86; (* Streams pipe error *)\r
+ EUSERS* = 87; (* Too many users *)\r
+ ENOTSOCK* = 88; (* Socket operation on non-socket *)\r
+ EDESTADDRREQ* = 89; (* Destination address required *)\r
+ EMSGSIZE* = 90; (* Message too long *)\r
+ EPROTOTYPE* = 91; (* Protocol wrong type for socket *)\r
+ ENOPROTOOPT* = 92; (* Protocol not available *)\r
+ EPROTONOSUPPORT* = 93; (* Protocol not supported *)\r
+ ESOCKTNOSUPPORT* = 94; (* Socket type not supported *)\r
+ EOPNOTSUPP* = 95; (* Operation not supported on transport endpoint *)\r
+ EPFNOSUPPORT* = 96; (* Protocol family not supported *)\r
+ EAFNOSUPPORT* = 97; (* Address family not supported by protocol *)\r
+ EADDRINUSE* = 98; (* Address already in use *)\r
+ EADDRNOTAVAIL* = 99; (* Cannot assign requested address *)\r
+ ENETDOWN* = 100; (* Network is down *)\r
+ ENETUNREACH* = 101; (* Network is unreachable *)\r
+ ENETRESET* = 102; (* Network dropped connection because of reset *)\r
+ ECONNABORTED* = 103; (* Software caused connection abort *)\r
+ ECONNRESET* = 104; (* Connection reset by peer *)\r
+ ENOBUFS* = 105; (* No buffer space available *)\r
+ EISCONN* = 106; (* Transport endpoint is already connected *)\r
+ ENOTCONN* = 107; (* Transport endpoint is not connected *)\r
+ ESHUTDOWN* = 108; (* Cannot send after transport endpoint shutdown *)\r
+ ETOOMANYREFS* = 109; (* Too many references: cannot splice *)\r
+ ETIMEDOUT* = 110; (* Connection timed out *)\r
+ ECONNREFUSED* = 111; (* Connection refused *)\r
+ EHOSTDOWN* = 112; (* Host is down *)\r
+ EHOSTUNREACH* = 113; (* No route to host *)\r
+ EALREADY* = 114; (* Operation already in progress *)\r
+ EINPROGRESS* = 115; (* Operation now in progress *)\r
+ ESTALE* = 116; (* Stale NFS file handle *)\r
+ EUCLEAN* = 117; (* Structure needs cleaning *)\r
+ ENOTNAM* = 118; (* Not a XENIX named type file *)\r
+ ENAVAIL* = 119; (* No XENIX semaphores available *)\r
+ EISNAM* = 120; (* Is a named type file *)\r
+ EREMOTEIO* = 121; (* Remote I/O error *)\r
+ EDQUOT* = 122; (* Quota exceeded *)\r
+ ENOMEDIUM* = 123; (* No medium found *)\r
+ EMEDIUMTYPE* = 124; (* Wrong medium type *)\r
+\r
+ PROT_NONE* = {}; (* No access *)\r
+ PROT_READ* = {2}; (* Pages can be read *)\r
+ PROT_WRITE* = {1}; (* Pages can be written *)\r
+ PROT_EXEC* = {0}; (* Pages can be executed *)\r
+ MAP_FILE* = {0}; (* Mapped from a file or device *)\r
+ MAP_ANON* = {1}; (* Allocated from anonymous virtual memory *)\r
+ MAP_COPY* = {5}; (* Virtual copy of region at mapping time *)\r
+ MAP_SHARED* = {4}; (* Share changes *)\r
+ MAP_PRIVATE* = {}; (* Changes private; copy pages on write *)\r
+ MAP_FIXED* = {8}; (* Map address must be exactly as requested *)\r
+ MAP_NOEXTEND* = {9} ; (* For MAP_FILE, don't change file size *)\r
+ MAP_HASSEMPHORE*= {10}; (* Region may contain semaphores *)\r
+ MAP_INHERIT* = {11} ; (* Region is retained after exec *)\r
+ MAP_FAILED* = -1;\r
+\r
+ O_RDONLY* = {} ; (* Open read-only *)\r
+ O_WRONLY* = {0} ; (* Open write-only *)\r
+ O_RDWR* = {1} ; (* Open read/write *)\r
+ O_NONBLOCK* = {11};\r
+\r
+ SIG_BLOCK* = 0; (* Block signals *)\r
+ SIG_UNBLOCK* = 1; (* Unblock signals *)\r
+ SIG_SETMASK* = 2; (* Set the set of blocked signals *)\r
+\r
+ _SC_PAGESIZE* = 30;\r
+\r
+ SIGSTKSZ* = 8192;\r
+\r
+ STDIN_FILENO* = 0;\r
+ STDOUT_FILENO* = 1;\r
+ STDERR_FILENO* = 2;\r
+\r
+ WAIT_ANY* = -1;\r
+ WCONTINUED* = {3};\r
+ WNOHANG* = {0};\r
+ WUNTRACED* = {1};\r
+\r
+ TYPE \r
+ __ftw_func_t* = PROCEDURE (fileName: PtrSTR; VAR [nil] stat: stat_t; flag: INTEGER): INTEGER;\r
+ PtrVoid* = INTEGER;\r
+ PtrSTR* = POINTER TO ARRAY [untagged] OF SHORTCHAR;\r
+ wchar_t* = INTEGER;\r
+ PtrWSTR* = POINTER TO ARRAY [untagged] OF wchar_t;\r
+ PtrInt* = INTEGER;\r
+ StrArray* = POINTER TO ARRAY [untagged] OF PtrSTR;\r
+ PtrFILE* = INTEGER;\r
+ PtrDIR* = INTEGER;\r
+ PtrProc* = INTEGER;\r
+ clock_t* = INTEGER;\r
+ jmp_buf* = ARRAY [untagged] 6 OF INTEGER; (* bx, si, di, bp, sp, pc *)\r
+ mode_t* = SET;\r
+ off_t* = INTEGER;\r
+ SelectorFunc* = PROCEDURE (dirent: Dirent): INTEGER;\r
+ CmpFunc* = PROCEDURE (VAR [nil] dirent1, dirent2: PtrDirent): INTEGER;\r
+ size_t* = INTEGER; (* should be unsigned int *)\r
+ ssize_t* = INTEGER;\r
+ sigjmp_buf* = RECORD [untagged] \r
+ buf*: jmp_buf;\r
+ mask_was_saved*: INTEGER;\r
+ saved_mask*: sigset_t;\r
+ END; \r
+ \r
+ PtrDirent* = POINTER TO Dirent;\r
+ PtrDirentArray* = POINTER TO ARRAY [untagged] OF Dirent;\r
+ Dirent* = RECORD [untagged]\r
+ d_ino*: INTEGER; (* inode number *)\r
+ d_off*: off_t; (* offset to this dirent *)\r
+ d_reclen*: SHORTINT; (* length of this d_name *)\r
+ d_type*: BYTE;\r
+ d_name*: ARRAY[untagged] NAME_MAX+1 OF SHORTCHAR; (* file name (null-terminated) *)\r
+ END;\r
+ \r
+ pid_t* = INTEGER;\r
+ uid_t* = INTEGER;\r
+ sigval_t* = INTEGER;\r
+\r
+ siginfo_t* = RECORD [untagged]\r
+ si_signo*: INTEGER; (* Signal number *)\r
+ si_errno*: INTEGER; (* An errno value *)\r
+ si_code*: INTEGER; (* Signal code *)\r
+ si_pid*: pid_t; (* Sending process ID *)\r
+ si_uid*: uid_t; (* Real user ID of sending process *)\r
+ si_status*: INTEGER; (* Exit value or signal *)\r
+ si_utime*: clock_t; (* User time consumed *)\r
+ si_stime*: clock_t; (* System time consumed *)\r
+ si_value*: sigval_t; (* Signal value *)\r
+ si_int*: INTEGER; (* POSIX.1b signal *)\r
+ si_ptr*: PtrVoid; (* POSIX.1b signal *)\r
+ si_addr*: PtrVoid; (* Memory location which caused fault *)\r
+ si_band*: INTEGER; (* Band event *)\r
+ si_fd*: INTEGER; (* File descriptor *)\r
+ END;\r
+ Ptrsiginfo_t* = POINTER TO siginfo_t;\r
+ \r
+ sigset_t* = ARRAY [untagged] 128 OF BYTE;\r
+ Ptrsigset_t* = INTEGER;\r
+ sigaction_t* = RECORD [untagged]\r
+ sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; ptr: Ptrucontext_t); (* union with sa_handler*: PtrProc;*)\r
+ sa_mask*: sigset_t;\r
+ sa_flags*: SET;\r
+ sa_restorer*: LONGINT;\r
+ END;\r
+ \r
+ stack_t* = RECORD [untagged]\r
+ ss_sp*: PtrVoid; \r
+ ss_flags*: INTEGER; \r
+ ss_size*: size_t;\r
+ END;\r
+ \r
+ stat_t* = RECORD [untagged]\r
+ st_dev*: LONGINT; (* device *)\r
+ __pad1: SHORTINT;\r
+ st_ino*: INTEGER; (* 64? inode *)\r
+ st_mode*: mode_t; (* protection *)\r
+ st_nlink*: INTEGER; (* number of hard links *)\r
+ st_uid*: uid_t; (* user ID of owner *)\r
+ st_gid*: INTEGER; (* group ID of owner *)\r
+ st_rdev*: LONGINT; (* device type (if inode device) *)\r
+ __pad2: SHORTINT;\r
+ st_size*: off_t; (* 64? total size, in bytes *)\r
+ st_blksize*: INTEGER; (* blocksize for filesystem I/O *)\r
+ st_blocks*: INTEGER; (* 64? number of blocks allocated *)\r
+ st_atime*: INTEGER; (* time of last access *)\r
+ __unused1: INTEGER;\r
+ st_mtime*: INTEGER; (* time of last modification *) \r
+ __unused2: INTEGER;\r
+ st_ctime*: INTEGER; (* time of last change *)\r
+ __unused3: INTEGER;\r
+ __unused4: INTEGER;\r
+ __unused5: INTEGER;\r
+ END;\r
+ \r
+ fpreg* = RECORD [untagged]\r
+ significand*: ARRAY [untagged] 4 OF CHAR;\r
+ exponent*: CHAR;\r
+ END;\r
+\r
+ fpstate* = RECORD [untagged]\r
+ cw*: INTEGER; (* unsigned long int *)\r
+ sw*: INTEGER; (* unsigned long int *)\r
+ tag*: INTEGER; (* unsigned long int *)\r
+ ipoff*: INTEGER; (* unsigned long int *)\r
+ cssel*: INTEGER; (* unsigned long int *)\r
+ dataoff*: INTEGER; (* unsigned long int *)\r
+ datasel*: INTEGER; (* unsigned long int *)\r
+ _st: ARRAY [untagged] 8 OF fpreg;\r
+ status*: INTEGER; (* unsigned long int *)\r
+ END;\r
+\r
+ gregset_t* = ARRAY [untagged] 19 OF INTEGER;\r
+ fpregset_t* = POINTER TO fpstate;\r
+ \r
+ mcontext_t* = RECORD [untagged]\r
+ gregs*: gregset_t;\r
+ fpregs*: fpregset_t;\r
+ oldmask*: INTEGER; (* unsigned long int *)\r
+ cr2*: INTEGER; (* unsigned long int *)\r
+ END;\r
+ \r
+ Ptrucontext_t* = POINTER TO ucontext_t;\r
+ ucontext_t* = RECORD [untagged]\r
+ uc_flags*: INTEGER; (* unsigned long int *)\r
+ uc_link*: Ptrucontext_t;\r
+ uc_stack*: stack_t;\r
+ uc_mcontext*: mcontext_t;\r
+ uc_sigmask: sigset_t;\r
+ __fpregs_mem*: fpstate;\r
+ END;\r
+ \r
+ (* Times and Dates *)\r
+ \r
+ tm* = POINTER TO tmDesc;\r
+ tmDesc* = RECORD [untagged]\r
+ tm_sec*: INTEGER; (* seconds *)\r
+ tm_min*: INTEGER; (* minutes *)\r
+ tm_hour*: INTEGER; (* hours *)\r
+ tm_mday*: INTEGER; (* day of the month *)\r
+ tm_mon*: INTEGER; (* month *)\r
+ tm_year*: INTEGER; (* year *)\r
+ tm_wday*: INTEGER; (* day of the week *)\r
+ tm_yday*: INTEGER; (* day in the year *)\r
+ tm_isdst*: INTEGER; (* daylight saving time *)\r
+ END;\r
+ time_t* = INTEGER;\r
+\r
+ VAR\r
+ timezone*: INTEGER; (* seconds from GMT *) \r
+(*\r
+ stdin*, stdout*, stderr* : PtrFILE;\r
+*)\r
+\r
+ PROCEDURE [ccall] calloc* (num, size: size_t): PtrVoid;\r
+ PROCEDURE [ccall] clock* (): clock_t;\r
+ PROCEDURE [ccall] closedir* (dir: PtrDIR): INTEGER;\r
+ PROCEDURE [ccall] chmod* (path: PtrSTR; mode: mode_t): INTEGER;\r
+ PROCEDURE [ccall] fchmod* (fd: INTEGER; mode: mode_t): INTEGER;\r
+ PROCEDURE [ccall] exit* (status: INTEGER);\r
+ PROCEDURE [ccall] fclose* (fp: PtrFILE): INTEGER;\r
+ PROCEDURE [ccall] fflush* (fp: PtrFILE): INTEGER;\r
+ PROCEDURE [ccall] fopen* (filename, mode: PtrSTR): PtrFILE;\r
+ PROCEDURE [ccall] fdopen* (fildes: INTEGER; mode: PtrSTR): PtrFILE;\r
+ PROCEDURE [ccall] feof* (fp: PtrFILE): INTEGER;\r
+ PROCEDURE [ccall] fileno* (stream: PtrFILE): INTEGER;\r
+ PROCEDURE [ccall] fread* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t;\r
+ PROCEDURE [ccall] fseek* (stream: PtrFILE; offset, origin: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] free* (p: PtrVoid);\r
+ PROCEDURE [ccall] ftell* (stream: PtrFILE): LONGINT;\r
+ PROCEDURE [ccall] ftw* (filename: PtrSTR; func: __ftw_func_t; descriptors: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] fwrite* (ptr: PtrVoid; size, nobj: size_t; stream: PtrFILE): size_t;\r
+ PROCEDURE [ccall] getcwd* (buf: PtrSTR; size: size_t): PtrSTR;\r
+ PROCEDURE [ccall] getcontext* (ucontext_t: Ptrucontext_t): INTEGER;\r
+ PROCEDURE [ccall] gets* (s: PtrSTR);\r
+ PROCEDURE [ccall] fgets* (s: PtrSTR; n: INTEGER; fp: PtrFILE): PtrSTR;\r
+ PROCEDURE [ccall] gmtime* (VAR timep: time_t): tm;\r
+ PROCEDURE [ccall] kill* (pid: pid_t; sig: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] localtime* (VAR timep: time_t): tm;\r
+ PROCEDURE [ccall] malloc* (size: size_t): PtrVoid;\r
+ PROCEDURE [ccall] mkdir* (pathname: PtrSTR; mode: mode_t): INTEGER;\r
+ PROCEDURE [ccall] mktime* (timeptr: tm): time_t;\r
+ PROCEDURE [ccall] opendir* (name: PtrSTR): PtrDIR;\r
+ PROCEDURE [ccall] printf* (s: PtrSTR): INTEGER; \r
+ PROCEDURE [ccall] readdir* (dir: PtrDIR): PtrDirent;\r
+ PROCEDURE [ccall] remove* (filename: PtrSTR): INTEGER;\r
+ PROCEDURE [ccall] rename* (oldname, newname: PtrSTR): INTEGER;\r
+ PROCEDURE [ccall] scandir* (dir: PtrDIR; namelist: PtrDirentArray; selector: SelectorFunc; cmp: CmpFunc): INTEGER;\r
+ PROCEDURE [ccall] setcontext* (ucontext_t: Ptrucontext_t): INTEGER;\r
+ PROCEDURE [ccall] setjmp* (VAR env: jmp_buf): INTEGER;\r
+ PROCEDURE [ccall] sigaction* (sig_num: INTEGER; VAR [nil] act: sigaction_t; VAR [nil] oldact: sigaction_t): INTEGER;\r
+ PROCEDURE [ccall] sigaddset* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] sigdelset* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] sigemptyset* (set: Ptrsigset_t): INTEGER;\r
+ PROCEDURE [ccall] sigfillset* (set: Ptrsigset_t): INTEGER;\r
+ PROCEDURE [ccall] sigismemeber* (set: Ptrsigset_t; sig: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: INTEGER);\r
+ PROCEDURE [ccall] signal* (sig_num: INTEGER; sighandler: PtrProc): PtrProc;\r
+ PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: INTEGER): INTEGER; \r
+(*\r
+ PROCEDURE [ccall] stat* (filename: PtrSTR; VAR buf: stat_t): INTEGER; stat is a macro and expands to __xstat(3, filename, buf)\r
+*)\r
+ PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;\r
+ PROCEDURE [ccall] strftime* (s: PtrSTR; max: size_t; format: PtrSTR; ptm: tm): size_t;\r
+ PROCEDURE [ccall] time* (VAR [nil] t: time_t): time_t;\r
+\r
+ PROCEDURE [ccall] __errno_location*(): INTEGER;\r
+\r
+ PROCEDURE [ccall] open* (name: PtrSTR; flags: SET; mode: mode_t): INTEGER;\r
+ PROCEDURE [ccall] close* (d: INTEGER): INTEGER;\r
+ PROCEDURE [ccall] read* (d: INTEGER; buf: PtrVoid; nbytes: size_t): ssize_t;\r
+ PROCEDURE [ccall] write* (d: INTEGER; buf: PtrVoid; nBytes: size_t): ssize_t;\r
+\r
+ PROCEDURE [ccall] mmap* (addr: PtrVoid; len: size_t; prot: SET; flags: SET; fd, offset: off_t): PtrVoid;\r
+ PROCEDURE [ccall] munmap* (addr: PtrVoid; len: size_t): INTEGER;\r
+ PROCEDURE [ccall] mprotect* (addr: PtrVoid; len: size_t; prot: SET): INTEGER;\r
+\r
+ PROCEDURE [ccall] getenv* (name: PtrSTR): PtrSTR;\r
+ \r
+ PROCEDURE [ccall] sigaltstack* (VAR [nil] ss: stack_t; VAR [nil] oss: stack_t): INTEGER;\r
+\r
+ PROCEDURE [ccall] sigprocmask* (how: INTEGER; set: Ptrsigset_t; oldset: Ptrsigset_t): INTEGER;\r
+\r
+ PROCEDURE [ccall] fork* (): pid_t;\r
+ PROCEDURE [ccall] waitpid* (wpid: pid_t; VAR [nil] status: INTEGER; options: SET): pid_t;\r
+\r
+ PROCEDURE [ccall] execv* (path: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER;\r
+ PROCEDURE [ccall] execvp* (file: PtrSTR; argv: POINTER [untagged] TO ARRAY [untagged] OF PtrSTR): INTEGER;\r
+\r
+ PROCEDURE [ccall] system* (string: PtrSTR): INTEGER;\r
+\r
+ PROCEDURE [ccall] sysconf* (name: INTEGER): INTEGER;\r
+\r
+ PROCEDURE [ccall] popen* (command, type: PtrSTR): PtrFILE;\r
+ PROCEDURE [ccall] pclose* (stream: PtrFILE): INTEGER;\r
+\r
+END LinLibc.\r
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/Makefile b/BlackBox/_Linux_/Lin/Mod/gen-Libc/Makefile
--- /dev/null
@@ -0,0 +1,86 @@
+# This is BSD Makefile
+# BSD GNU
+# ${.TARGET} $@
+# ${.ALLSRC} $^
+# ${.IMPSRC} $<
+
+INCDIR ?= /usr/include
+INCDIR_I386 ?= ${INCDIR}/i386-linux-gnu
+
+PY = python2.7
+
+DEFS = clockspersec sigstksz 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
+
+Libc.txt: Libc.txt.templ ${DEFS} libver osname machine custom fields-dirent fields-sigaction fields-siginfo fields-stack fields-stat fields-tm fields-ucontext fields-timespec
+ ${PY} ./untempl.py Libc.txt.templ $@
+
+clockspersec:
+ grep "define CLOCKS_PER_SEC" ${INCDIR_I386}/bits/time.h | awk '{print $$4}' | cut -d ')' -f 1 | tr -d '\n' > $@
+
+sigstksz:
+ grep "define SIGSTKSZ" ${INCDIR}/asm-generic/signal.h | awk '{print $$3}' | tr -d '\n' > $@
+
+defs-map:
+ ./dumpdefs.py 2 1 s ${INCDIR}/asm-generic/mman-common.h | grep "MAP_" > $@
+ echo " MAP_ANON* = MAP_ANONYMOUS;" >> $@
+
+defs-prot:
+ ./dumpdefs.py 2 1 s ${INCDIR}/asm-generic/mman-common.h | grep "PROT_" > $@
+
+defs-sigmask:
+ ./dumpdefs.py 2 2 i ${INCDIR}//asm-generic/signal-defs.h | grep "SIG_" | grep -v __sighandler_t > $@
+
+defs-signo:
+ ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/signal.h | grep " SIG" > $@
+
+nsig:
+ grep "#define _NSIG" ${INCDIR}/asm-generic/signal.h | head -1 | awk '{print $$3}' | tr -d '\n' > $@
+
+defs-fpe:
+ ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/siginfo.h | grep " FPE_" | sed s'/__SI_FAULT|//' > $@
+
+defs-sa:
+ ./dumpdefs.py 2 1 s ${INCDIR}/asm-generic/signal.h | grep " SA_" > $@
+
+defs-errno:
+ ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/errno-base.h > $@
+ ./dumpdefs.py 2 1 i ${INCDIR}/asm-generic/errno.h >> $@
+
+namemax:
+ grep " NAME_MAX " ${INCDIR}/linux/limits.h | awk '{print $$3}' | tr -d '\n' > $@
+
+defs-fcntlo:
+ ./dumpdefs.py 2 1 s ${INCDIR}/asm-generic/fcntl.h | grep " O_" > $@
+ ./dumpdefs.py 2 2 s ${INCDIR}/asm-generic/fcntl.h | grep " O_" >> $@
+
+defs-basictypes: sizeofs
+ ./sizeofs > $@
+
+defs-sc: scs
+ ./scs > $@
+
+defs-clockid:
+ ./dumpdefs.py 2 1 i ${INCDIR}/linux/time.h | grep CLOCK_ > $@
+
+defs-wait:
+ grep "define WAIT_ANY" ${INCDIR_I386}/sys/wait.h | sed s'/(//' | sed s'/)//' | awk '{print " " $$3 "* = " $$4 ";"}' > $@
+ ./dumpdefs.py 2 1 s ${INCDIR}/linux/wait.h | grep " WCONTINUED" >> $@
+ ./dumpdefs.py 2 1 s ${INCDIR}/linux/wait.h | grep " WNOHANG" >> $@
+ ./dumpdefs.py 2 1 s ${INCDIR}/linux/wait.h | grep " WUNTRACED" >> $@
+
+dumpstrerrno.c: defs-errno
+ grep -v ERESTART $^ | grep -v EJUSTRETURN | ./mkdumpstrerrno.py > $@
+
+strerrnocase.txt: dumpstrerrno
+ ./dumpstrerrno | ./mkstrerrnocase.py > $@
+
+scs: scs.c
+ ${CC} -m32 scs.c -o $@
+
+sizeofs: sizeofs.c
+ ${CC} -m32 sizeofs.c -o $@
+
+clean:
+ rm -f ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt sizeofs scs
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/custom b/BlackBox/_Linux_/Lin/Mod/gen-Libc/custom
--- /dev/null
@@ -0,0 +1,38 @@
+ TYPE
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/sigval_t.h: *)
+ sigval_t* = RECORD [union]
+ sival_int*: int;
+ sival_ptr*: PtrVoid
+ END;
+
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/sys/ucontext.h: *)
+ greg_t* = int;
+ gregset_t* = ARRAY [untagged] 19 OF greg_t;
+ fpregset_t* = POINTER [untagged] TO fpstate;
+ fpreg* = RECORD [untagged]
+ significand*: ARRAY [untagged] 4 OF SHORTINT; (* unsigned short int *)
+ exponent*: SHORTINT; (* unsigned short int *)
+ END;
+ fpstate* = RECORD [untagged]
+ cw*: INTEGER; (* unsigned long int *)
+ sw*: INTEGER; (* unsigned long int *)
+ tag*: INTEGER; (* unsigned long int *)
+ ipoff*: INTEGER; (* unsigned long int *)
+ cssel*: INTEGER; (* unsigned long int *)
+ dataoff*: INTEGER; (* unsigned long int *)
+ datasel*: INTEGER; (* unsigned long int *)
+ _st: ARRAY [untagged] 8 OF fpreg;
+ status*: INTEGER; (* unsigned long int *)
+ END;
+
+ VAR
+ timezone*: INTEGER; (* seconds from GMT *)
+(*
+ stdin*, stdout*, stderr* : PtrFILE;
+*)
+
+ PROCEDURE [ccall] __errno_location*(): INTEGER;
+
+ PROCEDURE [ccall] __xstat* (version: INTEGER; filename: PtrSTR; VAR buf: stat_t): INTEGER;
+
+ PROCEDURE [ccall] sigsetjmp* ["__sigsetjmp"] (VAR env: sigjmp_buf; savemask: int): int;
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-dirent b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-dirent
--- /dev/null
@@ -0,0 +1,6 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/dirent.h: *)
+ d_ino*: ino_t; (* inode number *)
+ d_off*: off_t; (* offset to this dirent *)
+ d_reclen*: SHORTINT; (* length of this d_name *)
+ d_type*: BYTE;
+ d_name*: ARRAY [untagged] 256 OF SHORTCHAR;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-sigaction b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-sigaction
--- /dev/null
@@ -0,0 +1,5 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/asm/signal.h, /usr/include/i386-linux-gnu/bits/sigaction.h *)
+ sa_sigaction*: PROCEDURE [ccall] (sig: INTEGER; siginfo: Ptrsiginfo_t; ptr: Ptrucontext_t); (* union with sa_handler*: PtrProc;*)
+ sa_mask*: sigset_t;
+ sa_flags*: intFlags;
+ sa_restorer*: PROCEDURE [ccall];
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-siginfo b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-siginfo
--- /dev/null
@@ -0,0 +1,49 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/siginfo_t.h: *)
+ si_signo*: int; (* Signal number *)
+ si_errno*: int; (* An errno value *)
+ si_code*: int; (* Signal code *)
+
+ _sifields*: RECORD [union]
+ _pad: ARRAY [untagged] 29 OF int;
+ _kill*: RECORD [untagged]
+ si_pid*: pid_t;
+ si_uid*: uid_t
+ END;
+ _timer*: RECORD [untagged]
+ si_tid*: int;
+ si_overrun*: int;
+ si_sigval*: sigval_t
+ END;
+ _rt*: RECORD [untagged]
+ si_pid*: pid_t;
+ si_uid*: uid_t;
+ si_sigval*: sigval_t
+ END;
+ _sigchild*: RECORD [untagged]
+ si_pid: pid_t;
+ si_uid*: uid_t;
+ si_status*: int;
+ si_utime*: clock_t;
+ si_stime*: clock_t
+ END;
+ _sigfault*: RECORD [untagged]
+ si_addr*: PtrVoid;
+ si_addr_lsb*: SHORTINT;
+ _bounds*: RECORD [union]
+ _addr_bnd*: RECORD [untagged]
+ _lower*: PtrVoid;
+ _upper*: PtrVoid
+ END;
+ _pkey: INTEGER
+ END
+ END;
+ _sigpoll: RECORD [untagged]
+ si_band*: int; (* long int *);
+ si_fd*: int
+ END;
+ _sigsys*: RECORD [untagged]
+ _call_addr*: PtrVoid;
+ _syscall*: int;
+ _arch*: int (* unsigned int *)
+ END
+ END;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-stack b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-stack
--- /dev/null
@@ -0,0 +1,4 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/stack_t.h: *)
+ ss_sp*: PtrVoid;
+ ss_flags*: intFlags;
+ ss_size*: size_t;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-stat b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-stat
--- /dev/null
@@ -0,0 +1,18 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/stat.h: *)
+ st_dev*: dev_t;
+ __pad1: SHORTINT;
+ st_ino*: ino_t;
+ st_mode*: mode_t;
+ st_nlink*: nlink_t;
+ st_uid*: uid_t;
+ st_gid*: gid_t;
+ st_rdev*: dev_t;
+ __pad2: SHORTINT;
+ st_size*: off_t;
+ st_blksize*: blksize_t;
+ st_blocks*: blkcnt_t;
+ st_atim*: timespec_t;
+ st_mtim*: timespec_t;
+ st_ctim*: timespec_t;
+ __glibc_reserved4: INTEGER; (* long int *)
+ __glibc_reserved5: INTEGER; (* long int *)
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-timespec b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-timespec
--- /dev/null
@@ -0,0 +1,3 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_timespec.h: *)
+ tv_sec*: time_t;
+ tv_nsec*: INTEGER;
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-tm b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-tm
--- /dev/null
@@ -0,0 +1,13 @@
+ (* Ubuntu 17.10 /usr/include/i386-linux-gnu/bits/types/struct_tm.h: *)
+ tm_sec*: int; (* Seconds. [0-60] (1 leap second) *)
+ tm_min*: int; (* Minutes. [0-59] *)
+ tm_hour*: int; (* Hours. [0-23] *)
+ tm_mday*: int; (* Day. [1-31] *)
+ tm_mon*: int; (* Month. [0-11] *)
+ tm_year*: int; (* Year - 1900. *)
+ tm_wday*: int; (* Day of week. [0-6] *)
+ tm_yday*: int; (* Days in year.[0-365] *)
+ tm_isdst*: int; (* DST. [-1/0/1] *)
+
+ tm_gmtoff*: int; (* long int *) (* Seconds east of UTC *)
+ tm_zone*: PtrSTR; (* Timezone abbreviation *)
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-ucontext b/BlackBox/_Linux_/Lin/Mod/gen-Libc/fields-ucontext
--- /dev/null
@@ -0,0 +1,11 @@
+ uc_flags*: INTEGER; (* unsigned long int *)
+ uc_link*: Ptrucontext_t;
+ uc_stack*: stack_t;
+ uc_mcontext*: RECORD [untagged] (* mcontext_t *)
+ gregs*: gregset_t;
+ fpregs*: fpregset_t;
+ oldmask*: INTEGER; (* unsigned long int *)
+ cr2*: INTEGER; (* unsigned long int *)
+ END;
+ uc_sigmask: sigset_t;
+ __fpregs_mem*: fpstate;
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/libver b/BlackBox/_Linux_/Lin/Mod/gen-Libc/libver
--- /dev/null
@@ -0,0 +1 @@
+.6
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/machine b/BlackBox/_Linux_/Lin/Mod/gen-Libc/machine
--- /dev/null
@@ -0,0 +1 @@
+i386
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/osname b/BlackBox/_Linux_/Lin/Mod/gen-Libc/osname
--- /dev/null
@@ -0,0 +1 @@
+GNU/Linux (Ubuntu 17.10)
\ No newline at end of file
diff --git a/BlackBox/_Linux_/Lin/Mod/gen-Libc/scs.c b/BlackBox/_Linux_/Lin/Mod/gen-Libc/scs.c
--- /dev/null
@@ -0,0 +1,10 @@
+#include <unistd.h>
+
+#include <stdio.h>
+
+int main (int argc, const char *argv[])
+{
+ printf(" _SC_PAGESIZE* = %d;\n", _SC_PAGESIZE);
+
+ return 0;
+}
index f74ff0ed523e3ee39a0c6fc0415a87d1517f689c..b51afce38037d77301941e3ef0fe5f9bffe539d4 100644 (file)
Binary files a/BlackBox/_Linux_/System/Mod/Kernel.odc and b/BlackBox/_Linux_/System/Mod/Kernel.odc differ
Binary files a/BlackBox/_Linux_/System/Mod/Kernel.odc and b/BlackBox/_Linux_/System/Mod/Kernel.odc differ
diff --git a/BlackBox/_Linux_/dev0 b/BlackBox/_Linux_/dev0
index bff8f9a273e15494c97ab7e23ed2e37a044023e1..d8f8aeeca2ff72be66da7a7e9723108203eda99c 100755 (executable)
Binary files a/BlackBox/_Linux_/dev0 and b/BlackBox/_Linux_/dev0 differ
Binary files a/BlackBox/_Linux_/dev0 and b/BlackBox/_Linux_/dev0 differ
index d563b77bee3db5b409deae5ff4db304e5021ef5d..78f54320f508718ff1e49ac6db6d171748657578 100644 (file)
int64_t* = LONGINT;
u_int64_t* = LONGINT;
wchar_t* = INTEGER;
- sigset_t* = SET;
sigjmp_buf* = ARRAY [untagged] 11 OF INTEGER;
intFlags* = SET;
FILE = ARRAY [untagged] 22 OF INTEGER;
+ sigset_t* = ARRAY [untagged] 4 OF BYTE;
+ PtrSigset_t* = POINTER [untagged] TO sigset_t;
tm* = POINTER TO tmDesc;
(* POSIX.1 *)
PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
+ (* POSIX.1 *)
+ PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
+
(* ANSI C 89 *)
PROCEDURE [ccall] clock* (): clock_t;
PROCEDURE [ccall] localtime* (VAR [nil] t: time_t): tm;
(* POSIX.1 *)
+(*
PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
+*)
PROCEDURE [ccall] siglongjmp* (VAR env: sigjmp_buf; val: int);
(* POSIX.1 *)
- PROCEDURE [ccall] sigemptyset* (VAR set: sigset_t): int;
- PROCEDURE [ccall] sigfillset* (VAR set: sigset_t): int;
- PROCEDURE [ccall] sigaddset* (VAR set: sigset_t; signo: int): int;
- PROCEDURE [ccall] sigprocmask* (how: int; VAR [nil] set: sigset_t; VAR [nil] oset: sigset_t): int;
+ PROCEDURE [ccall] sigemptyset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigfillset* (set: PtrSigset_t): int;
+ PROCEDURE [ccall] sigaddset* (set: PtrSigset_t; signo: int): int;
+ PROCEDURE [ccall] sigprocmask* (how: int; set: PtrSigset_t; oset: PtrSigset_t): int;
(* POSIX.1 *)
PROCEDURE [ccall] sigaction* (sig: int; VAR [nil] act: sigaction_t; VAR [nil] oact: sigaction_t): int;
diff --git a/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom b/BlackBox/_OpenBSD_/Lin/Mod/gen-Libc/custom
index 586533b56194494be5de1c973c0d8c736506df21..519abd5261d2815b44cea3b57b822985a679186f 100644 (file)
(* POSIX.1 *)
PROCEDURE [ccall] stat* (path: PtrSTR; VAR sp: stat_t): int;
+
+ (* POSIX.1 *)
+ PROCEDURE [ccall] sigsetjmp* (VAR env: sigjmp_buf; savemask: int): int;
index e24dba950d2d061d844be87e3251ea316c5dddb7..79225f881cb86af43f43a1b651be84bf552542c5 100644 (file)
Binary files a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc and b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc differ
Binary files a/BlackBox/_OpenBSD_/System/Mod/Kernel.odc and b/BlackBox/_OpenBSD_/System/Mod/Kernel.odc differ
index 29c77b0a68243d378ae7c0be61924cdeed0d160d..58d677879c1a9952773fcf71e83f9664f756d54e 100755 (executable)
Binary files a/BlackBox/_OpenBSD_/blackbox and b/BlackBox/_OpenBSD_/blackbox differ
Binary files a/BlackBox/_OpenBSD_/blackbox and b/BlackBox/_OpenBSD_/blackbox differ
index f85efa012ec051c2879780971c2bcd52c79f6d98..cae64f6f8b51c45f42c6175ad5457281cf23a126 100755 (executable)
Binary files a/BlackBox/_OpenBSD_/dev0 and b/BlackBox/_OpenBSD_/dev0 differ
Binary files a/BlackBox/_OpenBSD_/dev0 and b/BlackBox/_OpenBSD_/dev0 differ