DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

cpass(D3oddi)


cpass, passc -- pass a character between user space and the kernel

Synopsis

int cpass();

int passc(int c);

Description

The cpass function returns the next character in a user write request and updates the user structure appropriately.

The passc function passes a character to a user read request and updates the user structure appropriately.

Arguments


c
character to be passed to the read request by passc.

Return values

The cpass function returns a character. The value -1 may be returned if no characters remain in the output request in u.u_count, or if there was an error when transferring data from user space. If an error occurs, EFAULT is set in u.u_error.

The passc function returns 0 on success. Otherwise, -1 is returned when the user read request has been satisfied, or if an error occurs when transferring data to user space. If an error occurs, EFAULT is set in u.u_error.

Usage

cpass( ) calls fubyte(D3oddi), but provides a more usable interface than fubyte in that cpass automatically updates u.u_count, u.u_offset, and u.u_base, and returns errors in u.u_error. If your data could contain a -1, use copyin(D3oddi) instead of cpass because a -1 in the data causes cpass (through fubyte) to return -1 and set an error, EFAULT.

passc( ) calls subyte(D3oddi), updates u.u_count, u.u_offset, and u.u_base, and returns errors in u.u_error. If your data could contain a -1, use copyout(D3oddi) instead of passc because a -1 in the data causes passc (through subyte) to return -1 and set an error, EFAULT.

Context and synchronization

User context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

These functions are not supported in DDI. Replace calls to cpass( ) with calls to copyin(D3); replace calls to passc( ) with calls to copyout(D3).

References

copyin(D3oddi), copyout(D3oddi), fubyte(D3oddi), subyte(D3oddi)

``Data, copying'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005