Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) SPT_WRITEREADX(2)
NAME
SPT_WRITEREADX - Writes data to a Guardian le from an array and waits for data to be
read back from the file
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <cextdecs.h>]
#include <spthread.h>
short SPT_WRITEREADX (
short filenum,
char *buffer,
unsigned short write_count,
unsigned short read_count,
[unsigned short *count_read ],
[long tag ]
);
PARAMETERS
filenum specifies the file number of a Guardian file open instance that identifies the file to
be read.
buffer specifies an array in the application process in which the information to be writ-
ten to the file is stored before the call. On return, buffer contains the information
read from the file.
write_count specifies the number of bytes to be written.
read_count specifies the number of bytes to be read.
count_read is for waited I/O only. This parameter returns a count of the number of bytes
returned from the file into buffer.
tag is for nowait I/O only. The tag value you define uniquely identifies the operation
associated with this call.
This parameter is supported only for program compatibility; if you provide it, it
is ignored.
DESCRIPTION
The SPT_WRITEREADX() function is the thread-aware version of the Guardian
WRITEREADX procedure.
The SPT_WRITEREADX() function writes data to a file from an array in the application pro-
cess, then waits for data to be transferred back from the file. The data from the read portion
returns in the same array used for the write portion.
If the file is opened for nowait I/O, you must not modify the buffer before the I/O completes with
a call to the Guardian AWAITIOX procedure. This condition also applies to other processes that
might be sharing the segment. The application must ensure that the buffer used in the call to the
SPT_WRITEREADX( ) function is not reused before the I/O completes with a call to
AWAITIOX.
For programming information about the WRITEREADX procedure, see the Enscribe
Programmer’s Guide and the Guardian Programmer’s Guide.
527186-023 Hewlett-Packard Company 7453