Next: Device Map, Previous: Device Read, Up: Device Interface
The function
device_writewrites data_count bytes from the buffer data to device. The number of bytes actually written is returned in bytes_written.If mode is
D_NOWAIT, the function returns without waiting for I/O completion. Otherwise mode should be 0. recnum is the record number to be written, its meaning is device specific.The function returns
D_SUCCESSif some data was successfully written andD_NO_SUCH_DEVICEif device does not denote a device port or the device is dead or not completely open.
The
device_write_inbandfunction works as thedevice_writefunction, except that the data is sent “in-line” in the request IPC message (see Memory).
This is the asynchronous form of the
device_writefunction.device_write_requestperforms the write request. The meaning for the parameters is as indevice_write. Additionally, the caller has to supply a reply port to which theds_device_write_replymessage is sent by the kernel when the write has been performed. The return value of the write operation is stored in return_code.As neither function receives a reply message, only message transmission errors apply. If no error occurs,
KERN_SUCCESSis returned.
The
device_write_request_inbandandds_device_write_reply_inbandfunctions work as thedevice_write_requestandds_device_write_replyfunctions, except that the data is sent “in-line” in the request IPC message (see Memory).