Changeset View
Changeset View
Standalone View
Standalone View
stand/kboot/hostfs.c
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
hostfs_read(struct open_file *f, void *start, size_t size, size_t *resid) | hostfs_read(struct open_file *f, void *start, size_t size, size_t *resid) | ||||
{ | { | ||||
hostfs_file *hf = f->f_fsdata; | hostfs_file *hf = f->f_fsdata; | ||||
ssize_t sz; | ssize_t sz; | ||||
sz = host_read(hf->hf_fd, start, size); | sz = host_read(hf->hf_fd, start, size); | ||||
if (sz < 0) { | if (sz < 0) | ||||
return (EINVAL); | return (host_to_stand_errno(sz)); | ||||
} | |||||
*resid = size - sz; | *resid = size - sz; | ||||
return (0); | return (0); | ||||
} | } | ||||
static off_t | static off_t | ||||
hostfs_seek(struct open_file *f, off_t offset, int whence) | hostfs_seek(struct open_file *f, off_t offset, int whence) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |