/* * call-seq: * ios.pos => integer * ios.tell => integer * * Returns the current offset (in bytes) of <em>ios</em>. * * f = File.new("testfile") * f.pos #=> 0 * f.gets #=> "This is line one\n" * f.pos #=> 17 */ static VALUE rb_io_tell(io) VALUE io; { OpenFile *fptr; off_t pos; GetOpenFile(io, fptr); pos = io_tell(fptr); if (pos < 0 && errno) rb_sys_fail(fptr->path); return OFFT2NUM(pos); }