private RubyFixnum doSeek(ThreadContext context, long offset, int whence) {
OpenFile myOpenFile = getOpenFileChecked();
try {
myOpenFile.seek(offset, whence);
} catch (BadDescriptorException ex) {
throw context.getRuntime().newErrnoEBADFError();
} catch (InvalidValueException e) {
throw context.getRuntime().newErrnoEINVALError();
} catch (PipeException e) {