SNAX/APN Application Programming Manual
The SNALU Interface
SNAX/APN Application Programming Manual—420111-001
4-6
Sending and Receiving BIUs: WRITEREAD
Procedure
filenum 
is the number of an open file that identifies the file where the WRITEREAD is to 
occur.
buffer 
is the name of the application input/output buffer.
write-count 
is a variable or literal specifying the number of bytes to be transmitted from the 
buffer.
read-count 
is a variable or literal specifying the number of bytes to be accepted into the buffer.
count-read 
is a variable into which the file system deposits an integer that specifies the actual 
number of bytes that were put in the buffer by a completed read operation.
A WRITEREAD call can initiate a write operation, a read operation, or a write operation 
followed by a read operation: 
•
To initiate a write operation, the calling process places the outgoing BIU in the 
specified buffer and sets write-count to a nonzero value specifying the number 
of bytes to be transmitted. 
•
To initiate a read operation, the calling process sets read-count to a nonzero 
value specifying the maximum number of bytes to be accepted into the buffer.
In the case of a write operation followed by a read operation, the same buffer is used for 
both operations.
Following are examples of WRITEREAD operations with nowait I/O specified in each 
case:
1. Initiating a Write Operation
The following WRITEREAD call initiates a write operation that transmits 100 bytes 
from the application I/O buffer named APPLBUF:    
The WRITEREAD call completes when SNAX/APN accepts or rejects the write 
operation. The corresponding AWAITIO call completes when SNAX/APN has 
validated and moved the data into its own data space (see the discussion of 
“Outbound RU Error Codes” in Appendix B of this manual).
2. Initiating a Read Operation
WRITEREAD (filenum, APPLBUF, 100, 0)










