man.bsd.lv manual page server

Manual Page Search Parameters

PHYSIO(9) Kernel Developer's Manual PHYSIO(9)

physread, physwriteinitiate I/O on raw devices

#include <sys/buf.h>
#include <sys/device.h>

int
physread(struct dev_read_args *ap);

int
physwrite(struct dev_write_args *ap);

() and () are helper functions typically called from character device read and write routines to start I/O on a user process buffer. They will call the () routine one or more times depending on the size of transfer which is described by the ap argument.

The maximum amount of data transferable in one iteration of the () and () functions is determined by the maximum I/O size supported by the device dev, otherwise the value of MAXPHYS is used. Until the I/O operation is complete, the calling process or thread is put to sleep with the wait message set to ‘physstr’.

The () and () functions always await the completion of the entire requested transfer before returning, unless an error condition is detected earlier.

The ap argument is a pointer to a dev_read_args or dev_write_args structure, as passed to d_read or d_write.

If successful physread() and physwrite() will return 0.

The errno value EFAULT will be returned if the address range described by uio is not accessible by the calling process or thread.

Note that the actual transfer size may be less than requested by ap if the device signals an “end of file” condition.

read(2), write(2), uio(9)

November 9, 2008 DragonFly-5.6.1