Guardian C Library Calls Reference Manual
reply (supplementary)
3-154 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
reply (supplementary)
The reply function writes the response to a request made through the readupdate
function. Requests and responses are messages that are read from the $RECEIVE files
of two communicating processes.
message
points to the string containing the reply message.
write_count
specifies the number of bytes to write from *message. write_count must be in the
range 0 through 2048, inclusive.
message_tag
is the message tag of the particular message that requested this reply.
error_return
is a short specifying an error number to be returned to the requester associated with
this reply. The requester receives error_return as if it were a normal file-system
error. If you do not specify error_return, reply uses the value zero.
Return Value
is the number of bytes actually written if the operation is successful. This return
value corresponds to the count-written parameter of the REPLY system procedure. If
an error occurs, reply returns the value -1.
Usage Guidelines
•
If you omit message_tag, but not error_return, you must retain the comma following
message_tag as a placeholder; for example:
count_written = reply(fd, buf, count, , error);
•
If you opened $RECEIVE with a receive depth greater than one, you must specify
message_tag if you want to reply to a message other than the one most recently
received.
#include <fcntlh>
short reply(char *message, short write_count,
[short message_tag], [short error_return]);