diff options
author | Miles Bader <miles@gnu.org> | 1995-07-22 22:48:52 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-07-22 22:48:52 +0000 |
commit | 821c437692d52cc6c819c3f2fd997df37c26e64a (patch) | |
tree | 9171d29667be81a802160b205765bfdf73bd4b03 /devio/io.c | |
parent | d924ccec4fc2a082d00202d410f2798f8fd31f90 (diff) |
(trivfs_S_io_seek): Call open_seek instead of doing it ourselves.
Diffstat (limited to 'devio/io.c')
-rw-r--r-- | devio/io.c | 28 |
1 files changed, 2 insertions, 26 deletions
@@ -127,36 +127,12 @@ trivfs_S_io_readable (struct trivfs_protid *cred, kern_return_t trivfs_S_io_seek (struct trivfs_protid *cred, mach_port_t reply, mach_msg_type_name_t replytype, - off_t offset, int whence, off_t *new_offset) + off_t offs, int whence, off_t *new_offs) { if (!cred) return EOPNOTSUPP; else - { - error_t err = 0; - struct open *open = (struct open *)cred->po->hook; - struct io_state *io_state = open_get_io_state(open); - - if (!dev_is(open->dev, DEV_SEEKABLE)) - return ESPIPE; - - io_state_lock(io_state); - switch(whence) - { - case SEEK_SET: - io_state->location = offset; break; - case SEEK_CUR: - io_state->location += offset; break; - case SEEK_END: - io_state->location = open->dev->size - offset; break; - default: - err = EINVAL; - } - *new_offset = io_state->location; - io_state_unlock(io_state); - - return err; - } + return open_seek ((struct open *)cred->po->hook, offs, whence, new_offs); } /* ---------------------------------------------------------------- */ |