AsyncIO.pread

Issues a pread request, blocking the fiber connected to the provided suspended_job until the request finishes.

This will read buf.length number of bytes from fd to buf, starting from offset.

class AsyncIO
size_t
pread

Parameters

buf void[]

buffer to fill

fd int

file descriptor to read from

offset size_t

offset in the file to read from

suspended_job JobNotification

JobNotification instance to block the fiber on

Return Value

Type: size_t

number of the bytes read

Throws

ErrnoException with appropriate errno set in case of failure

Meta