os: implement file.Seek, add smoke test

This commit is contained in:
Dan Kegel
2022-01-01 07:51:31 -08:00
committed by Ron Evans
parent 84279ab2ec
commit 998f01608c
7 changed files with 91 additions and 5 deletions
+6
View File
@@ -64,3 +64,9 @@ func (f unixFileHandle) ReadAt(b []byte, offset int64) (n int, err error) {
}
return
}
// Seek wraps syscall.Seek.
func (f unixFileHandle) Seek(offset int64, whence int) (int64, error) {
newoffset, err := syscall.Seek(syscallFd(f), offset, whence)
return newoffset, handleSyscallError(err)
}