HP OpenVMS Systems Documentation

Content starts here 6.4 I/O Buffers
HP OpenVMS I/O User’s Reference Manual: OpenVMS Version 8.4 > Chapter 6 Pseudoterminal Driver

6.4 I/O Buffers

When you create a pseudoterminal, you must provide at least one page to be used as an I/O buffer.

On Alpha and Integrity server systems, you can allocate one page and divide it into I/O buffers as needed.

No read or write request should reference more than one I/O buffer at a time. The I/O buffers must be page aligned; therefore, you should create these pages with the $EXPREG system service or the LIB$GET_VM_PAGE routine. The pages are owned by the driver until you delete the pseudoterminal. The application is responsible for managing the pages and cannot use buffers that are owned by another pseudoterminal. The application must decide whether to delete the buffers when they are freed by the driver or to reuse them.

The I/O buffers must be valid pages in virtual address space. Creating or deleting an I/O buffer does not alter the contents of the pages.

The low-order word of the status information longword contains the status of the request. The high-order word of the status information longword contains the actual number of bytes that are read or written.

Assume that an I/O buffer starting at 200 hexadecimal is available for use. If you want to read 20 bytes from the pseudoterminal, the readbuf address would be 200, and the readbuf_len would be 20. An application can use the rest of this buffer for other purposes, including reading or writing to the pseudoterminal. Figure 6-1 shows how the buffer would look.

Figure 6-1 Buffer Layout

Buffer Layout