User guide

64 CHAPTER 3. THE LIBRARY
res := sys(Sys
callc, c fd select, a1, a2, a3, a4, a5) CIN:y, POS:y, NAT:y
This inspects bit a1 in the bit vector a2. The result is 1 if the bit was set an d 0
otherwise.
The number of the bits to test is in a1. The bit vector identifying read sockets of
interest is in a2, The bit vector identifying write sockets of interest is in a3, The bit
vector identifying other sockets of interest is in a4. A point er to two words holding
the timeout in seconds and microseconds is in a5. The result is the number of sockets
that can now be read or written to, or 0 i f the timeout period has elapsed before any
sockets are ready. A result of -1 indicate an error.
res := sys(Sys
callnative, f, a1, a2, a3) CIN:y, POS:y, NAT:y
This function is used to enter a subroutine in native machi ne code.
res := sys(Sys
close, fp) CIN:y, POS:y, NAT:y
This closes the file whose file pointer is fp. It return 0 if successful.
res := sys(Sys
cputime) CIN:y, POS:y, NAT:y
This returns the CPU time in milliseconds since the Cintcode system was ente r ed .
res := sys(Sys
datstamp, datv) CIN:y, POS:y, NAT:y
This sets datv!0 to the number of days since 1 January 1970, and datv!1 to the
number of milli-seconds since midnight, and for compatability with the older version
of datstamp datv!2=-1 indicating the new date and time format is being used.
res := sys(Sys
delay, msecs) CIN:y, POS:y, NAT:y
In both Cintsys and Cintpos this call suspends Cintcode execution until th e time
period has elapsed. It is normally better to use the library functions delay(msecs) or
delayuntil(days, msecs).
res := sys(Sys
deletefile, name) CIN:y, PO S:y, NAT:y
This deletes the file whos e name is given by name. See page 81 for information
about the treatment of file names.
res := sys(Sys devcom, com, arg) CIN:n, POS:y, NAT:n
This is used in Cintpos to send commands from the interpreter th re ad to Cintpos
device threads.
res := sys(Sys dumpmem, context) CIN:y, POS:y, NAT:y
This call will dump the whole of Cintcode memory to the file DUMP.mem in a com-
pacted form that is typically inspected by either the commands dumpsys or dumpdebug.
By convention, context = 1 if SIGINT has been received, context = 2 if SIG SEG V
has been received, context = 3 if the dump was caused by BOOT detecting a fault,
context = 4 if the dump by the user call sys(Sys
quit, -2), context = 5 if the
dump by a non zero return code from the interpreter, context = 6 if the dump by the
D command in the interactive debugger.
res := sys(Sys filemodtime, name, datv) CIN:y, POS:y, NAT:y
This sets the elements of the time stamp vector datv to represent the date and