## device_read_overwrite

System Trap -- Read a sequence of bytes from a specific device into my address space.

### SYNOPSIS

    kern_return_t   device_read_overwrite
                    (mach_port_t                               device,
                     dev_mode_t                                mode,
                     recnum_t                                recnum,
                     io_buf_len_t                      bytes_wanted,
                     io_buf_pointer_t                          data,
                     mach_msg_type_number_t              data_count);

    kern_return_t   device_read_overwrite_request
                    (mach_port_t                             device,
                     mach_port_t                         reply_port,
                     dev_mode_t                                mode,
                     recnum_t                                recnum,
                     io_buf_len_t                      bytes_wanted,
                     io_buf_pointer_t                          data);

    kern_return_t   ds_device_read_reply_overwrite
                    (mach_port_t                        reply_port,
                     kern_return_t                      return_code,
                     io_buf_len_t                        data_count);

### PARAMETERS

device
  [in device send right] A device port to the device to be read.

reply_port
  [in reply receive (to be converted to send-once) right] The port to which the reply message is to be sent.

mode
  [in scalar] I/O mode value. Meaningful options are:

  D_NOWAIT
    Do not wait if data is unavailable.

recnum
  [in scalar] Record number to be read.

bytes_wanted
  [in scalar] Size of data transfer.

return_code
  [in scalar] The return status code from the read.

data
  [pointer to in array of bytes] Data buffer to be overwritten.

data_count
  [out scalar, in for asynchronous form] Number of returned data bytes.

### DESCRIPTION

The device_read_overwrite system trap reads a sequence of bytes from a device object directly into the caller's address space. The meaning of recnum as well as the specific operation performed is device dependent.

### NOTES

The device_read_overwrite_request and device_read_reply_overwrite calls may be removed from the interface in favor of new asynchronous support.

### RETURN VALUES

Only generic errors apply.

### RELATED INFORMATION

Functions: device_read, device_read_inband, device_reply_server.