Using the monwrite_hdr structure
The structure monwrite_hdr is used to pass DIAG x'DC' functions
and the application-defined product information to the device driver
on write()
calls.
When the application calls write()
,
the data it is writing consists of one or more monwrite_hdr structures.
Each structure is followed by monitor data. The only exception is
the STOP function, which is not followed by data.
The
application can write to one or more monitor buffers. A new buffer
is created by the device driver for each record with a unique product
identifier. To write new data to an existing buffer, an identical
monwrite_hdr structure must precede the new data
on the write()
call.
The monwrite_hdr structure also includes a field for the header length, which is useful for calculating the data offset from the beginning of the header. There is also a field for the data length, which is the length of any monitor data that follows. See /usr/include/asm/monwriter.h for the definition of the monwrite_hdr structure. Install package linux-glibc-devel-<version>.noarch if the header file is not available on your system.