xcall ITC, func, type, mesg, retv
(UNIX only) ITC.SBR allows programs to send and receive messages between jobs.
Parameters
MAP1 FUNC,<any numeric type> ! opcode
MAP1 TYPE,<any numeric type> ! message type or process ID
MAP1 RETV,B,1 ! return code (0=ok)
MAP1 MESG ! message
MAP2 MTYPE,B,4 ! internal code
MAP2 MESGX,X,<any size> ! message contents
func
indicates the operation to perform, as described in the following table.
Value |
Meaning |
0 |
Send message to cooperating receiver |
1 |
Receive message (do not wait if not available) |
2 |
Receive message (wait until available) |
3 |
Send message and signal receiver |
|
Write exactly count characters (or up to null if count=0) |
type
identifies the type of message, or the process ID of the target job to signal. In the case of func 3, it must be the process ID of the target job to signal. (In this operation, the contents of the message may not be important; since the signal itself could be used to notify the target job to look for subsequent messages.) For the other operations, it must be a value that both sender and receiver agree on, because the receive operation will ignore messages not sent with the specified type. (The idea here is to allow multiple message formats or priorities to be used simultaneously.) The exception is that the receiver may set type=0 to receive the first message in the queue, regardless of its type. To avoid confusion between types that are process IDs and types that are message types, it is recommended that you adopt a standard of using message type values higher than the range of process IDs (which might extend as high as 2**24 on very large systems. Type should also be below 2**31 to avoid confusing them with negative type numbers, which are used to request to read any message whose mtype is less than or equal to the absolute value of the specified type.
mesg
contains the message to send or receive. Obviously, the communicating programs need to agree in advance on the layout corresponding to each message type. It must begin, as shown above, with a 4 byte field which is reserved for internal use by the subroutine. (Actually, it plugs the type value into mtype for outgoing messages, and ignores any incoming messages whose mtype does not match the type specified.)
retv
returns a 0 or 1 indicating the success of the operation (0 = success).
Comments
UNIX systems do not allow one user to signal another unless they are both share the same effective user ID or if the sender is root. For this reason, some sites set the "setuid" flag on the ashell executable to make all A-Shell users effectively the same user, or else they rely on the system administrator being able to switch to root in order to use operations which require signaling other users. Such operations include ITC.SBR FUNC=3, KILL.LIT, CHAT.LIT, SEND.LIT, FORCE.LIT, and JSTAT.LIT.