Writing Device Drivers

uio(9S) Handling

These interfaces all handle moving data using the uio(9S) data structure.

int uiomove(caddr_t address, size_t nbytes,  
			enum uio_rw rwflag, struct uio *uio_p);

uiomove(9F) copies data between the address and the uio(9S) structure pointed to by uio_p. If rwflag is UIO_READ, data are transferred from address to a data buffer associated with the uio(9S) structure. If rwflag is UIO_WRITE, data are transferred from a data buffer associated with the uio(9S) structure to address.

int ureadc(int c, uio_t *uio_p);

ureadc(9F) appends the character c to a data buffer associated with the uio(9S) structure pointed to by uio_p.

int uwritec(uio_t *uio_p);

uwritec(9F) removes a character from a data buffer associated with the uio(9S) structure pointed to by uio_p, and returns the character.