User guide

3.3. GLOBAL FUNCTIONS 51
This call causes the time stamp in datv t o be converted to three strings v, v+5 and
v+10. The string at v is set to the date in the form dd-mmm-yyyy. The string at v+5 is
set to th e the current time in the form hh:mm:ss, and the string at v+10 is set to the
day of the week. The upper bound of v should be at least 14 to be safe. The time stamp
is typically obtaine d by a call of datstamp(datv) which sets datv!0 to the number of
days since 1 January 1970, datv!1 to the number of milli-seconds since midnight and
datv!2 to -1 indicting that the new date and time format is being used.
delay(msecs) CIN:y, POS:y, NAT:y
This call suspends ex e c ut i on for at least m s ecs milli-seconds. Under Cintpos, this is
achieved by sending a suitable packet to the clock device (using sendpkt) and waiting
for it to be returned.
delayuntil(days, msecs) CIN:y, POS:y, NAT:y
This call suspends execution until the specified date and time is reached. days
specifies the date as the number of days si n ce 1 January 1970 and msecs i s the number
of mi l l i - se cond s since midnight. Under Cintpos, the delay is achieved by sending a
suitable packet to the clock dev i ce (using sendpkt) and wait i ng for it to be returned.
deleteco(cptr) CIN:y, POS:y, NAT:y
This call takes a coroutine poi nter as argument and, after checking that the corre-
sponding coroutine has no parent, deletes it by returning its stack to free store.
dcb := deletedev(devid) CIN:n, POS:y, NAT:n
This Cintpos function closes down the specified device and deallocates it device
identifier, but it does not return its device control block (DCB) to free store. It returns
any packets still on its work queue to the requesting tasks with both the pkt
res1 and
pkt
res2 fields set to -1. If successful, it retur ns the DCB of the deleted device. On
failure, it returns zero with result2 set to 101 indicating that devid was invalid. If any
of the released packets cause a higher priority task to b e com e runnable, the control
passes to the highest priority one leaving the current task suspended in RUN state.
The clock device has identifier -1 and is permanently resident and cannot be deleted.
flag := deletefile(name) CIN:y, POS:y, NAT:y
This call deletes the named file, returning if succe ssf ul , and FALSE otherwise.
res := deleteself(pkt, seg) CIN:n, POS:y, NAT:n
This Cintpos function first calls qpkt to return the packet if pkt is non zero, then
calls unloadseg(seg
) i f seg is non z er o, before de l et i ng the current task. This function
is defined in klib since it would be unsafe for it to be in a segment that may be
unloaded whil e it is being executes. It returns a non zero value if successful but, of
course, this value will never be seen! On failure, i t retur n zero with result2 set to 108
indicating that the curre nt task is not deletable.
res := deletetask(taskid) CIN:n, POS:y, NAT:n
This Cintpos function attempts to delete the specified task which must have an
empty work queue and be either the current task or in DEAD state. Its task control